cancel
Showing results for 
Search instead for 
Did you mean: 

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

SM.15
Associate

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....

1 REPLY 1
Peter BENSCH
ST Employee

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.