2026-06-03 8:57 PM
The problem I am facing is that I can't seem to get passed the SystemClock_Config() function call, more specifically, the HAL_RCC_OscConfig() function returns HAL_TIMEOUT in this part indicating that the HSE is not getting ready.
/* Wait till HSE is ready */
while (READ_BIT(RCC->CR, RCC_CR_HSERDY) == 0U)
{
if ((HAL_GetTick() - tickstart) > HSE_TIMEOUT_VALUE)
{
return HAL_TIMEOUT;
}
}
}
I checked the load capacitance of the external crystal and tried to trim the clock using the registers on the STM32 by using HAL_RCCEx_HSESetTrimming() but I was unable to find how the value in the register maps to a specific capacitance. This led me trying every single possible value (0-0x3F) but that made no difference. I have already resoldered a new crystal and a new STM32 so I am now believing the I have a layout issue in my PCB that's causing the crystal to not start. I have checked the Power to VDDRF as well
Any idea what the issue could be?
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.