Skip to content

Enable deep sleep on all ESP chips #9324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 18, 2024
Merged

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Jun 11, 2024

@tannewt tannewt added this to the 9.1.0 milestone Jun 11, 2024
@tannewt tannewt requested a review from dhalbert June 11, 2024 20:19
@tannewt tannewt force-pushed the more_esp_deep_sleep branch from e349c3b to 1aa2604 Compare June 11, 2024 20:37
@tannewt
Copy link
Member Author

tannewt commented Jun 11, 2024

This CI will need #9325. I didn't realize esp_sleep_enable_ext1_wakeup_io was introduced in 5.2.2.

@tannewt tannewt force-pushed the more_esp_deep_sleep branch from 1aa2604 to ed2f32f Compare June 13, 2024 17:27
@tannewt tannewt marked this pull request as ready for review June 17, 2024 20:07
@tannewt
Copy link
Member Author

tannewt commented Jun 17, 2024

Tested on Feather ESP32-S3 No PSRAM and it works. (I thought it didn't because I hadn't set pull.)

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this, and doing the detailed differences between the chips. This might be docuumented in shared-bindings in a Limitations: section, but we don't have to do that now.

@dhalbert dhalbert merged commit 8dc7364 into adafruit:main Jun 18, 2024
186 checks passed
@linuxhuskarl
Copy link

linuxhuskarl commented Apr 5, 2025

Hey, I am currently trying to get XIAO ESP32C3 board to go into deep sleep. I don't fully understand why alarm is unavailable for its port. This PR explicitly says that all ESP boards should have it available. I think most ESP32C3 ports don't have it. See for example my board:

https://circuitpython.org/board/seeed_xiao_esp32c3/

alarm module is unavailable for both CirPy v9 and v10.

Can you help me understand the issue? Is it possible to build a version of FW with alarm module available?

@Neradoc
Copy link

Neradoc commented Apr 5, 2025

Hi, it's disabled by default on some boards with 4MB of flash or less, but will be added in Circuitpython 10 once we change the partition scheme (which will be relatively painless on C3 boards if you are used to save your files before updating Circuitpython with esptool).

# We used to default to OTA partition layout but are moving away from it so that
# BLE and alarm can be included. This setting prevents the partition layout from
# changing.
ifeq ($(CIRCUITPY_LEGACY_4MB_FLASH_LAYOUT), 1)
ifeq ($(IDF_TARGET_ARCH), xtensa)
CIRCUITPY_ALARM ?= 1
else
CIRCUITPY_ALARM = 0
endif

Currently building with it would require modifying this file and disabling other modules to make some space.

@linuxhuskarl
Copy link

Hey, thanks for the quick response!

Hi, it's disabled by default on some boards with 4MB of flash or less, but will be added in Circuitpython 10 once we change the partition scheme

Is there a ETA for this?

Currently building with it would require modifying this file and disabling other modules to make some space.

I will look into that in the meantime. Thanks for the suggestion!

@dhalbert
Copy link
Collaborator

dhalbert commented Apr 7, 2025

Is there a ETA for this?

We don't give ETA's but it's actively being worked on. We need new bootloaders first.

@tannewt
Copy link
Member Author

tannewt commented Apr 7, 2025

Is there a ETA for this?

We don't give ETA's but it's actively being worked on. We need new bootloaders first.

C3 doesn't have a UF2 bootloader. We can do non-Sx now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deep Sleep / Alarm module for ESP32-C6 ('alarm' module not found)
4 participants