cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure RTC to work in wakeup interrupt

SSaiy.1
Associate III

Hi, I am new to stm32 controller and trying to do RTC using baremetal. I like to wakeup my rtc in a second interval using wakeup interrupt. How can we configure the registers for the same.​

5 REPLIES 5
Aime
ST Employee

Hi @SSaiy.1​ ,

Which STM32 are you using ?

Please use STM32CubeMX to find examples on how to configure the RTC.

You can refer to the example "RTC_Alarm" or "RTC_Calendar"

Best Regards,

A.MVE

SSaiy.1
Associate III

Hi @Aime​  I use STM32L412RB controller. Do we have baremetal examples available in CubeMX​

Regards,

Suhaib Saiyde​

Hi,

Sorry we do not have this example, because it is to specific and the idea of these examples is to provide a reference for our users.

You can use the examples from CubeMX to understand which functions are needed to configure your RTC on your application.

If you have any questions, please let me know.

BR,

A/MVE

Hi @SSaiy.1​ ,

Maybe you can use the LL drivers instead of the HAL on your application, the result should be close to a bare metal implementation :) .

The Low Layer (LL) drivers are designed to offer a fast light-weight expert-oriented layer which is closer to the hardware than the HAL.

The Low Layer drivers provide hardware services based on the available features of the STM32 peripherals. These services reflect exactly the hardware capabilities and provide one-shot operations that must be called following the programming model described in the microcontroller line reference manual. As a result, the LL services do not implement any processing and do not require any additional memory resources to save their states, counter or data pointers: all the operations are performed by changing the associated peripheral registers content.

To see more about Low layer drivers on STM32L4 , refer to the User Manual UM1884:

"Description of STM32L4/L4+ HAL and low-layer drivers - User manual"

BR

A.MVE

Hi @SSaiy.1​ ,

Besides to what was already suggested by @Aime​ , I think that this article will be helpful for you: How to configure the RTC to wake up the STM32 periodically from Low Power modes.

You can opt to generate code based on LL driver from STM32CubeMX interface.

-Amel

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.