52832 TWIM EasyDMA slow

Hi All,

I develop a custom pcb with nrf52832 mcu. It reads acceleration data from the sensor's FIFO via i2c (TWIM). I use the nRF5_SDK_16.0.0 and FreeRTOS. I tried to decrease the power consumption, so I used the TWIM in non blocking mode while the CPU was sleeping.
But the difference (in power cunsumption) is not as big as I expected, because the transmission is much slower with EasyDMA than with CPU.
I tried to read 192 byte from the sensor's FIFO at a time. It took 4.8ms (@400kHz) with CPU (blocking mode) and 7.4ms with EasyDMA (non-blocking mode).The scope pictures shows that there is ~16 us delay between each byte with DMA. (SDA yellow, SCL red):

This gap is not present in the blocking mode:

What is the reason of this gap between of the bytes?

Can I avoid this with some setting of DMA or TWIM driver?

Cheers and thanks in advance for your help,

nevi

  • Interesting, 

    It is still not very clear if this is just the difference between blocking and EasyDMA hardware modes or if something else is coming into play.

    Assuming that you have tickless IDLE enabled, Is it possible for you to see if the FreeRTOS IDLE thread was called in the non blocking.

    Better would be to run SystemView to see if there are any other contexts coming into play. If we can exclude that 16us was not used to change context in the FreeRTOS then we can try to focus on the hardware difference and the TWI driver handling difference that caused that 16us gaps.

Related