cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 F446RE Looses RTC Registers' Data When Power is Off

nivg
Associate

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

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.

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.

View solution in original post

3 REPLIES 3
Peter BENSCH
ST Employee

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

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.
Peter BENSCH
ST Employee

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.

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

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