I see that you have problems with your devices when you don’t know even (and you don’t even ask) on which speed your device is actually running. Speed of your device depends on PLL settings or clock source you have selected for system core clock.
In most cases system core clock’s source is PLL output. To get proper value, you check ALWAYS first these settings when something is not working. Because I’m tired of questions that something is not working but then your MCU clock is totally failed.
STM32F4xx series MCUs have ALL 16MHz RC oscillator inside which can be used for PLL input clock. It is not so accurate but it works just well if you don’t have connected external clock.
External clock is probably your crystal you have connected. In this example we will talk in case that you have external crystal connected.
If your clock is not properly set, then you have problems with everything. USB not working, USART baudrate failed, timer’s clock not OK…
This content has only sense, if you use Standard Peripheral Drivers and not HAL drivers from ST!
To be able to get your MCU to full speed, you have to do the following changes:
Some informations about Nucleo boards:
This is an extract of 300 words from the original article.
Thanks a lot to https://stm32f4-discovery.net/2015/01/properly-set-clock-speed-stm32f4xx-devices/. We hope to give you as much visibility as possible.
Source SEM SEO 4 YOU.