ESP32 Deep Sleep Frozen When External 32kHz Crystal Fails - EXT0 GPIO Wakeup Doesn't Complete Boot

eccessivo
Posts: 20
Joined: Tue Apr 14, 2020 4:38 pm

ESP32 Deep Sleep Frozen When External 32kHz Crystal Fails - EXT0 GPIO Wakeup Doesn't Complete Boot

Postby eccessivo » Sun Feb 08, 2026 11:53 pm

Problem
ESP32 becomes completely frozen and unresponsive when the external 32kHz crystal stops oscillating, even with GPIO EXT0 interrupt configured as alternate wakeup. The device cannot complete boot until the crystal resumes functioning.

Hardware Setup
MCU: ESP32 WROOM-32 (16MB flash)
RTC Clock: External 32.768kHz crystal
Wakeup Mechanisms:
RTC timer (primary, ~30 min intervals)
GPIO_NUM_12 EXT0 interrupt (secondary wakeup)
Observed Behavior
Normal operation (8.5 hours): Device logs every minute, reads I2C sensor, saves to CSV, enters deep sleep
After 13.5 hours: Device completely silent - no serial output, no logging, completely frozen
Crystal restart: Device immediately reboots and resumes normal operation
Critical Test_
When I physically blocked the 32kHz crystal:
- Device froze immediately (as expected for RTC timer)
- BUT: GPIO_NUM_12 EXT0 interrupt also failed to wake it
- Pulling GPIO_NUM_12 to ground had NO effect
- As soon as crystal resumed: device woke via deep sleep, even though GPIO is high

Conclusion: GPIO EXT0 event is hardware-registered but bootloader cannot complete initialization without RTC clock - creating a deadlock where the wakeup event is captured but boot cannot proceed.

Root Cause
Bootloader depends on RTC clock during boot initialization. When external 32kHz crystal fails:

EXT0 event is captured by RTC hardware
Bootloader tries to initialize RTC clock
Bootloader hangs waiting for external oscillator
No automatic fallback to internal 150kHz oscillator during boot
Device stuck in zombie state - wakeup event memorized but unprocessable
Questions
Is this a known ESP32 bootloader limitation?
Can automatic hardware fallback to internal oscillator be enabled?
Are there known 32kHz crystal degradation issues after prolonged deep sleep cycling?

Who is online

Users browsing this forum: ChatGPT-User and 1 guest