Skip to main content
AOech
Associate
October 31, 2018
Solved

STM32CubeMX L4 HAL Bug Report

  • October 31, 2018
  • 3 replies
  • 938 views

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.

This topic has been closed for replies.
Best answer by Imen.D

Hello,

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

Thanks

Imen

3 replies

ST Technical Moderator
October 31, 2018

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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
AOech
AOechAuthor
Associate
October 31, 2018

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.DBest answer
ST Technical Moderator
April 15, 2019

Hello,

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

Thanks

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks