cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable RTC interrupt with HAL Library?

ReV Hulk
Associate
Posted on April 21, 2017 at 16:05

Hi everyone,

I'm using STM32F103 with CubeMX.

I enabled the RTC Global Interrupt but I don't know how to configure it to generate a 1/4 second interrupt?

Because the Reference Manual says:

Three dedicated maskable interrupt lines:

– Alarm interrupt, for generating a software programmable alarm interrupt.

–

Seconds interrupt, for generating a periodic interrupt signal with a programmable

period length (up to 1 second).

– Overflow interrupt, to detect when the internal programmable counter rolls over to

zero.

Could anybody show me how to configure this with HAL Library?

Best regards,

ReV.

1 REPLY 1
Imen.D
ST Employee
Posted on April 21, 2017 at 17:55

Hi,

Enable the RTC Alarm interrupt using HAL_RTC_ALARM_ENABLE_IT (hrtc,RTC_IT_ALRA)

You can refer to ready RTC example

inside the STM32CubeF1 at this path, it may help you on how implementation is done:

STM32Cube_FW_F1_V1.4.0\Projects\STM32F103RB-Nucleo\Examples\RTC\RTC_Alarm

The

 

http://www.st.com/content/ccc/resource/technical/document/user_manual/72/52/cc/53/05/e3/4c/98/DM00154093.pdf/files/DM00154093.pdf/jcr:content/translations/en.DM00154093.pdf

 

Description of STM32F1xx HAL drivers, may help you to have more idea about the use of HAL functions.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen