Skip to main content
Visitor II
May 11, 2025
Solved

STM32 F446RE Looses RTC Registers' Data When Power is Off

  • May 11, 2025
  • 3 replies
  • 412 views

Hi all,

I'm building a discharger using my STM F446RE, such that it's RTC registers are used to store data that'll be loaded to set parameters in my code every time the discharger is plugged into the power. Just to clarify - I'm NOT using the RTC as a clock, I just use it's registers to store data.

For a reason I don't understand, the RTC's registers get cleared (i.e. all data is set to 0) every time the discharger is unplugged from the power. I saw that plugging a battery to the Vbat pin helps keep the RTC consistent, but my superior claims that it's actually not needed in this case, because I'm only using the RTC's registers and not the clock itself (so the data should be saved regardless of power connection).

Is my superior correct, and there's a way to solve this without plugging a battery to the Vbat pin, or is he wrong and the Vbat pin must be fed a battery for the RTC to save it's register's data?

Thanks in advance for any help on the subject!

    This topic has been closed for replies.
    Best answer by Peter BENSCH

    Correction: His statement is not completely wrong, because data can also be written to flash, where it is retained without a power supply. This is particularly easy with the family with EEPROM, but with other families the special features of flash must be taken into account.

    However, if you want to use the RAM of the backup domain, a voltage at VBAT is absolutely necessary as soon as VCC fails.

    3 replies

    Technical Moderator
    May 11, 2025

    Welcome @nivg, to the community!

    short answer: he is wrong.

    The backup domain (see reference manual) requires an external battery connected to VBAT.

    Regards
    /Peter

    Technical Moderator
    May 11, 2025

    Correction: His statement is not completely wrong, because data can also be written to flash, where it is retained without a power supply. This is particularly easy with the family with EEPROM, but with other families the special features of flash must be taken into account.

    However, if you want to use the RAM of the backup domain, a voltage at VBAT is absolutely necessary as soon as VCC fails.

    nivgAuthor
    Visitor II
    May 12, 2025

    Thanks Peter! Both for the quick and direct answer and for the kindness