I2C master slave communication is not working properly
I have two MCU's one from F4 series and another from H7 series, Using F4 MCU for calculation of some data and want configured as I2C master which sends data to the H7 MCU. Where as H7 MCU is configured as slave and which responds to address from first MCU.
The communication doesn't work on the first go, but when i manually restart the F4 Master MCU it starts working for some time and send data to H7 correctly but after few mins it stops
i have tried resetting master MCU I2C by checking HAL_I2C_IsDeviceReady but its not working either
using HAL_I2C_EnableListen_IT(hi2c); in the start itself for H7 and following enabling after each completion of transaction
extern void HAL_I2C_ListenCpltCallback (I2C_HandleTypeDef *hi2c)
{
HAL_I2C_EnableListen_IT(hi2c);
}
void HAL_I2C_SlaveTxCpltCallback(I2C_HandleTypeDef *hi2c) {
// Re-enable listening after transmission
HAL_I2C_EnableListen_IT(hi2c);
}
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c)
{
HAL_I2C_EnableListen_IT(hi2c);
}How to fix this? can someone guide me in the right direction.
It works for the first few mins and thats why the circuit is correct ans im ruling out that. how to debug this issue?
