AnsweredAssumed Answered

I2C comm issue between MCUs

Question asked by Gregorio Vidal on Jan 23, 2018


I am using I2C to send data between two STM32F4 MCUs with the same MCU working as a Master always. The master MCU controls a display and sends the slave a massage just when the user changes a parameter.


I am using the HAL libraries and MXCube. For the master i am using the I2C function HAL_I2C_Master_Transmit(&hi2c1,slaveaddress,&MasterTX,SIZE,1000) and for the slave a callback as follow


void HAL_I2C_SlaveRxCpltCallback(I2C_HandleTypeDef *hi2c){

if (hi2c-> Instance==hi2c3.Instance){

HAL_I2C_Slave_Receive_IT(&hi2c3, (uint8_t*)SlaveRX,Size);


Everything works ok but eventually the slave stops receiving the messages from the master. The HAL_I2C_Master_Transmit reports an HAL_OK messages so  from  point of view of the master the communication is ok, but the slave doesn't receive anything, the callback function to received the data is not called.


I hope you can help me with this issue.


Thank you