Skip to main content
ST Migration account
ST Community Manager
August 22, 2026
Solved

STM32WB55 - Use LSI2 as a RTC clock source for waking up from STOP2 mode

  • August 22, 2026
  • 2 replies
  • 39 views

This account only shares restored community content posted by members between May 22 and June 9, 2026, who did not register for the new community.


Hi everybody,

I have an application, where my device should go every record_interval into the stop2 mode. Then Wakes up then measure some sensor values, then goes into the sleep. Same goes over and over.

The issue is, I am using the LSI2 as a clock source for my RTC. I am then using that RTC clock to wake my MCU up from the STOP2 mode. But the issue is: that RTC time (based on the LSI2) is drifting (roughly 10s less than the real time). I am then using the real sleep time to advance the ticks of my freeRTOS, because the ticks are being paused during the STOP2 mode.
Advancing the ticks manually then causes my freeRTOS task to run with some delays.

Now my questions are:

- Is there any way on my PCB, ith the STM32WB55RG on it to make the LSI2 or even the LSI1 more precise? PS: I am planning to buy an LSE oscillator. In the mean time, I try to compensate my application while using the LSI2

- Are there any other timers, options (apart from the LSE) to have a reliable time source for my RTC timer? Or maybe use other timers during the STOP2 mode?

 

I would be very happy to have any kind of help regarding this. Thank you very much.

 

Best regards

 

Gatan

Best answer by Gyessine

Hello  

You can tweak the asynchronous and synchronous prescaler dividers. They are set to 127 and 255 by default in STM32CubeMX. These values are suitable for LSE (32 768 Hz), but not for LSI (32 kHz).

You can try 127 for the asynchronous prescaler and 249 for the synchronous prescaler.
based on the Reference manual, The RTC can use LSI, LSE, or HSE/32 as the clock source. If you do not want to use LSE, HSE/32 is the remaining option. However, I recommend that you implement LSE because it is easy to use, reliable, and keeps the system simple.
BR
Gyessine

2 replies

ST Migration account
ST Community Manager
August 22, 2026

Thank you very much. Those changes of the prescaler values helped a lot.

This account only shares restored community content posted by members between May 22 and June 9, 2026, who did not register for the new community.
GyessineBest answer
ST Technical Moderator
August 22, 2026

Hello  

You can tweak the asynchronous and synchronous prescaler dividers. They are set to 127 and 255 by default in STM32CubeMX. These values are suitable for LSE (32 768 Hz), but not for LSI (32 kHz).

You can try 127 for the asynchronous prescaler and 249 for the synchronous prescaler.
based on the Reference manual, The RTC can use LSI, LSE, or HSE/32 as the clock source. If you do not want to use LSE, HSE/32 is the remaining option. However, I recommend that you implement LSE because it is easy to use, reliable, and keeps the system simple.
BR
Gyessine

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.