Skip to main content
Visitor II
February 25, 2025
Question

STM32C031C6 I2C error handling

  • February 25, 2025
  • 1 reply
  • 392 views

I am using STM32C031C6 MCU connected to an NTAG5 IC via I²C. The MCU is configured as an I²C master transmitter and master receiver. Polling mode is used to transmit and receive data to/from the NTAG5.

Below is the code I am using to write and read I²C data. Currently, I have not considered any error conditions such as BERR, ARLO, etc., as described in section 23.4.16 (Error conditions) of the RM0490 STM32C0x1 reference manual.

arti_0-1740444824068.png

arti_1-1740445145026.png

 

I am not sure how to generate these errors and whether it is necessary to handle them in a setup with one master and one slave. If error handling is required, what actions should be taken, such as generating a STOP condition, clearing errors etc?

Could you please provide guidance on how to generate & handle these error conditions and whether it is necessary to implement error handling in this scenario?

Also is it better to reset I2C peripheral in case timeout happens? 

Thank you!

    This topic has been closed for replies.

    1 reply

    ST Employee
    February 27, 2025

    Hi All,

     

    This post has been escalated to the ST Online Support Team for additional assistance. We'll contact you directly.

     

    Regards,
    Jake

    ST Support