2018-11-06 12:23 AM
The RTC wakeup interrupt uses EXTI-20. Unfortunately the HAL drivers do not properly enable the interrupt. Adding
EXTI->IMR1|=(1<<20);
after HAL_RTCEx_SetWakeUpTimer_IT fixes the issue
2018-11-06 02:32 AM
If you are using STM32CubeMX you should enable it there before generating the code - enable the RTC Clock Source, RTC Calendar, RTC Internal WakeUp, then go to the Confguration tab, and enable the RTC wakeup interrupt in the RTC's NVIC Settings tab.
2018-11-06 03:10 AM
I did and it doesn't - that is the problem
2019-03-17 09:53 PM
Hi, for STM32Cube_FW_L0_V1.11.2 in stm32l4xx_hal_rtc_ex.c
must fixes
HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock)
...
#if defined(STM32L412xx) || defined(STM32L422xx)
/* In case of WUT autoclr, the IRQ handler should not be called */
if (WakeUpAutoClr != 0u)
{
/* RTC WakeUpTimer EXTI Configuration: Event configuration */
__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT();
}
else
{
/* RTC WakeUpTimer EXTI Configuration: Interrupt configuration */
__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT();
}
#else /* defined(STM32L412xx) || defined(STM32L422xx) */
__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT(); /* this bug*/
__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT();
#endif /* defined(STM32L412xx) || defined(STM32L422xx) */
2019-03-17 10:10 PM
Excuse me, in previos post must be
STM32Cube_FW_L4_V1.13.0