Skip to content

Fix ESP32-S31 deep sleep - #6372

Draft
bugadani wants to merge 69 commits into
esp-rs:mainfrom
bugadani:s31-deep-sleep
Draft

bugadani wants to merge 69 commits into
esp-rs:mainfrom
bugadani:s31-deep-sleep

Conversation

@bugadani

@bugadani bugadani commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Based on top of #6288

The key finding is that LP_ADC must be kept enabled if PMU is programmed with c_channel = 1.

@bugadani
bugadani marked this pull request as draft September 21, 2026 15:37
@bugadani bugadani added the skip-changelog No changelog modification needed label Sep 21, 2026
@github-actions github-actions Bot added the merge-conflict Merge conflict detected. Automatically added/removed by CI. label Sep 24, 2026
@github-actions

Copy link
Copy Markdown

New commits in main have made this PR unmergeable. Please resolve the conflicts.

@bugadani
bugadani force-pushed the s31-deep-sleep branch 2 times, most recently from 2f1563e to 7adf468 Compare September 24, 2026 09:17
@github-actions github-actions Bot added merge-conflict Merge conflict detected. Automatically added/removed by CI. and removed merge-conflict Merge conflict detected. Automatically added/removed by CI. labels Sep 24, 2026
@github-actions

Copy link
Copy Markdown

New commits in main have made this PR unmergeable. Please resolve the conflicts.

bugadani and others added 15 commits September 25, 2026 17:26
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Light sleep powers the BBPLL down. The BLE controller cannot transmit after the wake without it.

Co-authored-by: Cursor <cursoragent@cursor.com>
The Bt wakeup source refuses a sleep when the controller is awake or when its next event is too close. The controller turns the PHY off before the chip sleeps, so the BBPLL can power down. The controller wakes 3200 us before its event, as in ESP-IDF with light sleep.

Co-authored-by: Cursor <cursoragent@cursor.com>
A crystal that stays on through a light sleep needs the bias current of the active mode, as on ESP32-C3 and ESP32-S3.

Co-authored-by: Cursor <cursoragent@cursor.com>
The Bt wakeup source refuses a sleep while the controller is awake. The wakeup callback tells the controller whether the BLE timer ended the sleep, as in ESP-IDF.

Co-authored-by: Cursor <cursoragent@cursor.com>
The C5 takes the ESP32-C6 path with the ESP-IDF light-sleep delay of 2500 us. The C5 reconfigures the BBPLL after a light sleep, so BLE needs no BBPLL request.

Co-authored-by: Cursor <cursoragent@cursor.com>
The clocks ran on during a light sleep that kept the crystal on, which kept the sleep current high. ESP-IDF ungates only the clocks that a driver requests, and no esp-hal driver requests one.

Co-authored-by: Cursor <cursoragent@cursor.com>
The H2 takes the ESP32-C6 path with the ESP-IDF light-sleep delay of 5100 us.

Co-authored-by: Cursor <cursoragent@cursor.com>
The C61 takes the ESP32-C6 path, as in ESP-IDF. All NPL controllers now support light sleep.

Co-authored-by: Cursor <cursoragent@cursor.com>
The BTDM2 controller claims the Bt wakeup source with modem sleep, as in ESP-IDF btdm_lp. The Bt entry hook refuses the sleep when the next event is too close, and the controller wakes 1800 us before its event. All BLE controllers now support light sleep.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog No changelog modification needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant