Skip to main content
GFont.1
Associate III
December 22, 2020
Question

RTC shifting in stm32L431

  • December 22, 2020
  • 3 replies
  • 1043 views

Hi,

I am using stm32L431 and (32.768KHz ±20ppm 12.5pF 70kΩ) as LSE.

Every day the time is update by internet, but in some cases, the clock shifting about 5 minutes.

It occur aroung 2 times to week.

what is probably happening?

Binary data format and Alarm A is used.

Any help I would appreciate.

This topic has been closed for replies.

3 replies

waclawek.jan
Super User
December 22, 2020

Isn't this still the infamous Cube RTC "initialization" which causes loss of subseconds?

https://community.st.com/s/question/0D50X00009XkgBWSAZ/stm32-rtc-loses-one-second-after-each-reset

https://github.com/STMicroelectronics/STM32CubeH7/issues/24

and many other places.

JW

GFont.1
GFont.1Author
Associate III
December 22, 2020

Thank for you answer.

But my board sleep and wake up only once a day, after wake up by Alarm it update the time.

But it is wake up about 5 minutes later in some cases, in other cases is working fine.

waclawek.jan
Super User
December 22, 2020

OK, then I don't have an instant answer, just some random remarks:

> But it is wake up about 5 minutes later

How do you know?

Can you check, if the time is correct, just before going to sleep, e.g. outputting it to UART->PC or some other suitable way?

If the device does not go to sleep, is there any time shift?

Is there any power outage during sleep? Is there a battery on VBAT?

Can you try the code - or main parts of it - on a "known good" board such as Disco or Nucleo?

JW