2026-06-03 8:57 PM - last edited on 2026-06-04 1:43 AM by Imen.D
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?
2026-06-04 12:01 AM
How about the HSE failing rate? It seems some board can working from your description...
FYI for AN5042 Application note
How to calibrate the HSE clock for RF applications on STM32 wireless MCUs
2026-06-04 12:50 AM - edited 2026-06-04 12:50 AM
Typically, with other STM32, the load capacitors for the HSE are indeed connected externally - however, this is not necessary for the STM32WB and STM32WBA, as you can read in:
Therefore please remove C43 and C44.
Regards
/Peter
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.