RTC Time increases after esp_restart()

atouron
Posts: 6
Joined: Mon Sep 05, 2022 4:50 am

RTC Time increases after esp_restart()

Postby atouron » Tue Sep 06, 2022 12:55 am

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.

cruvus
Posts: 59
Joined: Fri Jul 08, 2022 5:08 pm
Location: Planet Earth

Re: RTC Time increases after esp_restart()

Postby cruvus » Tue Sep 06, 2022 7:18 am

ESP32 / ESP-IDF 5.1.4

atouron
Posts: 6
Joined: Mon Sep 05, 2022 4:50 am

Re: RTC Time increases after esp_restart()

Postby atouron » Thu Sep 08, 2022 2:16 am

Updated to V4.4.2 has fixed my issue.

Thank you.

Who is online

Users browsing this forum: No registered users and 97 guests