I am writing software for a battery-powered device that needs to go into the lowest power possible sleep mode when not in use and be able to wake up with one of 8 buttons are pressed so that it can transmit a Bluetooth BLE transmission to a receiver and then go back to sleep when complete.
Currently, I am using the function k_cpu_idle(), which seems to be mostly working as I measure 8uA sleep current when the MCU is asleep, but approximately every 5 seconds, I see a blip increase in the current up to 20uA followed by another larger blip of 40uA the following 5 seconds. Is this correct or is there a better way to perform this?
(Note that I am using the latest version, 2.8, of the toolchain and built the project to use Zephyr.)
main.c Code
* Initialize all GPIOs with configure_gpio_wakeup function.
* In my infinite while(1) loop, I call k_cpu_idle() to put the MCU into sleep mode.
prj.conf File Contents