cancel
Showing results for 
Search instead for 
Did you mean: 

forever loop bug in stm32h7xx_hal_rtc.c for RTC initialization

PX
Associate II

The function RTC_EnterInitMode in stm32h7xx_hal_rtc.c can cause a forever loop when initializing RTC. The break line is missed as below:

    while ((hrtc->Instance->ISR & RTC_ISR_INITF) == 0U)
    {
      if((HAL_GetTick()  - tickstart) > RTC_TIMEOUT_VALUE)
      {
        status = HAL_TIMEOUT;
        hrtc->State = HAL_RTC_STATE_TIMEOUT;
        break;  <<<<< missed line
      }
    }

This was found occasionally with my STM32H745ZI-Q eval board, which of RTC and LTE were damaged by wrong power connection.

1 ACCEPTED SOLUTION

Accepted Solutions
PX
Associate II

Confirmed it's fixed in v1.10.1. Thanks.

View solution in original post

5 REPLIES 5
PX
Associate II

Why not fix it in stm32h7xx_hal_driver?

please look closely that you are talking about a different HAL.

Amel NASRI
ST Employee

Hi @PX​ ,

After a quick review, I don't find this issue tracked in Github.

I'll take care to report it to development team.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

PX
Associate II

Confirmed it's fixed in v1.10.1. Thanks.