Skip to main content
Associate II
Sep 20, 2025 11:20 AM UTC
Question

RTC date is reset after power off in STM32F103C8T6

HELLO ,In STM32F103C8T6, the RTC time is preserved after power off, but the date always resets to 01/01/2000 even if I set the current date and time.

This topic has been closed for replies.

2 replies

TDK
Sep 20, 2025 2:00 PM UTC

What hardware is this? Is VBAT remain connected? When you debug, does the magic value prevent the RTC from being re-initialized?

"If you feel a post has answered your question, please click ""Accept as Solution""."
Shirley.Ye
ST Employee
Sep 23, 2025 9:53 AM UTC

In the STM32F103C8T6 RTC only has a 32-bit counter (the "RTC counter"), which counts seconds. The date is calculated in software based on the counter value.

The date (year, month, day) is calculated by your code (or the HAL/StdPeriph library) from the RTC counter. Any software variables or RAM values are lost when power off unless you store them in the RTC backup registers