Skip to main content
SM.15
Visitor II
October 2, 2021
Question

How to retain RTC internal time on power reset(STM32f103c8t6)

  • October 2, 2021
  • 1 reply
  • 1091 views

working on STM32f103 want to hold time on power reset, not able to do it so,

used backup register to write the data,

HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR1);

HAL_RTCEx_BKUPWrite(&hrtc, RTC_BKP_DR1,0x32F2);

any suggestion would be great....

This topic has been closed for replies.

1 reply

Peter BENSCH
Technical Moderator
November 4, 2021

Welcome, @SM.15​, to the community!

Are you sure the STM32F103C8T6 is a genuine device?

Are you sure VBAT is connected to a power source (battery, capacitor)?

Did you follow the recommendations of e.g. the project RTC_Calendar, which can be found in the local or online repository (Projects/STM3210E_EVAL/Examples/RTC)?

E.g. did you enable write access using HAL_PWR_EnableBkUpAccess()?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.