cancel
Showing results for 
Search instead for 
Did you mean: 

Can backup registers persist when VBAT drops enough to stop RTC?

JohnFrancis
Associate II

I'm working with the STM32G4 series and using the backup registers to store time data that persists across power cycles. I have a question about VBAT brownout behavior that I cannot find explicitly documented in RM0440 or the datasheet.

Background:

Both RTC and backup registers are in the VBAT power domain
I'm using a signature in backup registers to detect VBAT loss
The signature check works fine for complete power loss
My Question:

Is it possible for VBAT voltage to drop to a level where:

The RTC stops functioning
BUT the backup registers still retain their contents?
In this scenario, my signature check would pass (registers retained), but the time would be invalid (RTC stopped counting).

Do the RTC and backup registers have the same minimum VBAT voltage threshold, or can backup registers survive at a lower voltage than the RTC requires?

If VBAT brownout can cause RTC failure while backup registers persist, does STM32G4 have any hardware mechanism that automatically clears backup registers when RTC stops?

 

3 REPLIES 3
Gyessine
ST Employee

Hello @JohnFrancis 
Based on the STM32G4 reference manual and datasheet, VBAT operates in the range from 1.55 V to 3.6 V. However, the lowest brownout reset (BOR) level is 1.71 V.

Gyessine_1-1777452661949.png

So, as long as the voltage remains above the BOR0 threshold, which is 1.71 V, the (RTC) and backup registers continue to function correctly.
BR
Gyessine

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.

Thank you for reply 

Is it possible for the VBAT voltage to drop to a level where the RTC stops running, but the backup registers still retain their contents?

If this scenario is possible, I need a reliable way to detect that the RTC has stopped while the backup registers remain intact, so that the firmware can erase the backup registers and re‑initialise the system state.

The STM32G4 documentation mentions five internal tamper events. Does the STM32G4 provide any built‑in mechanism to detect a condition where the RTC has stopped but the backup registers are still preserved, and automatically clear the backup registers in that case?

waclawek.jan
Super User

> Is it possible for the VBAT voltage to drop to a level where the RTC stops running, but the backup registers still retain their contents?

Yes.

The datasheet values tell you a VBAT voltage value, above which *both* will function. There's no *guarantee* what happens *below* that value; but in CMOS, typically, memory content is retained to lower voltages than the voltages needed to flip the flops (and/or run an oscillator).

> I need a reliable way to detect that the RTC has stopped while the backup registers remain intact.

You won't have any, built-in into STM32's Backup Domain. Mind, anything precise requires power. (Also, note the "backup domain brownout" erratum.).

You have to design your system so, that it maintains enough power at VBAT for whatever time you require.

Alternatives to this may be schemes not utilizing the backup domain, but using some of the lower power modes, monitoring any battery/backup power utilized using e.g. PVD and waking up briefly to destroy backup registers/reset RTC. This will be at a cost of higher power consumption, though.

Another alternative may be to run from VBAT but wake up for destroy through alarm after the maximum RTC retention design time was reached.

If you plan running VBAT from supercap or similar, charged through a switch (e.g. using the built-in charging mechanism), you can try to measure its voltage after wakeup and decide whether that was sufficient for the previous RTC run.

JW