STM32WL5MOCH - Error when using HSE as clock source for SYSCLK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
- Labels:
-
RCC
-
STM32WL series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
