AnsweredAssumed Answered

Bug report: STM32F1_Cube - clock frequency incorrect

Question asked by Pac-Man on Jun 20, 2015
Latest reply on Jul 6, 2015 by Pac-Man
Version: STM32F1_Cube v1.0.0
Microcontroller: STM32F103c8 (64KB Flash, 20KB SRAM, 72MHz Cortex-M3)

I think there might be several issues here.

In the file ...
STM32Cube_FW_F1_V1.0.0/Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c

... the comment for SystemInit() promises the following:

"Setup the microcontroller system. Initialize the Embedded Flash Interface, the PLL and update the SystemCoreClock variable."

-However, SystemCoreClockUpdate is not called and the SystemCoreClock variable is either set to 24000000 or 72000000 in advance.
On my bare-metal board, I have an 8 MHz external crystal, thus HSE_VALUE would be 8 MHz; HSI_VALUE would also be 8 MHz.
However, when I run a LED-blinker, SystemInit is called, but when looking at the values using the debugger, the microcontroller seems to run at HSI_VALUE (eg. all values appear to be set to the "reset value" mentioned in RM0008.
My timing-tests also suggests that the microcontroller is running at 8 MHz, not 24MHz nor 72MHz.

It seems that in the STM32F4_Cube, the clock frequency is usually set to the maximum by SetSysClock(), which is called from inside SystemInit().
Shouldn't the STM32F1_Cube behave in a similar way ?

Outcomes