cancel
Showing results for 
Search instead for 
Did you mean: 

Old date and time on STM32H753 RTC after some days

STeba.1
Associate II

I'm using STM32H753 on my board and the RTC to get date and time. I'm using the HAL library generated with STMCube. I have set the date and time and the RTC works fine keeping the date and time up to date. The problem is that after more or less 8 days that the board has been turned off, the RTC no longer updates the date and time and when I turn on the board, from the RTC I read an old date. On power up the INITS and RSF bits are set to 1 so the RTC indicates it is initialized and ready, but in this case shouldn't it indicate it has lost the date ? Shouldn't it have the default date and time (1/1/2000) ?

Is this the correct behaviour or there is something that I missed in the RTC configuration or in the check at power on before using RTC ?

Thank you

9 REPLIES 9

Sounds much like failing backup battery. What's its voltage?

JW

STeba.1
Associate II

I have to check the exact value of the voltage, but yes, the voltage probably dropped below the working value of the RTC. I wonder what should happen to the RTC in this case and how the fw can figure out what happened. Shouldn't the RTC indicate that it is no longer initialized and shouldn't it have an invalid date ?

STeba.1
Associate II

When it happens the voltage is below 1.2 V, but not below 0.7 V.

Is RTC clocked from external oscillator? Is 0.7V enough for it?

> Shouldn't the RTC indicate that it is no longer initialized and shouldn't it have an invalid date ?

LSE typically stops working at higher voltage than is the backup-domain reset level. None of this is characterized by ST particularly well (there's even a related erratum which may or may not pertain to your particular STM32).

JW

STeba.1
Associate II

LSE is used for RTC

Yes this is exactly what we suspect. Need to find the min. battery voltage needed for normal LSE operation.

How to detect whether the LSE failed or died after the MCU wakes up ... this is a different question.

And is possible to know if LSE failed when the device is powered on again to know that RTC has not updated the calendar ?

Bit LSECSSD of the register RCC_BDCR can help ?

Or enable RTC tamper (tamper 3 ?) to reset RTC backup register when LSE fails ?

Thank you

There's probably no mechanism to do that during powerdown, but maybe you can measure voltage on VBAT when VDD is restored (unless you charge what's there - presumably supercap - through a diode).

In many cases it's just so easier to use a primary Li cell such as a 2032, although they are not perfect either and you still have to monitor their health.

JW