Light Sleep Wakeup Fails on ESP32-C6-Super Mini Board (Works on ESP32-WROOM)

Post Body:
Hi everyone,

I'm having trouble getting my ESP32-C6-Super Mini board to wake up from light sleep using a button (and even with a timer). My project works fine on an ESP32-WROOM board, but when I switch to the C6-Super Mini, it enters sleep correctly yet never wakes up.

Below are my two code examples and observations.


Working on ESP32-WROOM (using EXT0):

cpp

#include "esp_sleep.h"
#include <Arduino.h>

struct Button {
  uint8_t pin;
  bool pressed;
  void init() {
    pinMode(pin, INPUT_PULLUP);  
    pressed = false;
  }
  bool update() {
    bool now = (digitalRead(pin) == LOW);
    if (now && !pressed) {
      pressed = true;
      return true;
    }
    if (!now) {
      pressed = false;
    }
    return false;
  }
};

Button btn = {25, false};

enum State {
  STATE_AWAKE,
  STATE_WAIT_RELEASE,
  STATE_ENTER_SLEEP,
  STATE_SLEEPING,
  STATE_WAKEUP
};

State currentState = STATE_AWAKE;

void setup() {
  Serial.begin(115200);
  delay(1000);
  Serial.println("ESP32-C6 Light Sleep Toggle (EXT1 Wakeup)");

  btn.init();
  // Using EXT0 wakeup here on pin 25
  esp_sleep_enable_ext0_wakeup((gpio_num_t)btn.pin, 0);
}

void loop() {
  switch (currentState) {
    case STATE_AWAKE:
      if (btn.update()) {
        Serial.println("Button pressed in awake state.");
        currentState = STATE_WAIT_RELEASE;
      }
      break;
    case STATE_WAIT_RELEASE:
      if (digitalRead(btn.pin) == HIGH) {
        Serial.println("Button released. Preparing to enter light sleep...");
        currentState = STATE_ENTER_SLEEP;
      }
      break;
    case STATE_ENTER_SLEEP:
      Serial.println("Entering light sleep mode (EXT1)...");
      currentState = STATE_SLEEPING;
      esp_light_sleep_start();
      currentState = STATE_WAKEUP;
      break;
    case STATE_WAKEUP:
      Serial.println("Woke up from light sleep via EXT1!");
      currentState = STATE_AWAKE;
      break;
  }
  delay(10);
}

Serial Monitor Output on ESP32-WROOM:

css

Button pressed in awake state.
Button released. Preparing to enter light sleep...
Entering light sleep mode (EXT1)...
Woke up from light sleep via EXT1!
...

I also measured the current: it drops from around 60mA to 20mA when in sleep, which seems normal.


Failing on ESP32-C6-Super Mini (using EXT1):

cpp

#include "esp_sleep.h"
#include <Arduino.h>

struct Button {
  uint8_t pin;
  bool pressed;
  void init() {
    pinMode(pin, INPUT_PULLUP);
    pressed = false;
  }
  bool update() {
    bool current = (digitalRead(pin) == LOW);
    if (current && !pressed) {
      pressed = true;
      return true;
    }
    if (!current) {
      pressed = false;
    }
    return false;
  }
};

Button btn = {7, false}; // Using GPIO 7

enum State {
  STATE_AWAKE,
  STATE_WAIT_RELEASE,
  STATE_ENTER_SLEEP,
  STATE_SLEEPING,
  STATE_WAKEUP
};

State currentState = STATE_AWAKE;

void setup() {
  Serial.begin(115200);
  delay(1000);
  Serial.println("ESP32 Light Sleep Toggle Example");

  btn.init();

  // Keep RTC peripheral power on for internal pull-up stability
  esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);

  // EXT1 wakeup configuration: wake up when GPIO7 goes LOW
  esp_sleep_enable_ext1_wakeup((1ULL << btn.pin), ESP_EXT1_WAKEUP_ANY_LOW);
}

void loop() {
  switch (currentState) {
    case STATE_AWAKE:
      if (btn.update()) {
        Serial.println("Button pressed in awake state.");
        currentState = STATE_WAIT_RELEASE;
      }
      break;
    case STATE_WAIT_RELEASE:
      if (digitalRead(btn.pin) == HIGH) {
        Serial.println("Button released. Preparing to enter light sleep...");
        currentState = STATE_ENTER_SLEEP;
      }
      break;
    case STATE_ENTER_SLEEP:
      Serial.println("Entering light sleep mode...");
      currentState = STATE_SLEEPING;
      esp_light_sleep_start();
      currentState = STATE_WAKEUP;
      break;
    case STATE_WAKEUP:
      Serial.println("Woke up from light sleep!");
      currentState = STATE_AWAKE;
      break;
  }
  delay(10);
}

Serial Monitor Output on ESP32-C6-Super Mini:

mathematica

복사

