This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I2C Reads Stuck

Hi, I'm having an I2C read lock-up issue similar to those described herehere, and here.   

I'm using SES, SDK14.1, and an nRF52382.  The only other component on the I2C bus is an ST Micro LSM6DSMTR IMU. I'm using the TWIM library - I've implemented a timer user function as described in my post here.  When this happens, the nrf_twi_mgr times out, and I attempt to uninit and re-init the TWIM, but this has no effect.

The SDA signal ends up low each time, but that might just be coincidence.  I've been able to release SDA by disabling the TWI, setting my SCL pin as an output, and toggling it high and low an arbitrary amount of times.  Sometimes just once, sometimes several.  I believe it's whatever it takes to complete the byte in progress.  It sure seems like the transfer doesn't complete.  See attached scope picture.  There is no STOP, but nRF simply stops driving clock.  Looking at TWIM registers, there is no error - the only indication something is wrong is that the RX count rcvd (in this example 0x13) is not equal to the RX count requested (in this example 0x80).  I'm trying to  read 416 btyes (a maximum of 128 bytes per transfer) from the IMU's 4KB FIFO.  

Have there been any new developments with this issue in the last year?  Thanks.

Edit: I added code to toggle the SCL until SDA is released (up to 9 times) when the issue is detected.  So - the flow is un-init TWIM.  Toggle SCL.  init TWIM.  Unfortunately, I'll eventually get a TWI interrupt that is serviced while the TWI is disabled.  It then tries to use a bad TWI configuration to re-init the TWIM.  Is there anyway to flush the pending transaction or block future interrupts before, during, or after I  nrf_twi_mngr_uninit()?

:Stuck I2C Read

Parents Reply Children
No Data
Related