Skip to main content
David Lichterov
Associate II
Dec 10, 2017 3:56 PM UTC
Solved

STM32F446RE - RTC time drift under ''heavy'' load of wake up's and standby mode

Posted on December 10, 2017 at 16:56

Hey,

I am trying to test my MCU with the sequence bellow in order to check if i get time drift on the RTC clock.

loop on :

1. print RTC time + date

2.  enter stand by mode

I tested the wake up from stand by mode with :

1. ALARM every 5 seconds

2. rising edge on the WKUP pin

This sequence make's the RTC clock drift almost immediately and the drift is getting larger and larger as the time passes ( I print the RTC clock and compare it to a stop watch).

Am i doing some thing wrong that causes this issue ? I would be happy to supply any parts of the code if needed.

Thanks !

#stm32-f4 #stm32f4-rtc #rtc
This topic has been closed for replies.
john doe
john doeBest answer
Senior III
Dec 10, 2017 4:42 PM UTC
Posted on December 10, 2017 at 17:42

try RTC->CR->BYPSHAD = 1 and read the registers again because the shadow registers are not updated during stop or standby. otherwise, wait for RTC->ISR->RSF to set.

Checking out the F446 errata RTC section might help too:

0690X00000609AAQAY.png

3 replies

john doe
john doeBest answer
Senior III
Dec 10, 2017 4:42 PM UTC
Posted on December 10, 2017 at 17:42

try RTC->CR->BYPSHAD = 1 and read the registers again because the shadow registers are not updated during stop or standby. otherwise, wait for RTC->ISR->RSF to set.

Checking out the F446 errata RTC section might help too:

0690X00000609AAQAY.png
Zt Liu
Senior III
Dec 11, 2017 3:54 AM UTC
Posted on December 11, 2017 at 04:54

You may also check that you don't call something like HAL_RTC_Init() every time you wake up.

Also make sure that your LSE XTAL is loaded with proper capacitors to get the nominated 32.768kHz.

David Lichterov
Associate II
Dec 11, 2017 2:15 PM UTC
Posted on December 11, 2017 at 15:15

Thank you both, your answers really helped . I got it working now.