DeepSleep RTC Reset ESP32-S3

Hello everyone,

I'm using an ESP32-S3 with a dual power supply (main and coin cell via TPS2115APWR) to keep the RTC running during power loss. When the main power is disconnected, the ESP32 detects the switch to the coin cell and immediately enters deep sleep.

The problem is that the RTC resets upon waking from deep sleep.

Question: Is there a way to accurately determine how long the ESP32-S3 was in deep sleep so I can correct the Clock on wake-up?

Any suggestions on tracking deep sleep duration or alternative methods for a persistent RTC during power interruptions and deep sleep would be very helpful. Thanks!

I have not studied that RTC, but in all other cases, I am aware that the job of the RTC is to keep the time while the main board is powered off. It sounds like your RTC is missing its backup battery power, or something else is messing with it.

Use an external RTC and battery ?

Or leave the ESP32 powered during deep sleep ?

Esp32-S3 is getting sufficient power before deep sleep, during deep sleep and waking up from deep sleep. The problem is, I don't know how to use RTC Timer during deep sleep, and how to keep it running after waking up.

I want to implement Deep-Sleep Mode (RTC timer + RTC memory - 10uA)

I have attached the switching circuit, using State pin i can put Esp32 to deep sleep and wakeup.

My Esp32-S3 is power during deep sleep. I want to implement a clock inside an esp, that runs before, during and after deep sleep with keeping time.

This is the alternative method that I'm using. ESP32 does preserve the time during deep sleep although its time runs a bit faster during sleeping. So I synchronize the time with the NTP server immediately after waking up. This corrects the internal ESP32's clock.

Why it's doing that in the first place? How are you waking it up?

I am waking up from external source which is an RTC pin.

Some time ago there was a bug that caused reset on wake up at least on Esp32-C3.
If you aren't using latest core, an update might fix the issue.
Also, try to find out the RTC reset reason.

1 Like

After using the code, I am getting this reason. Also the timer before reset and after reset. I am saving the rtc timer in rtc memory before going to sleep.

I don't see any RTC reset here. There's 4s difference on time before/after.

No, If I put esp32 on sleep after one hour wakeup, then you will see one hour difference. But the time after wakeup will still be something 10833...

I don't know what time counting you do.
But your topic was about RTC resetting, If you have doubts, try the boot counter example here, it's saving the count in RTC memory.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.