2024-05-30 07:25 AM - edited 2024-05-30 07:27 AM
Hi There,
While reading the data from I2C, I see that the master is missing to send NACK.
Some fixed was done in https://github.com/STMicroelectronics/STM32CubeF4/issues/139 but those fixes are there in the code. But still sometime i see that NACK not being send out and slave pull the SDA line to low.
Is there any fix on this one?
Solved! Go to Solution.
2024-05-31 12:39 AM - edited 2024-05-31 12:52 AM
2024-05-30 10:11 AM
Hello @Ganesh-K-Grg and welcome to the Community,
Th issue has been fixed and released on STM32CubeF4 V1.28.0.
So, please make sure to update the I2C HAL driver and use the fix and improvement within the STM32CubeF4 V1.28.0.
2024-05-31 12:39 AM - edited 2024-05-31 12:52 AM
2024-05-31 07:23 AM - edited 2024-05-31 07:27 AM
Hi @Imen.D ,
After a long run test, what i found was not the HAL_BUSY. It is about the HAL_ERROR. Seems like BTF flag was not set.I put the break point in below code. What could be the reason of BTF not been set? Is it noise on the signal or something else. But when i see in oscilloscope, there are some spike on ACK. See in above image.
/* 3 Last bytes */
else
{
/* Wait until BTF flag is set */
if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_BTF, RESET, Timeout, tickstart) != HAL_OK)
{
return HAL_ERROR;
}
/* Disable Acknowledge */
CLEAR_BIT(hi2c->Instance->CR1, I2C_CR1_ACK);