espressif: check sleep memory reset reason only once per chip reset - #11274
Merged
dhalbert merged 1 commit intoAug 31, 2026
Merged
Conversation
esp_reset_reason() does not change across supervisor reloads. Checking it on every reload cleared sleep memory on every reload, including fake deep sleep wake, whenever the last chip reset was a clearing reset. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mikeysklar
force-pushed
the
fix-11167-sleep-memory-clear-once
branch
from
August 31, 2026 02:25
234c45f to
3403cc8
Compare
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Check sleep memory reset reason once per chip reset, not every reload.
Why
Fixes #11167. Reloads and fake deep sleep wake zeroed alarm.sleep_memory.
Hardware tested
TimeAlarm fake deep sleep on 10.3.0-rc.0 and this patch.
How I tested it
Wrote pattern, slept 12s, read back after wake, serial below.
Scope
Battery powered true deep sleep untested; all boards were USB powered.
Notes
Port-local guard matches nordic and stm reload-idempotent reset functions.
Test code and serial output
code.py, armed from the REPL with
microcontroller.nvm[0] = 1then ctrl-D:Metro ESP32-S3, 10.3.0-rc.0, after hub port power cycle:
Metro ESP32-S3, this patch, after hub port power cycle:
AI assistance
Claude wrote the fix and ran hardware tests; diff reviewed manually.
🤖 Generated with Claude Code