adafruit / circuitpython

CircuitPython - a Python implementation for teaching coding with microcontrollers
https://circuitpython.org
Other
4.05k stars 1.2k forks source link

RP2040: Deep sleep until alarm without reset #8771

Open rgov opened 8 months ago

rgov commented 8 months ago

Since the RP2040 preserves RAM when in the dormant (deep sleep) state, is it not possible to resume the program after an alarm, without resetting the board? This would make it significantly easier to preserve state while dropping into lower power modes.

@ghubcoder's blog post describes how to recover from the dormant state after an RTC alarm. This was implemented for MicroPython in modpicosleep.c (accompanying blog post).

dhalbert commented 8 months ago

I think we could do this for "light sleep", and make light sleep be a deeper sleep.