Question
STM32U385, CubeMX generated SystemClock_Config does not enable HSE Clock if it is only used in the MSI PLL mode
- 2 replies
- 5 views
Environment
- STM32CubeMX 6.18.1, MCU database DB.6.0.181
- STM32Cube FW_U3 V1.4.0
- MCU: STM32U385CGT6
Steps to reproduce
- System Core → RCC → High Speed Clock (HSE) = Crystal/Ceramic Resonator (type does not matter)
- System Core → RCC → Parameter Settings → RCC Parameters → MSIS/MSIK Auto Calibration = MSIS auto calibration
- Clock Configuration: HSE input frequency = 16 MHz, and set the MSIS auto-calibration source mux to HSE
- Don't use HSE for anything else (SYSCLK, ADC/DAC, RTC, MCO, ICLK, SAI1)
- 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
