Showing results for 
Search instead for 
Did you mean: 

Unable to get RTC interrupt with STM32L476.

Associate II


I am trying to get interrupt on each second using STM32L476 RTC module.

I am configuring RTC module using cubeMX.

RTC module interrupt is enabled, but there aren't any interrupts from RTC?!

Would you please advice!

ST Employee

Hello @LMehm ,

I recommend you, when you configure the RTC, to follow the steps shared in this FAQ: How to configure the RTC to wake up the STM32 periodically from Low Power modes. 

In this article we will see how to configure the RTC peripheral of the STM32 to wake up the STM32 periodically from a low power mode like STOP2 mode which is one of the lowest power modes of the STM3L4.

Also, I advise you to take a look to this wiki: Getting started with RTC.

This article explains how to use the RTC. It provides code examples to use RTC Alarm with interrupt with NUCLEO-L476RG board.

When your question is answered, please close this topic by choosing "Accept as Solution". This will help other users find that answer faster.



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.

For the simplest example of a "once per second" alarm, the article presents the worst approach with an unreliable implementation - the code reconfigures the alarm every second and, if this code is interrupted for more than a second, then the alarm stops working at all.

Similarly for UART those articles doesn't show an actually real life usable reception example, because with the flawed-by-design HAL it is almost impossible.

And, of course, the all of the code examples in knowledge base articles are similarly full of bugs, issues and generally dumb code. Here is an example:

Senior II

if you just want to get interrupt every each second by RTC.
you can use Alarm mode and enable all mask in alarm setting but this function require a calendar.

but if you want it wakeup that you have to make sure it's in sleep mode.