R_IIC_MASTER APIs could keep returing an error due to SDA being kept low

R_IIC_MASTER APIs could keep returing an error due to SDA being kept low

R_IIC_MASTER APIs could keep returing an error due to SDA being kept low

Backgound:

During I2C communication, unexpected communication failures can happen due to an abnormal I2C bus state. This article presents a solution for addressing such issues.

Question:

When the R_IIC_MASTER_Write or R_IIC_MASTER_Read function is executed, it may return FSP_ERR_IN_USE and then continues to return the error on subsequent atempts. What causes FSP_ERR_IN_USE error, and how can it be resolved?

Answer:

The FSP_ERR_IN_USE error may occur if a slave device is holding the SDAn line low, causing the I2C bus to remain busy. In this situation, the R_IIC_MASTER_Write or the R_IIC_MASTER_Read function cannot initiate communication and returns this error. To resolve this issue, refer to the "Extra SCL Clock Cycle Output Function" section in the User’s Manual. This function can be used to generate additional clock pulses on the SCLn line, which may release the slave device from holding the SDAn line low, thereby restoring normal bus operation.