Hi everyone,
I’m running into some issues with the I2Cv2 driver on STM32F769 in a high-noise I²C environment and would like some guidance:
1- When the driver receives a NACK, it stops communication on the bus and does not recover until I fully reinitialize the driver (calling i2cStart). Is it expected that recovery from a NACK should be handled at the upper layer, or should the low-level driver attempt automatic recovery?
2-Under very noisy conditions, I’ve observed bursts of interrupts that can trigger sometimes memory corruption (HardFault). I found a related issue in ArduPilot’s repository where they limited the number of isrs:
https://github.com/ArduPilot/ardupilot/pull/12896
However, this looks like an old workaround from 2019, and I haven’t found any equivalent fix in the current ChibiOS versions.
Has anyone here experienced similar behavior with the I2Cv2 driver?
I2Cv2 driver
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: I2Cv2 driver
Hi,
The driver can reach an I2C_ERROR state, it is meant to be restarted for recovery. Verify if you get an error state or if it is something else.
Giovanni
The driver can reach an I2C_ERROR state, it is meant to be restarted for recovery. Verify if you get an error state or if it is something else.
Giovanni
Re: I2Cv2 driver
Hi thanks for replying,
Yes, for the first point of NACK,the driver reports I2C_ACK_FAILURE, then the driver needs to be restarted by upper layer to recover.
regarding the second point it is hard to reproduce but under high noise environment i get different kinds of errors that's okay, but the problem is the bursts that can cause memory corruption sometimes
Yes, for the first point of NACK,the driver reports I2C_ACK_FAILURE, then the driver needs to be restarted by upper layer to recover.
regarding the second point it is hard to reproduce but under high noise environment i get different kinds of errors that's okay, but the problem is the bursts that can cause memory corruption sometimes
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: I2Cv2 driver
Hi,
It is hard to handle at driver level, you should put control codes or CRCs in your memory for integrity check after transfer. On write you should always read-back and compare.
Giovanni
It is hard to handle at driver level, you should put control codes or CRCs in your memory for integrity check after transfer. On write you should always read-back and compare.
Giovanni