2018-10-31 03:07 AM
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.
Solved! Go to Solution.
2019-04-15 08:42 AM
Hello,
This issue is fixed in the new release of STM32CubeL4 V1.14.0.
Thanks
Imen
2018-10-31 04:22 AM
Hello @AOech ,
I confirm that the problem is missing '__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT();' in the "stm32l4xx_hal_rtc_ex.c" file within the new version of STM32CubeL4.
The correction will be done in the HAL_RTCEx_SetWakeUpTimer_IT function, to replace the macro __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (in line 912) by __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() on other devices than STM32L412xx/STM32L422xx.
Kind Regards,
Imen
2018-10-31 04:52 AM
Hello Imen Dahmen, thank you for the confirmation. At the moment we have a workaround. If the issue will be fixed in the next version of the HAL, that would be fine.
2019-04-15 08:42 AM
Hello,
This issue is fixed in the new release of STM32CubeL4 V1.14.0.
Thanks
Imen