10 years, 6 months ago.

How do you set the SystemCoreClock

To use an external crystal value there is a warning that the default vault is 25mhz(see below)...so how do you change the SystemCoreClock to run 84mhz when using an external crystal (8mhz)?

external crystal value

The mbed lib is using HSE_VALUE defined in the file stm32f4xx_hal_config.h to calculate SystemCoreClock, which is used for all timings : baudrate or wait() ... This value is the frequency of the external crystal. It is defined to 25MHz at the moment - I have asked to change it to 8MHz default. You can set the variable SystemCoreClock to 84000000 to patch this . If you use the internal oscillator the calculated value is ok

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F401RET6 microcontroller.
Be the first to answer this question.