How I can read directly RTC register in ESP32-S3
Posted: Mon May 11, 2026 10:06 am
Hello,
Greetings for all ppl here. This is my first post and thread.
I don't know what I'm doing wrong bcos I can't properly read RTC LO/HI registers. Also here exists unresolvet this thread:
viewtopic.php?t=18013
example of my code:
Output console show, how the high RTC register is allways 0:
If anyone know how to read low level RTS registers in ESP32-S3 pleasse let me know here.
Thank you in advance.
Greetings for all ppl here. This is my first post and thread.
I don't know what I'm doing wrong bcos I can't properly read RTC LO/HI registers. Also here exists unresolvet this thread:
viewtopic.php?t=18013
example of my code:
Code: Select all
#include "soc/rtc_cntl_reg.h"
//---
SET_PERI_REG_MASK(RTC_CNTL_TIME_UPDATE_REG, RTC_CNTL_TIME_UPDATE);
uint32_t rtc_timestamp_low = READ_PERI_REG(RTC_CNTL_TIME0_REG);
uint32_t rtc_timestamp_high = READ_PERI_REG(RTC_CNTL_TIME1_REG);
time_t rtc_epoch;
time(&rtc_epoch);
Serial.printf("\n\n==========================================================\n");
Serial.printf("rtc_timestamp_low = %d\n", rtc_timestamp_low);
Serial.printf("rtc_timestamp_high = %d\n", rtc_timestamp_high);
Serial.printf("RTC value of time_t rtc_epoch = %d\n", rtc_epoch);
Serial.printf("==========================================================\n\n");
//---I wonder what is wrong bcos the system time() and any RTC functions working flawlesly and they must reading of RTC registers.==========================================================
rtc_timestamp_low = 38456010
rtc_timestamp_high = 0
RTC value of time_t rtc_epoch = 1021110895
==========================================================
If anyone know how to read low level RTS registers in ESP32-S3 pleasse let me know here.
Thank you in advance.