Timestamp after Internal WDT recoveries

RamyaR
Posts: 2
Joined: Wed Oct 29, 2025 5:10 am

Timestamp after Internal WDT recoveries

Postby RamyaR » Wed Oct 29, 2025 5:30 am

I’ve been using system time to maintain timing consistency across software resets. However, I’ve noticed that after a software reset, watchdog timeout (WDT), or system crash, the internal system time sometimes shows a large drift — up to 39 minutes in some case.
In most of the cases it is upto 3min after 6 days for 1 instance difference is about 39min - How could I reduce this error rate?

I’m using ESP-IDF v4.4, and I’d like to understand the following:

How does the ESP32 maintain system time after a software reset?

Is there a way to reduce this error or drift after a software reset with internal RTC without any external crystal oscillator?

CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y
# CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set
# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set
# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set
CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y
# CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set
# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set
# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set
CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024
CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000
CONFIG_ESP32_XTAL_FREQ_40=y
# CONFIG_ESP32_XTAL_FREQ_26 is not set
# CONFIG_ESP32_XTAL_FREQ_AUTO is not set
CONFIG_ESP32_XTAL_FREQ=40
# CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set
# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set
# CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set
CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL=5

Who is online

Users browsing this forum: Baidu [Spider], ChatGPT-User, meta-externalagent, PerplexityBot, PetalBot and 7 guests