CubeMX v4.20.0 bug in clock configuration?
When I generate code for STM32L151CBTx (FW v1.6.0) using CubeMX it enables MCI clock (RCC_ORCILLATORTYPE_MSI) in SystemClock_Config even if only HSI is enabled in the CubeMX clock configuration UI. Similar problem does not exist for other chip versions e.g. L152CBTx.
This misconfiguration causes HAL_RCC_OscConfig to fail.
#cubemx-bug