2026-02-02 5:07 AM - edited 2026-02-02 6:25 AM
Hello.
I'm working on setting up a brand new Nucleo STM32U5A5Z development board and have some issues.
My project is a completely bare-bones default with no security or BSP enabled. The application fails in SystemClock_Config() and enters the error handler. The issue seems to be related to the HSE as SystemClock_Config returns HAL_TIMEOUT here:
/* Check the HSE State */
if (pRCC_OscInitStruct->HSEState != RCC_HSE_OFF)
{
tickstart = HAL_GetTick();
/* Wait till HSE is ready */
while (READ_BIT(RCC->CR, RCC_CR_HSERDY) == 0U)
{
if ((HAL_GetTick() - tickstart) > HSE_TIMEOUT_VALUE)
{
return HAL_TIMEOUT;
}
}
}Thanks!
2026-02-02 5:16 AM
Hello,
1- In next time please use </> to share a code. Please read How to write your question to maximize your chances to find a solution . So I invite you to edit your post to comply with the rule.
2- What clock source frequency value you set to HSE? 16MHz in HSE crystal mode?:
2026-02-02 6:29 AM
Thanks for the response!
My bad with the code, I've been getting too used to writing in markdown :)
Here is a snippet of the default clock config:
- System clock is set to 16 MHz
- HSE at 8 MHz is used as clock source.
- HSE enabled as "BYPASS Clock Source"
Aren't these settings weird as a default for the Nucleo board? I would expect 160 MHz as the sysclk. Also, changing HSE to "Crystal/Ceramic Resonator" seems to fix the error in SystemClock_Config().
2026-02-02 6:44 AM - edited 2026-02-02 6:45 AM
Hello,
Thank you for the sharing.
It seems to be an issue with that default config.
Please try the configuration I shared previously. According to the board's schematic, HSE is not using Bypass mode (For STLINK MCO output) but a crystal of 16MHz:
As you can see in the schematic, STLINK-MCO is disconnected by default and the default configuration is a Crystal of 16MHz.
If you confirm that, I will raise a ticket to fix that in CubeMx.
Hope that helps.