Skip to main content
Visitor II
September 20, 2025
Question

RTC date is reset after power off in STM32F103C8T6

  • September 20, 2025
  • 2 replies
  • 454 views

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

    Super User
    September 20, 2025

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

    ST Employee
    September 23, 2025

    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