I'm trying to setup the RTC to use the external XTAL while in deep-sleep. I create an RTC and set its source to XTAL_32KHZ right before entreing the deep-sleep mode. Everything seems to work fine, but accuracy is still a mess (2 seconds diff over a 10-min sleep time), exactly the same as when using the internal RC oscillator.
It looks like the ESP32 is still using the internal clock, because if I remove the crystal, it does the same.
My test code:import machine import time rtc = machine.RTC() rtc.init(source=rtc.XTAL_32KHZ) time.sleep_ms(1) machine.deepsleep(60000)
Any thoughts on this? What am I missing?