STM32CubeMX LL Driver Bug - HSE calculations
Hello,
I've encountered a bug in code generation when using the LL STM32F3 drivers 1.9.0 in Cube 4.23.0.
The device is the
STM32F303CCTx
, although it's probably not device specific.Using the clock configurator and setting an HSE of 16MHz, the code generated in
stm32f3xx_ll_rcc.h
indicates a wrong value for HSE:
&sharpif !defined (HSE_VALUE)
&sharpdefine HSE_VALUE 8000000U /*!< Value of the HSE oscillator in Hz */&sharpendif /* HSE_VALUE */This can cause all sorts of problems if one uses the API to get various peripheral clock speeds, like
LL_RCC_GetUSARTClockFreq
which gave me the wrong value, causing me to set up the wrong baud.The
.ioc
file seems correct since the relevant field is correct:RCC.HSE_VALUE=16000000
#ll-drivers #stm32f3 #cube-mx