AnsweredAssumed Answered

Problem in getting I2C working with 100KHz clock rate

Question asked by Josh Liu on Oct 3, 2017
Latest reply on Oct 17, 2017 by David Littell

Hi, I don't know if anyone has ever encountered the same issue I am encountering. When I set I2C clock rate to 100KHz and use HAL_I2C_Master_Receive command to receive I2C data, the I2C_WaitOnRXNEFlagUntilTimeout function would intermittently return an error even if the data has been successfully received. The reason the I2C_WaitOnRXNEFlagUntilTimeout function returns an error is because STOPF flag is being detected before FXNE flag is being detect. Looking closely at the code in the I2C_WaitOnRXNEFlagUntilTimeout function, I found there is a chance for firmware to detect STOPF flag before it detects FXNE flag, even if FXNE flag is being set before STOPF flag is being set. I don't know if anyone had this issue too.

Outcomes