Skip to main content
Sabino Colonna
Visitor II
November 1, 2019
Question

STM32L486: setting RTC alarm in stop mode 2

  • November 1, 2019
  • 0 replies
  • 453 views

Hi all,

I'm using STM32L486 and my application needs to enter STOP MODE 2 in certain conditions. Every time it will enter STOP MODE 2, I'd like to set an RTC alarm to awake the MCU in e.g. 24 hours or 60 mins (it's just a configurable time known a priori). So definitely it is not a fix time of the day, just a wakeup time since the MCU enters stop mode.

I have configured the RTC alarm in CubeMX, enabled alarm NVIC and implemented my AlarmACallback, but I can't understand which HAL instructions are strictly needed to setup the alarm and make it work (i.e. before calling HAL_RTC_SetAlarm_IT) and, in particular, how to set the alarm structure's fields (e.g. alarm mask and time).

Please, could any of you give me an hint about how to achieve my use case above?

Thanks in advance,

Sabino

This topic has been closed for replies.