BUG: CubeMX 4.26.1 (Eclipse plugin): HSE_VALUE not set correctly
I have a project which is using an 11.0592MHz external TTL oscillator, PLL'd up to 66MHz HCLK.
CPU is an STM32F303RET6 on a Nucleo-64 F303 board.
IDE is Atollic TrueSTUDIO STM32 Edition.
I found the System Tick timer was ticking at ~700us. After single stepping through the init code, I found that HAL_RCC_ClockConfig() had incorrectly calculated the CPU core clock:
/* Update the SystemCoreClock global variable */
SystemCoreClock = HAL_RCC_GetSysClockFreq() >> AHBPrescTable[(RCC->CFGR & RCC_CFGR_HPRE)>> RCC_CFGR_HPRE_BITNUMBER];
/* Configure the source of time base considering new system clocks settings*/
HAL_InitTick (TICK_INT_PRIORITY);At this point, SystemCoreClock was 48000000, which given a PLL of 6x suggests that the HAL is set up for an 8MHz HSE clock.
Indeed, HSE_VALUE is 8000000.
Defining HSE_VALUE=11059200 in the project options fixed this.
My question is -- given that STM32CubeMX knew my HSE clock was 11.0592MHz, why did it not include the required settings in the project configuration or one of the headers?
I'm sure it used to do this.
Thanks.
Phil