TWIM Errata 109

Hello Nordic,

I've been attempting to convert our system's TWIM implementation from the blocking to the non-blocking mode. I have been able to communicate fine with the external device (an LIS2MDL Magnetometer) while in the blocking mode, however, when I attempt to convert my implementation to the non-blocking mode, it appears that the MCU is not correctly sending the configurations that I am interested in.

When I use the blocking mode, I use a NRFX_TWIM_XFER_DESC_TX() descriptor with the nrfx_twim_xfer() to transfer a configuration, and then use the NRFX_TWIM_XFER_DESC_RX() descirptor with the nrfx_twim_xfer() to check if the configuration was applied, and it has. When in non-blocking mode, I use the NRFX_TWIM_XFER_DESC_TXTX descriptor and wait until the handler provides a NRFX_TWIM_EVT_DONE event where I check the p_event information. The information stored there appears to be the correct information (aka the value of the configuration I wanted to set on the LIS2MDL). However, when I then check this using the NRFX_TWIM_XFER_DESC_TXRX descriptor, the value of the register that I just tried to change remains unchanged (in this case, the LIS2MDL is idle and won't send me sensor data).

From doing a little research, I found this document on Anomaly/Errata 109 which appears to be related to this issue. I've tried to enable the TWIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED macro in both the apply_old_config.h and the sdk_config.h, but this did not fix the issue.

Any help would be greatly appreciated.

Joseph

  • Vidar,

    Thanks again for all of your help! Looking at the LIS2MDL datasheet, I can see that it indeed is not expecting a repeated start, and so the repeated start on the TXTX descriptor would interfere with the expected behavior for the LIS2MDL. The implementation described a few messages ago will work, so thanks for helping get to the solution and the explanation!

    Joseph

  • I am facing the same issue.

    Using nrf52832 and TX-RX works perfectly for 3D Magnetometer (MMC5603NJ)!

    >> getting product ID properly.

    However, TX-TX seems to have an issue that configuration never works.

    I checked all of the code and found no issue. 

    Unforunately, It's very small PCB so I couldn't put test-points on the board.

    So if it's the issue I am facing and to work-around it, should I use TX twice instead of TX-TX?

Related