STM32H7 SYSCLK stuck at 64 MHz (HSI), PLL not switching
I am using an STM32H7 MCU and configuring the system clock to 400 MHz using CubeMX. The clock tree shows SYSCLK = 400 MHz, and MCO2 is configured to output SYSCLK.
However, when I debug:
HAL_RCC_GetSysClockFreq() returns 64 MHz
RCC->CFGR shows SWS = 0 (HSI is used)
SW = 0, meaning the system is not switching to PLL
It seems that the PLL is not being selected or is failing to lock, and the system remains on HSI. I have configured PLL and SYSCLK source in CubeMX, but the change is not reflected at runtime.
HAL_RCC_GetSysClockFreq() RETURNS 64MHZ




