Page 1 of 1

F_CPU for STM32F4

Posted: Tue Oct 12, 2021 12:53 pm
by UrichB
Hi,

I use the Arduino IDE for the Blackpill board. In file "boards.txt" there is no entry for CPU clock frequency. F_CPU is therefore not defined.

How to change this?

Regards Ulrich

Re: F_CPU for STM32F4

Posted: Tue Oct 12, 2021 1:43 pm
by TFTLCDCyg
It is not directly a parameter that you can modify, within the variant.ccp file of each MCU, the clock configuration parameters are defined.

To estimate F_CPU, they use this formula:

Code: Select all

(Input frequency / PLLM) * (PLLN / PLLP)

Re: F_CPU for STM32F4

Posted: Tue Oct 12, 2021 2:51 pm
by fpiSTM
With STM32 core, F_CPU is defined as systemCoreClock like this it is always up to date.
As it is explained here: https://github.com/stm32duino/wiki/wiki ... ions#f_cpu