2025-09-20 4:20 AM - last edited on 2025-09-20 7:00 AM by TDK
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.
2025-09-20 7:00 AM
What hardware is this? Is VBAT remain connected? When you debug, does the magic value prevent the RTC from being re-initialized?
2025-09-23 2:53 AM
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