#ZMK Firmware Sleep Explanation

1 messages · Page 1 of 1 (latest)

amber adder
#

Hi all 👋 I was hoping to get some clarification on the IDLE and SLEEP behavior of the ZMK firmware. More specifically what actions are taken when entering sleep? From what I gather from the firmware and documentation is that sleep basically uses "power-modeing" to turn off LEDs, the display, etc, as well as the BLE radio is turned off. My question is, does the CPU also go into a sleep state or are the power savings just achieved by turning off peripherals and the BLE?

If there is sleeping being done on the CPU core, could someone point me to where this is happening in the firmware?

Thanks!

tardy canopy
#

Idle is about shutting down peripherals that are power hungry, but not putting the core to sleep. Sleep puts the code into an "off" state as well.

#

Here's the activity code that is forcing that PM state.

#

On nRF52, this goes to a state where only a few inputs can wake it, RAM isn't retained, etc.

#

One such thing that can wake is a PORT event on the gpio controller, which is how "press any key in the keyboard to wake it up" occurs.