2025-03-13 7:49 AM
The STM32CubeMX code generator allows you to enable the internal HSE and use it as the system clock source. However, when attempting to run the code, the system always fails into the Error Handler.
Solved! Go to Solution.
2025-03-13 7:57 AM
The STM32WL5MOCH has an internal HSE TCXO, not a regular crystal. Hence the initialization code from CubeMX is incorrect (as of 3/13/2025).
In the function SystemClock_Config(), You need to change the HSEState from:
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
To:
RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS_PWR;
If the system does not start, check all the clock configurations closely.
2025-03-13 7:57 AM
The STM32WL5MOCH has an internal HSE TCXO, not a regular crystal. Hence the initialization code from CubeMX is incorrect (as of 3/13/2025).
In the function SystemClock_Config(), You need to change the HSEState from:
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
To:
RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS_PWR;
If the system does not start, check all the clock configurations closely.