HAL_Init() Returns HAL_ERROR due to common_system_clock Being Zero on STM32H747I-Discovery
Dear STM Support Team,
I am currently working on a project using the STM32H747I-Discovery Kit and have encountered an issue during system initialization. After integrating code from the STemWin_HelloWorld example and successfully compiling, the HAL_Init() function returns HAL_ERROR.
Upon debugging, I have found that the common_system_clock variable is being set to zero when returning from the following block of code:
#if defined(RCC_D1CFGR_D1CPRE)
common_system_clock = HAL_RCC_GetSysClockFreq() >> ((D1CorePrescTable[(RCC->D1CFGR & RCC_D1CFGR_D1CPRE)>> RCC_D1CFGR_D1CPRE_Pos]) & 0x1FU);
#else
// Other conditionals or relevant code
#endif
HAL_RCC_GetSysClockFreq() correctly returns a value that corresponds to 64MHz, so the issue seems to arise during the prescaler application. This leads to a situation where common_system_clock becomes zero, which should not be the case.
I have double-checked the clock configurations, prescaler settings, and the relevant RCC registers but have not found any discrepancies that could lead to this issue.
Could you please advise on what might be causing this behavior or provide any additional steps to troubleshoot this problem? I am using the latest HAL library version recommended for STM32H747I-Discovery.
Thank you in advance for your support.
