Other Parts Discussed in Thread: SYSCONFIG,
Hello!
We were previously using I2C in controller mode with FIFO to periodically communicate with another chip on our board and STANDBY1 mode while there is no communication required. Rough format of a typical I2C exchange is below, periodicity of exchange 100ms and duration of exchange including SW overhead <1ms. The MCU is in sleep for the remaining 99ms. Average current consumption of our entire board ~250uA.
send write address + send 2 bytes of register ID that we want to access + restart + send read address + read 8 bytes of data.
But now we want to switch to receive 10 bytes of data at a time. I2C FIFO only goes up to 8 bytes so we switched to DMA for the receive only. Configured the I2C+DMA as below and it works correctly, we get the expected 10 bytes of data:
- I2C interrupt on DMA event 2
- I2c RX FIFO level >= 1 byte
- DMA event 2 trigger = controller RX FIFO trigger
- Fixed addr to block addr. source is I2C1.MASTER.MRXDATA, destination is some buffer in RAM
- Source & destination length = byte
- transfer size = 10
- DMA transfer mode single
As I said the I2C communication works as expected. But the current consumption jumped from 250uA to ~1.8mA. I confirmed by toggling a pin around the WFI instruction that MCU is indeed in sleep for the ~99ms where it's not doing any I2C exchange. Normally I just call DL_I2C_disableController() instead of fully disabling the I2C peripheral with DL_I2C_disablePower() before sleep, but I have tried that too and there's no change in the consumption.
I'm setting DMAEN once before each 10 byte transfer. When the DMA transfer is finished I've confirmed that:
- DMAEN is set automatically back to 0
- I2C interrupt is hit with DL_I2C_IIDX_CONTROLLER_EVENT2_DMA_DONE
- No other I2C interrupt is hit
I suspect something in the DMA is keeping parts of the CPU awake, hence the high current consumption. Confirmed if I just comment the DL_DMA_enableChannel() call that the power consumption drops to ~0.2mA. But I can't find a way to directly disable/reset the DMA so I'm stuck.
Please help us since this current consumption is way outside of our application's budget.