ESP32 Light Sleep Toggle Example
Button pressed in awake state.
Button released. Preparing to enter light sleep...
Now, entering sleep...

After entering sleep, the board never wakes up—even when I try pressing the button.


Additional Test with Timer Wakeup Only on ESP32-C6-Super Mini:

cpp

#include <Arduino.h>
#include "esp_sleep.h"

const int BUTTON_PIN = 7;

void setup() {
  Serial.begin(115200);
  delay(1000);

  pinMode(BUTTON_PIN, INPUT_PULLUP); // Default HIGH
  gpio_wakeup_enable((gpio_num_t)BUTTON_PIN, GPIO_INTR_LOW_LEVEL);
  esp_sleep_enable_gpio_wakeup();

  // Timer wakeup after 5 seconds
  esp_sleep_enable_timer_wakeup(5000000ULL);

  Serial.println("Entering Light Sleep in 3 seconds...");
  delay(3000);

  Serial.println("Now sleeping...");
  esp_light_sleep_start();

  Serial.println("Woke up!");
}

void loop() {
  delay(1000);
  Serial.println("Sleep again...");
  esp_light_sleep_start();
  Serial.println("Woke up again!");
}

Serial Output:

mathematica

Entering Light Sleep in 3 seconds...
Now sleeping...

After entering sleep, no wakeup occurs.


Summary of the Problem:

  • On the ESP32-WROOM board, my code works perfectly—the board sleeps and wakes via the button (or EXT0) as expected.
  • On the ESP32-C6-Super Mini board, while sleep is successfully entered (confirmed by the current drop), the board never wakes up—neither with button wakeup (using EXT1) nor with a timer wakeup.

Questions/Observations:

  • Could there be a bug or incomplete implementation in the Arduino core for ESP32-C6 affecting wakeup functions (esp_light_sleep_start(), EXT1, GPIO wakeup, timer wakeup)?
  • Is it possible that the ESP32-C6-Super Mini board’s pin mapping or RTC configuration differs from what the code assumes?
  • Any suggestions on debugging this or a workaround would be greatly appreciated.

Please let me know if any part of this description seems off or if there are additional details I should include. Thanks in advance for your help!


Feel free to edit or add any hardware details (such as external pull-ups, wiring, etc.) to further clarify your setup. Good luck, and I hope this helps get to the bottom of the issue!

I'll just add this experience with ESP32-C6 super-mini light sleep. It appears that some timed short sleeps (say less than 1ms) can work but longer ones can hang.

This test was part of a benchmark test suite developed by @outbackhut here. Universal Arduino Benchmark

code:

/*
 * This test sketch fails on an ESP32-c6 super-mini if the sleep period is > 1000us
 * It simply never wakes up.
 * 
 * ESP32-C6
 * IDE 1.8.19 (to copy large dataset from serial monitor)
 * ESP32 core version 3.3.4
 * 
 * 
 * 
 * see
 * https://esp32.com/viewtopic.php?t=38905&start=10
 * https://forum.arduino.cc/t/universal-arduino-benchmark/1427840/  post #31onwards
 * https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/api-reference/system/sleep_modes.html#id1
 * https://forum.arduino.cc/t/light-sleep-wakeup-fails-on-esp32-c6-super-mini-board-works-on-esp32-wroom/1355293
 */

 
// ESP32 Light Sleep Benchmark
void benchmarkESP32Sleep() {


  uint64_t testDurations[] = { 100, 500, 1000, 5000, 10000 };
  int d;

  for ( d = 0; d < 4 ; d++ ) {

    esp_sleep_disable_wakeup_source( ESP_SLEEP_WAKEUP_ALL ) ;
    Serial.println();
    Serial.print( "duration (us): " ) ;
    Serial.println( testDurations[ d ]  ) ;
    Serial.printf( "starting sleep. micros= %lu \n" , micros() ) ;
    uint64_t err = esp_sleep_enable_timer_wakeup(testDurations[d]);
    if ( ! (err == ESP_OK) ) Serial.println( "bad RC from esp_sleep_enable_timer_wakeup" ) ;
    else {
      esp_light_sleep_start();
      Serial.printf( "ending   sleep. micros= %lu \n" , micros() ) ;
    }
    delay(1000) ;
    
  }

}



void setup() {
  Serial.begin(115200) ;
  pinMode(LED_BUILTIN, OUTPUT);

  // The super-mini (native USB) code upload seems to work best if
  // (a) the serial monitor is closed in the IDE
  // (b) the super-mini is disconnected from the USB cable then reconnected.
  // (c) the code upload is started. The delay below gives you time to restart the serial monitor.
  for ( int i = 0; i < 10 ; i++ ) {
    digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
    delay(1000);                       // wait for a second
    digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
    delay(100);
  }
  
  Serial.print("starting test . . .") ;
  benchmarkESP32Sleep() ;
}

void loop() {
  delay(50) ;
}

