cancel
Showing results for 
Search instead for 
Did you mean: 

How to re-fetch the RTC value after power restored

meghasb
Senior

Hi all

I working on the RTC on the STM32U585 with battery backup, after the date/time been set and running i want to re-fetch these values once the device restores the main power or happens even after reset (with main power), As i have a batterybackup, i no need to set the date and time again after reset of the controller but it keeps the same date and time(which is running on RTC). how is this done?

This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
waclawek.jan
Super User

Set RCC_APB3ENR.RTCAPBEN, and after that, you can read out RTC_TR and RTC_DR (in that order).

Read Reading the calendar subchapter of RTC chapter in RM.

JW