Skip to main content
Visitor
June 29, 2026
Question

STM32WL55JC1 RTC Alarm at calendar date and time

  • June 29, 2026
  • 1 reply
  • 18 views

Hi, 
I’m looking into the WL55JC1 for a project which would require the system to remain dormant (ideally standby) for weeks, maybe months and then resume operation on a set date at a set time. I would like to use LSI as power and space will be very limited.

So far I’ve discovered, that of course there is an RTC and it has alarms that can be used to wake from standby mode. However all examples and documentation I can find only ever use times or maybe day-of-week or day-of-month as the set wake up time. Never a full date and time. Looking at the code, stm32wlxx_hal_rtc.h defines a struct RTC_AlarmTypeDef with fields for seconds, minutes, hours and either a day-of-month, or day-of-week.
Is it really not possible to give the system a full a date and time yyyy-mm-dd and hh-mm to wake up at? Will I need to build workaround waking up at least once a month to recalculate the next wake-up until the actual target time is within the same calendar month?
Or am I overlooking something?

I’d appreciate any help I can get, thank you!
 

1 reply

Peter BENSCH
ST Technical Moderator
June 29, 2026

Welcome ​@plecso, to the community!

Even though space is limited - if your system is supposed to wake up after months on a specific date, LSI is very poorly suited as a clock source for the RTC. Why? In the datasheet, for fLSI and the full temperature range, you will find a frequency variation of 29.5...34kHz. If you start from the arithmetic mean value (31.75 kHz), a simple calculation gives a daily inaccuracy of 29.5/31.75-1 = -70866 ppm (the same absolute value in the positive direction), which corresponds to a possible daily deviation of up to 6922.8 seconds. Assuming 30.25 days per month and a total of e.g. 6 months, this can add up to more than 1 million seconds = 12.8 days. In such a case, you cannot even be sure of hitting the correct week.

Even if the RTC is operated with LSE, careful design is extremely important in order not to accumulate too much drift over such periods, since the crystal’s temperature profile, load capacitor parameters, and even the layout all have a non-negligible effect. I strongly recommend carrying out a worst-case analysis for such accuracy requirements, taking all relevant parameters into account.

Coming back to your question about the date: the RTC has at least one small limitation - the year can only be evaluated using the last two digits, because the millennium and century are not managed in the RTC hardware. So if you want to be woken at a specific time on a specific date, you can certainly do that; however, for the reasons of accuracy mentioned above, this is relatively rare and would need to be implemented, for example, with a custom typedef or something similar.

Hope that helps?

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.