AnsweredAssumed Answered

CubeMX generates incorrect system clock init code?

Question asked by pavel a on Feb 23, 2018
Latest reply on Feb 25, 2018 by pavel a

Still very fresh with CubeMX and all this STM32 stuff, hope it is my fault. Or not?

In the Clock configuration tab in Cube 4.23 I've produced configuration that should set the HCLK and SYSCLK to 72 MHz

(not sure how it calculated this config, I have external osc. 8 MHz and must have 48 MHz for USB). The chip is STM32F446. See the picture below.

But, in the generated code in main.c after SystemClock_Config()  SystemCoreClock value is 225,000,000.

If I understand correctly SystemCoreClock should be exactly the HCLK (or Sysclk?)

I know that the actual frequency is 72 MHz because I use debug output via ITM_SendChar, and entered 72Mhz in Keil debug settings. It prints   


CubeMX timing tree


Today I upgraded this project to Cube v. 4.24 and libraries 1.19.0 and the  SystemCoreClock value still is 225,000,000.

This may be related to this thread.


Please advice...



-- pa