STM32U545 permanent RTC wakeup call
Hello,
I am new to this cpu and experimenting with RTC wakeup using 32kHz LSE. I am usingthis code for the wakeup:
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc)
{
SystemClock_Config();
HAL_ResumeTick();
...
}
// In while(1)
HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 0x4E30, RTC_WAKEUPCLOCK_RTCCLK_DIV16, 0);
HAL_SuspendTick();
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
...
I removed the SetWakeUpTimer() function from MX_RTC_INIT().
It was working fine. I tweaked the MCU clock and generated the code with CubeIDE. I am not sure what went wrong but now its executing the callback (instead every 10s) instantly as fast as it can. I reverted everything i know about but still the same. Hope someone can give me a hint on what configurating i need to fix to make it work again.