MCU: S32K344
OS: FreeRTOS
S32 Design Studio: 3.4.3
Hi Team,
We are using a custom board based on the S32K344 MCU. We are facing an issue where the MCU hangs during runtime under certain I2C error conditions.
We have an IMU slave device connected via the I2C interface. Occasionally, when:
the I2C write API does not return or enter a timeout state. As a result, the FreeRTOS task performing the I2C transaction gets stuck indefinitely, which eventually causes the application to hang.
Any guidance or references would be greatly appreciated.
Thanks & Regards,
Vinay
Hi @vinaykl,
You have a very old RTD.
Is there a reason for it?
There have been many bugs fixed between RTD 2.0.0 and current RTD 7.0.0.
I assume you use the blocking APIs of the I2C driver.
Use the Async transfer API along with GetStatus() and timeout instead.
If the Slave device keeps holding SDA low, it can be recovered, refer to I2C user manual:
Section 3.1.16 Bus clear
https://www.nxp.com/docs/en/user-guide/UM10204.pdf
The RTD drivers do not have APIs for the recovery.
An example is in this AN4803
I2C restore function definition
https://www.nxp.com/docs/en/application-note/AN4803.pdf
Regards,
Daniel