Skip to main content
Associate II
Nov 11, 2026 11:53 AM UTC
Question

STM32U385, CubeMX generated SystemClock_Config does not enable HSE Clock if it is only used in the MSI PLL mode

Environment

  • STM32CubeMX 6.18.1, MCU database DB.6.0.181
  • STM32Cube FW_U3 V1.4.0
  • MCU: STM32U385CGT6

Steps to reproduce

  1. System Core → RCC → High Speed Clock (HSE) = Crystal/Ceramic Resonator (type does not matter)
  2. System Core → RCC → Parameter Settings → RCC Parameters → MSIS/MSIK Auto Calibration = MSIS auto calibration
  3. Clock Configuration: HSE input frequency = 16 MHz, and set the MSIS auto-calibration source mux to HSE
  4. Don't use HSE for anything else (SYSCLK, ADC/DAC, RTC, MCO, ICLK, SAI1)
  5. Generate code
     

In SystemClock_Config() the init struct is missing the field to enable the HSE (RCC_OscInitStruct.HSEState = RCC_HSE_ON;).
It is only generated if HSE is used by any other peripheral (e.g. the ADC clock).

Attached is a minimal .ioc file to reproduce it. By selecting anything but HSE in the ADC/DAC clock mux in the clock configuration HSE is no longer getting enabled in SystemClock_Config().

 

Best Regards,
Cecil

2 replies

Andrew Neil
Super User
Nov 11, 2026 12:13 PM UTC

It seems reasonable that, if nothing uses the HSE, then it is not enabled?

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
CecilWAuthor
Associate II
Nov 11, 2026 12:16 PM UTC

MSIS/MSIK Auto Calibration mode can either use the LSE or HSE(16 or 32 MHz). If this feature is enabled, the HSE should be enabled aswell if i understand it correctly.