2

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.

Michel Keijzers
  • 13,867
  • 18
  • 69
  • 139
Jeremy
  • 23
  • 3

1 Answers1

2

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.

A.K.
  • 352
  • 1
  • 5
  • Indeed you are correct. It was using 25MHz as it's computation. I use VisualGDB with Visual Studio. They generated a conf as well and while I removed it from the solution, it was still being compiled (with HSE set to 25MHz instead of 11.2896). Only when I used find all references did I find the other file still being used. – Jeremy Oct 25 '17 at 19:34