Page 1 of 1

RTC Time increases after esp_restart()

Posted: Tue Sep 06, 2022 12:55 am
by atouron
Hi.

I'm having an issue when reading back the RTC time (gettimeofday()) after an esp_restart() or WDT reset. The issue is that every time after an esp_restart() or WDT reset, the RTC time read back has increased incorrectly. The amount it increases depends on how long the micro was running before the reset.

For Example 1:
Micro starts and time is 9:00am. If the micro runs for 5 mins then I esp_restart() (or WDT reset), the micro will startup and continue the time @ 9:10am (but should of continued from 9:05am after reset).

For Example 2:
Micro starts and time is 9:00am. If the micro runs for 2 hrs then I esp_restart() (or WDT reset), the micro will startup and continue the time @ 1:00pm (but should of continued from 11:00am after reset).

If anyone can help with this i would greatly appreciate it. I got the example from https://docs.espressif.com/projects/esp ... _time.html

Currently using ESP32-C3-MINI, using ESP-IDF-V4.3

Thanks.

Re: RTC Time increases after esp_restart()

Posted: Tue Sep 06, 2022 7:18 am
by cruvus

Re: RTC Time increases after esp_restart()

Posted: Thu Sep 08, 2022 2:16 am
by atouron
Updated to V4.4.2 has fixed my issue.

Thank you.