cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L476RG: RTC shows delay in time

Devika Raju
Associate II

Hi all,

I am working with FreeRTOS on STM32L476RG and I'm new to this. I am using stm32cubeIDE for project development. I am printing the date and time in the putty and the time format is hours: minutes: seconds: subseconds.

When I start running the program the time is correct as with current time. But after some hours it is showing more than 10 minutes delay.

I am setting RTC time in binary format and using LSI as clock source.

can anyone help me?

2 REPLIES 2
Devika Raju
Associate II

I am sharing RTC init function with you.

Jack Peacock_2
Senior III

The LSI oscillator source has a 5% tolerance. That means you can lose 3 minutes per hour. The LSI can be calibrated but you will need a low drift source such as a crystal controlled HSE to determine LSI calibration factor. ST has an app note on how to use a timer to measure actual LSI frequency and calculate the calibration offset.

LSI has poor RTC accuracy. Depending on temperature and humidity you may have to run the calibration routine several times per day.

Jack Peacock