F_CPU for STM32F4

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
Post Reply
UrichB
Posts: 1
Joined: Tue Oct 12, 2021 12:49 pm

F_CPU for STM32F4

Post 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
TFTLCDCyg
Posts: 26
Joined: Tue Jan 07, 2020 9:50 pm
Answers: 1

Re: F_CPU for STM32F4

Post 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)
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: F_CPU for STM32F4

Post 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
Post Reply

Return to “IDE's”