cancel
Showing results for 
Search instead for 
Did you mean: 

STM32C031C6 I2C error handling

arti
Visitor

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!

0 REPLIES 0