ESP32-S3 external 32.768 KHz crystal not selected after waking up from deep sleep

sqsqsq
Posts: 7
Joined: Mon Dec 27, 2021 5:54 am

ESP32-S3 external 32.768 KHz crystal not selected after waking up from deep sleep

Postby sqsqsq » Sat Aug 16, 2025 3:50 am

Hi All,

I have a similar setup as described here viewtopic.php?p=130554#p130554 where I am selecting the external crystal as RTC slow clock source before going to deep sleep.

I confirm through

Code: Select all

rtc_clk_32k_enabled()
and

Code: Select all

rtc_clk_slow_freq_get
that the crystal is running before going to deep sleep. But when I wake up from deep sleep and print the slow clock source, it says it is using the Internal 150KHZ.

Is this expected behavior? Or was my RTC clock source never switched to the external crystal in the first place? It seems odd to default back to 150KHZ every time after waking from deep sleep.

Thank you and appreciate any guidance here :)

lbernstone
Posts: 1132
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32-S3 external 32.768 KHz crystal not selected after waking up from deep sleep

Postby lbernstone » Sat Aug 16, 2025 8:46 am

I didn't dig through the bootloader code, but I'm going to guess that the CONFIG_ESP32S3_RTC_CLK_SRC_INT_RC in sdkconfig means that it gets set on every "boot", including wakeup from sleep. I think you would need to compile the sdk with CONFIG_ESP32S3_RTC_CLK_SRC_EXT_CRYS set for this to work. You can do this with lib-builder or compiling ESP-IDF with arduino as a component.

sqsqsq
Posts: 7
Joined: Mon Dec 27, 2021 5:54 am

Re: ESP32-S3 external 32.768 KHz crystal not selected after waking up from deep sleep

Postby sqsqsq » Sun Aug 17, 2025 10:44 pm

Thank you @lbernstone !! After setting the config, it now stays on the external 32khz crystal after deep sleep :D

Who is online

Users browsing this forum: Google [Bot], Qwantbot and 2 guests