Skip to main content
PX_it
Associate II
April 26, 2021
Solved

forever loop bug in stm32h7xx_hal_rtc.c for RTC initialization

  • April 26, 2021
  • 4 replies
  • 1384 views

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.

This topic has been closed for replies.
Best answer by PX_it

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

4 replies

PX_it
PX_itAuthor
Associate II
April 26, 2021

Why not fix it in stm32h7xx_hal_driver?

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

Amel NASRI
Technical Moderator
April 28, 2021

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 "Best Answer" on the reply which solved your issue or answered your question.
PX_it
PX_itAuthorBest answer
Associate II
January 20, 2022

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