Electronic – STM32F746 Clock not reporting as expected

clock-speedstm32stm32cubemxstm32f7

I'm using an STM32F746VGT6 microcontroller configured from STM32CubeMX for all the clocks and I'm getting roughly 220% higher clock rates when compiled.

For instance I have an HSE crystal at 11.2896MHz with the following main PLL settings:

  • PLLM /11
  • PLLN *234
  • PLLP /2
  • PLLQ /5

I have selected HSE for PLL source and PLLCLK as System Clock Source. Doing that in STM32CubeMX yields 120.080291MHz.

However, after SystemClock_Config(), SystemCoreClock = 265909059.

Due to that discrepancy, the microcontroller thinks it's working 220% faster than it actually is so all my timings are off by that much.

Has anyone else seen this issue and what could be the problem here? Thanks for any insight.

Best Answer

I speculate that STM32CubeMX does not know the frequency of your oscillator and assumes it is 25 MHz, as happens to be on at least some of the STM32F7 Discovery boards. 265909059 * 2 / 234 * 11 = 24999997, according to my calculator.

Related Topic