cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX L4 HAL Bug Report

AOech
Associate

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

Hello,

This issue is fixed in the new release of STM32CubeL4 V1.14.0.

Thanks

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

3 REPLIES 3
Imen.D
ST Employee

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
AOech
Associate

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.

Imen.D
ST Employee

Hello,

This issue is fixed in the new release of STM32CubeL4 V1.14.0.

Thanks

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen