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

TWI communication failes after soft reset

Hi community,

in our setup we use the LSM6DSL IMU using TWI. First we initialize the TWI peripheral, then we configure the IMU. After that we initialize PPI to automatically request information from the IMU once the IMU's interrupt pin toggles from low to high. Everything is working fine so far, unless we do a soft reset (e.g. triggered by an OTA update). Then ocassionally the initialization fails during nrf_drv_twi_tx.

Our first idea was that somehow the registers might not be reset correctly but regarding the nrf52832 datasheet they do. We also considered that some variables were retained in RAM. Therefore we forced clearing the bss section on startup by removing the following lines from gcc_startup_nrf52.S file.

#ifdef __STARTUP_CLEAR_BSS
#endif

Unfortuately this attempt did not help getting rid of our problem. Or is there a more elegant way to clean the RAM contents before entering main function?

Can it be that some the IMU communication disturbs the initialization of the TWI/PPI peripheral? Meanwhile I don't know what to do anymore :-/

Best regards

Christian

Parents Reply Children
Related