I stumbled onto a solution that gives reasonable idle mode power with the Xiao nrf52840 on Zephyr RTOS. I’m currently getting 1.0uA in system off sleep and 12uA in idle mode. I thought others might be interested.
I was stuck for a long time with idle power between 190-570 uA. The solution I stumbled into gets close to the 1uA idle, and 3uA system_off sleep that was achievable with the Arduino code base as described in Getting lower power consumption on Seeed XIAO nRF52840.
I was originally working on Zephyr 3.2 and nrf Connect for desktop. When I couldn’t make headway I upgraded to zephyr 3.3. In zephyr 3.3 the flash device was upgraded to the QSPI interface. However, there is a bug where it fails to come out of deep sleep (Exiting Deep Power Down on a p25q16h not working), so I ported the SPI flash configuration in 3.2 to the 3.3 environment. In the process I moved the device to spi2 from spi3. This solved a major idle mode power issue. I went back to 3.2 and confirmed that this also addressed the problem in that release.
I’ve tried to disabled non-critical devices, but haven’t gotten any closer to the 3uA achieved on the Arduino code base. Next I might try to explicitly put the flash chip in deep power down mode while in idle.
I’d be interested if anyone has info on this topic or other ideas to try.
Attached code snippets demonstrate system on sleep (idle), system off sleep, and wake from system off. This should work with both Zephyr 3.2 and 3.3.
power_test.zip (3.4 KB)
Power measurements with PPK2:
- Starting point: idle 190uA, system off sleep 186uA
- Enable default flash device on sp3: idle 570uA, system off sleep 41uA
- CONFIG_PM_DEVICE=y: idle 566uA, system off sleep 1.0 uA
- Put flash on spi2: idle 22uA, system off sleep 1.0 uA
- Switch to sense interrupts: idle 11.5uA, system off sleep 1.0uA