I2C bus recovery on Jetson Xavier AGX

I have a Jetson Xavier AGX 32GB developer kit system with a number of external sensor devices connected to I2C-1 via the 40-pin header. Polling these for information every few seconds works fine but then after about half an hour the bus locks up and I get -11 errors returned when trying to access the bus. This seems to be a classic case of the SDA line being held low by one of the external devices, which should be fixable by a string of clock pulses on the SCL line. I can see that there is mention of i2c_bus_recovery in the linux kernel but how can I do this from normal user space and preferably from python? The added complication is that my code is running inside a container so some things will be easier than others!

Yes, looks like you are hitting a case of SDA line being pulled low. In Jetson driver already handle scenarios by having a recovery mechanism for this. I2C driver detect such SDA getting pulled low scenarios and invoke an API which causes issuing of continuous SCL clock pulses to recover the bus and we return -EAGAIN(-11) as error code so that who ever has issued the i2c transfer can re-try the transfer on the recovered i2c bus.

For your case were getting -11 as error continuously. So seems i2c bus has been recovered (from SDA pulled low) successfully for a moment but because an external device is pulling the SDA line to low continuously we again have to invoke bus recovery operation… and this process is repeating continuously.

I think we can only fix this by identifying such faulty external device which is continuously pulling the SDA line(even after the recovery) and disabling/removing it from bus.

Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.