2018-03-16 06:12 AM
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-l42018-03-16 06:42 AM
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...
2018-03-16 07:23 AM
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 ?