Question
RTC wake up timer is not waking up MCU from the STOP mode
I am using STM32F091RCTx microcontroller and have configured RTC internal periodic wake up timer in interrupt mode. On timeout the respective isr routine is getting called but it is not waking up the MCU. i am not using SLEEP_ON_EXIT.
Can anyone help me knowing why it's happening ?
Thanks in advance
Tanuj
/* Application Code */
DEBUG_PRINT("<< Device Entering To Sleep >>\n");
configureUnusedPeripheralsForSleep();
/** Enable the WakeUp
*/
if (HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 20, RTC_WAKEUPCLOCK_CK_SPRE_16BITS) != HAL_OK)
{
Error_Handler();
}
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI); // Going to sleep
configureAllPeripheralsAfterWakeup();
DEBUG_PRINT("<< Device Exiting From Sleep >>\n");
/* RTC Wake Up Timer Callback */
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(hrtc);
/* NOTE : This function should not be modified, when the callback is needed,
the HAL_RTCEx_WakeUpTimerEventCallback could be implemented in the user file
*/
if (FALSE == wdg_checkForReset())
{
IWDG_ReloadCounter();
}
else
{
while(1);
}
}