STM32CubeMX L4 HAL Bug Report
STM32CubeMX 4.27.0
L4 HAL 1.10.0 / 1.13.0
STM32L431RB
We use STM32CubeMX to generate the basic code.
We use the RTC Wakeup to generate a cyclic Interrupt. With the L4 HAL (1.10.0) the function was correct.
When we migrated the project to L4 HAL (1.13.0) the IRQ handler did not get activated anymore.
We traced this to a bug in the file "stm32l4xx_hal_rtc_ex.c".
In the function "HAL_RTCEx_SetWakeUpTimer_IT" the interrupts are activated with the following code:
#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();
#endif /* defined(STM32L412xx) || defined(STM32L422xx) */
For the L431 controller the last #else is used. In version 1.10.0 there was a call of "__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT()" instead of "__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT". When the old call was restored, the interrupt function was as expected again.
