Solved
forever loop bug in stm32h7xx_hal_rtc.c for RTC initialization
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.
