Skip to main content
meghasb
Associate III
June 19, 2023
Question

How to re-fetch the RTC value after power restored

  • June 19, 2023
  • 1 reply
  • 711 views

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 topic has been closed for replies.

1 reply

waclawek.jan
Super User
June 19, 2023

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