cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L452 wakeup interrupt not firing after programming the MCU and system reset

Kraal
Senior III
Posted on March 16, 2018 at 14:12

Hi !

I have an application with the wakeup interrupt firing every x seconds. If the reset source is a power on reset, everything works as expected. However, when I upload a new code into the chip (so the MCU is reset by the ST-Link), the wakeup interrupt does not fire anymore, until I turn ON and OFF the power again.

Does anybody know why this is happening ? Is there a special handling that needs to be taken care of regarding the RTC ?

#rtc-wakeup-event #stm32-l4
2 REPLIES 2
Kraal
Senior III
Posted on March 16, 2018 at 14:42

My bad, I check the INITS flag at startup and skip RTC init function if already configured, which is the case after a system reset by the ST-Link. But I forgot that the NVIC and EXTI config is also done in the same function, which is why the interrupt was not firing...

Kraal
Senior III
Posted on March 16, 2018 at 15:23

Nope, that was not the solution.

The problem is different: when I upload the code, the RTC keeps running (as it is supposed to). But if the counter goes beyond the wakeup timer register period during the upload, then the interrupt will fire (2^16 - 2) seconds after (if my wakeup period is 1s). So is there a way to reset the wakeup counter when I change its period ?