Verbose core debug output gives no real clue but it hangs in the 5000us test.

[    15][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Dein=========== Before Setup Start ===========
Chip Info:
------------------------------------------
  Model             : ESP32-C6
  Package           : 1
  Revision          : 0.02
  Cores             : 1
  CPU Frequency     : 160 MHz
  XTAL Frequency    : 4dded Flash    : No
  Embedded PSRAM    : No
  2.4GHz WiFi       : Yes
  Classic BT        : No
  BT Low Energy     : Yes
  IEEE 802.15.4     : Yes
------------------------------------------
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   459800 B ( 449.0 KB)
  Free Bytes        :   425388 B ( 415.4 KB)
  Allocated Bytes   :    27860 B (  27.2 KB)
  Minimum Free Bytes:   420400 B ( 410.5 KB)
  Largest Free Block:   393204 B ( 384.0 KB)
------------------------------------------
Flash Info:
------------------------------------------
  Chip Size         :  4194304 B (4 MB)
  Block Size        :    65536 B (  64.0 KB)
  Sector Size       :     4096 B (   4.0 KB)
  Page Size         :      256 B (   0.2 KB)
  Bus Speed         : 80 MHz
  Flash Frequency   : 80 MHz (source: 80 MHz, divider: 1)
  Bus Mode          : QIO
------------------------------------------
Partitions Info:
------------------------------------------
                nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
            otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
               app0 : addr: 0x00010000, size:  3072.0 KB, type:  APP, subtype: OTA_0
             spiffs : addr: 0x00310000, size:   896.0 KB, type: DATA, subtype: SPIFFS
           coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
------------------------------------------
Software Info:
------------------------------------------
  Compile Date/Time : Jan 31 2026 15:05:02
  Compile Host OS   : windows
  ESP-IDF Version   : v5.5.1-710-g8410210c9a
  Arduino Version   : 3.3.4
------------------------------------------
Board Info:
------------------------------------------
  Arduino Board     : ESP32C6_DEV
  Arduino Variant   : esp32c6
  Arduino FQBN      : esp32:esp32:esp32c6:JTAGAdapter=default,CDCOnBoot=cdc,PartitionScheme=huge_app,CPUFreq=160,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,DebugLevel=verbose,EraseFlash=none,ZigbeeMode=default
============ Before Setup End ============
[  4709][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 17 successfully set to type UART_RX (2) with bus 0x4080f814
[  4710][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RX (2) successfully set to 0x42004134
[  4711][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 16 successfully set to type UART_TX (3) with bus 0x4080f814
[  4711][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_TX (3) successfully set to 0x420040f8
[  4712][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 12 already has type USB_DM (38) with bus 0x40811824
[  4712][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 13 already has type USB_DP (39) with bus 0x40811824
[  4713][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x42000162
[  4713][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 8 successfully set to type GPIO (1) with bus 0x9
[  4714][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[  4714][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type RMT_TX (10) successfully set to 0x420017f6
[  4715][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type RMT_RX (11) successfully set to 0x420017f6
[  4715][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 8 successfully set to type INIT (0) with bus 0x0
[  4716][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 8 successfully set to type RMT_TX (10) with bus 0x4087db94
[  4717][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[  4718][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[  5718][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[  5719][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[  5719][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[  5819][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[  5820][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[  5820][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[  6820][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[  6821][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[  6821][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[  6921][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[  6922][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[  6922][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[  7922][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[  7923][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[  7923][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[  8023][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[  8024][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[  8025][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[  9024][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[  9025][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[  9025][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[  9125][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[  9126][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[  9126][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[ 10126][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[ 10127][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[ 10127][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[ 10227][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[ 10228][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[ 10229][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[ 11228][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[ 11229][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[ 11229][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[ 11329][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[ 11330][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[ 11330][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[ 12330][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[ 12331][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[ 12331][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[ 12431][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[ 12432][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[ 12432][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[ 13432][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[ 13433][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[ 13433][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[ 13533][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[ 13534][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[ 13534][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[ 14534][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[ 14535][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[ 14535][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[ 14635][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[ 14636][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[ 14636][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
[ 15636][V][esp32-hal-rmt.c:490] rmtInit(): GPIO 8 - TX MODE - MemSize[48] - Freq=10000000Hz
[ 15637][V][esp32-hal-rmt.c:307] _rmtWrite(): GPIO: 8 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[ 15637][V][esp32-hal-rmt.c:315] _rmtWrite(): GPIO: 8 - Currently in Loop Mode: [NO] | Loop Request: [NO], LoopCancel: [NO]
starting test . . .
duration (us): 100
starting sleep. micros= 15738019 
ending   sleep. micros= 15738318 

duration (us): 500
starting sleep. micros= 16737963 
ending   sleep. micros= 16738266 

duration (us): 1000
starting sleep. micros= 17737964 
ending   sleep. micros= 17738255