HI,
how can I the recovery I2C bus is blocked. , SDA line low state?
Thanks
HI,
how can I the recovery I2C bus is blocked. , SDA line low state?
Thanks
Think we need a bit more information, for instance when does this occur? is it when you initializing the i2c, or at the end or middle of a i2c transfer? is the nrf52 operating in master or slave mode? is it the nrf52 that is holding the sda low? I suspect you typically need to uninit and init the i2c again to recover.
If necessary you can also turn the i2c off an on while unitiialized by writing to the power register shown here:
https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev2/ERR/nRF52832/Rev2/latest/anomaly_832_89.html
Kenneth
Hi
The nRF52832 is the master, and I have accelerometer, touch and heart rate sensor on the same bus.
I don't know why it hangs but the sda line stays down and I get communication error, red message from the system.
I think it is one of the three sensors that is waiting for the clock.
How do I get a series of pulses out on the SCL line when this happens? Thanks
Fausto
If you look at the implementation of nrf_drv_twi_init() you can find there is a:
if(p_config->clear_bus_init)
{
/* Send clocks (max 9) until slave device back from stuck mode */
twi_clear_bus(p_config);
}
So I recommend to try to uninit, then init with the clear_bus_init flag set to true.
Kenneth
Hi Kenneth,
in which file do I find nrf_drv_twi_init () do you have an example of how to use the uninit and init?
I have recently used this micro and ncs.
Thank you
Fausto
I was not aware you were using ncs, in that case this discussion may be helpful to find a workaround (different chip, but same problem):
https://devzone.nordicsemi.com/f/nordic-q-a/74731/nrf9160-i2c-twi-recovery-and-microsecond-resolution-timer