← index #17334Issue #4060
Related · high · value 0.269
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

ESP32 module wake on touch, wake on ext1

openby tahouseopened 2018-08-17updated 2019-05-28
port-esp32

Hi there,

I'm running MicroPython v1.9.4-409-g434975def and have successfully used a Pin irq to wake from deep sleep and can confirm the wake reason:

import machine
from machine import Pin, TouchPad, deepsleep
import time

wake = Pin(14, mode = Pin.IN, pull = Pin.PULL_DOWN)
wake.irq(trigger=Pin.WAKE_HIGH, wake = machine.DEEPSLEEP)

time.sleep(5)
deepsleep(5*1000)

after bringing Pin 14 line up to 3V3

Reset cause:  DEEPSLEEP_RESET
Wake reason:  PIN_WAKE/EXT0_WAKE

Now I'm trying to do the same but with a TouchPad input:


from machine import Pin, TouchPad, deepsleep
import time
import esp32

wake = Pin(14, mode = Pin.IN)
touch = TouchPad(wake)
touch.config(500)
esp32.wake_on_touch(True)

time.sleep(5)
deepsleep(5*1000)

(after 5 seconds and touching/untouching wire to Pin 14)

Reset cause:  DEEPSLEEP_RESET
Wake reason:  TIMER_WAKE

The range of my touch.read() values are around 700 when untouched, and down to around 100 when touched. I've tried adjusting the touch.config to various settings but I cannot get my ESP32 to wake from touch.. only from timer in this mode.

Lastly,
I've tried using wake_on_ext1

import machine
from machine import Pin, TouchPad
import time
import esp32
wake = Pin(14, mode = Pin.IN, pull = Pin.PULL_DOWN)
esp32.wake_on_ext1(pins = [wake], level = Pin.WAKE_HIGH)

time.sleep(5)
deepsleep(5*1000)

But this resets immediately regardless of whether I bring Pin 14 high or not (not in touch mode, mind you).

Reset cause:  DEEPSLEEP_RESET
Wake reason:  EXT1_WAKE

I've browsed through the esp32 module code, but I'm not sure if any of the wake modes work?

Any ideas?

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