AnsweredAssumed Answered

STM32CubeMX LL Driver Bug - HSE calculations

Question asked by GeorgeP on Jan 18, 2018
Latest reply on May 11, 2018 by Maxim Yudin

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:

#if !defined (HSE_VALUE)
#define HSE_VALUE 8000000U /*!< Value of the HSE oscillator in Hz */
#endif /* 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

Outcomes