cancel
Showing results for 
Search instead for 
Did you mean: 

Clock frequency problem with CubeMX and STM32F411E Discovery board

M.B.
Associate

Hello.

I'm experimenting with the Discovery board STM32F411E. The project is generated with CubeMX v5.0.0 + STM32F4-Package v1.23.0 and compiled with TrueStudio.

After some experiments with timers, interrupts, LEDs and so on i tried to toggle an LED in a one-second period. I inserted the necessary values in the timer properties page. After compile and flash the LED toggled, but with a 24 second period instead of the wished 1-second period.

After much google-research, trial and error i tried the HSI clock, instead of the default HSE clock. This finally produced the whished LED toggle period. After some further research i find out the "solution". The CubeMX property page for the RCC-module has as default setting for the HSE clock - "BYPASS clock source". After correcting this to "crystal/ceramic resonator", which i have on the STM32F411E-Discovery board - the combination HSE/PLL began to work and i got the right period of the LED-toggling.

I'm not sure if the default setting "BYPASS..." is better for someone. In my case it was not, but now i know much more about the clock system of the STM32F4 CPU :-).

Best regards

M.B.

1 REPLY 1

The STM32F4-DISCO boards have their own 8 MHz crystal, so BYPASS mode is NOT appropriate. Many other DISCO/NUCLEO derive an 8 MHz SOURCE from the processor doing the ST-LINK function, there BYPASS would be appropriate.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..