Problem getting board to board I2C communication to work on STM32
Check you have sensible pull-up resistors on SDA and SCL. 

Reducing the value of these resistors can be helpful to overcome capacitance and noise.

Also, make sure the 0V is bonded well between the boards.