You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding RP2040 sleep memory is actually kind of tricky because of the way we handle the general RAM during deep sleep. Unlike every other port, the RP2040 is actually incapable of fully shutting down the RAM during deep sleep - even the lowest power settings still retains all data. In an effort to be as close as possible to the other ports, which typically lose all memory when deep sleeping, the RP2040 port currently implements a watchdog reset after deep sleeping, resetting all RAM except for a specific collection of watchdog registers which store the alarm information.
Because there's no specific region of memory like STM's BKUPSRAM or the ESP32S2 low power banks that bypasses our deep sleep (because the RP2040 expects that all memory should be available across deep sleep), implementing SleepMemory will require removing the watchdog reset and treating true deep sleep more like a "fake" deep sleep. This will require API changes like removing the NORETURN label on common_hal_alarm_enter_deep_sleep, and probably has a bunch of little gotchas that will need to be accounted for. However, once those are finalized, SleepMemory can be implemented simply as a static array in regular memory.
Adding RP2040 sleep memory is actually kind of tricky because of the way we handle the general RAM during deep sleep. Unlike every other port, the RP2040 is actually incapable of fully shutting down the RAM during deep sleep - even the lowest power settings still retains all data. In an effort to be as close as possible to the other ports, which typically lose all memory when deep sleeping, the RP2040 port currently implements a watchdog reset after deep sleeping, resetting all RAM except for a specific collection of watchdog registers which store the alarm information.
Because there's no specific region of memory like STM's BKUPSRAM or the ESP32S2 low power banks that bypasses our deep sleep (because the RP2040 expects that all memory should be available across deep sleep), implementing SleepMemory will require removing the watchdog reset and treating true deep sleep more like a "fake" deep sleep. This will require API changes like removing the
NORETURN
label oncommon_hal_alarm_enter_deep_sleep
, and probably has a bunch of little gotchas that will need to be accounted for. However, once those are finalized, SleepMemory can be implemented simply as a static array in regular memory.This feature is required for #5080.
The text was updated successfully, but these errors were encountered: