Skip to main content
Visitor 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

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

    4 replies

    PXAuthor
    Visitor II
    April 26, 2021

    Why not fix it in stm32h7xx_hal_driver?

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

    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

    PXAuthorAnswer
    Visitor II
    January 20, 2022

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