ESP32-C6: WAKEUP_ALL_LOW causes GPIO pin to be stuck upon waking from deeepsleep
Port, board and/or hardware
ESP32_C6_GENERIC, Seeed Studio XIAO ESP32-C6
MicroPython version
MicroPython v1.25.0 on 2025-04-15; ESP32C6 module with ESP32C6
Reproduction
- Copy the code below into
main.pyon an ESP32-C6 board. - Reset the board.
from machine import Pin, deepsleep
from esp32 import wake_on_ext1, WAKEUP_ALL_LOW
from time import sleep_ms
BUTTON_PIN = 0 # must be RTC-capable pin.
LED_PIN = 15 # XIAO ESP32-C6 User LED pin, active LOW
sleep_ms(1000) # wait for button to be released
button = Pin(BUTTON_PIN, Pin.IN, Pin.PULL_UP)
led = Pin(LED_PIN, Pin.OUT, value=1) # active low
def blink_led(period_ms):
led.value(0) # turn on LED
sleep_ms(period_ms)
led.value(1) # turn off LED
blink_led(500)
if button.value() == 1:
wake_on_ext1([button], WAKEUP_ALL_LOW)
deepsleep()
else:
print("Button is pressed. Not going to sleep.")
while True:
sleep_ms(100)
blink_led(100)
Expected behaviour
Expected to long-blink the LED once after reset.
If pin GPIO 0 is briefly connected to GND you should get another single blink.
Observed behaviour
The LED long-blinks once, then again after 1 second, then flashes rapidly, indicating that pin 0 is stuck LOW.
Interrupting with mpremote repl you can examine the state of button:
>>> button.value()
0
>>>
Additional Information
If you use esp32.WAKEUP_ANY_HIGH (and Pin.PULL_DOWN) it works correctly.
Also, wake_on_ext0(button, WAKEUP_ALL_LOW) doesn't wake up on the GPIO going LOW.
Code of Conduct
Yes, I agree
Bug: Deep Sleep Wake-up Issue on ESP32-C3
Port, board and/or hardware
ESP32 PORT, ESP32-C3 Super Mini
MicroPython version
Micropython 1.24.1
Reproduction
Title: Bug: Deep Sleep Wake-up Issue on ESP32-C3
Description:
I am experiencing an issue with the deep sleep wake-up functionality on the ESP32-C3 using MicroPython. The device does not wake up as expected when a GPIO pin changes from low to high.
Steps to Reproduce:
- Flash the latest version of MicroPython on an ESP32-C3.
- Use the following code to enter deep sleep and wake up on a GPIO pin change:
import machine import esp32 import time WAKEUP_GPIO_PIN = 0 LED_GPIO_PIN = 8 pin = machine.Pin(WAKEUP_GPIO_PIN, machine.Pin.IN, machine.Pin.PULL_UP) esp32.wake_on_ext0(pin=pin, level=esp32.WAKEUP_ANY_HIGH) wake_reason = machine.wake_reason() if wake_reason == machine.WAKEUP_EXT0: print("Woke up from deep sleep") machine.Pin(LED_GPIO_PIN, machine.Pin.OUT).value(1) time.sleep(1) machine.Pin(LED_GPIO_PIN, machine.Pin.OUT).value(0) else: print("Entering deep sleep") time.sleep(2) machine.deepsleep()
Expected behaviour
Wake up with change on GPIO0.
Observed behaviour
Does not wake up.
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree