← index #17334Issue #16839
Related · high · value 3.366
QUERY · ISSUE

ESP32-C6: WAKEUP_ALL_LOW causes GPIO pin to be stuck upon waking from deeepsleep

openby ned-pcsopened 2025-05-21updated 2025-05-21
bug

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

  1. Copy the code below into main.py on an ESP32-C6 board.
  2. 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

CANDIDATE · ISSUE

Bug: Deep Sleep Wake-up Issue on ESP32-C3

openby stefan21-techopened 2025-03-01updated 2025-05-22
bugport-esp32

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:

  1. Flash the latest version of MicroPython on an ESP32-C3.
  2. 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

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied