cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 works twice as fast

Chuev.Vladimir
Associate III
Posted on May 25, 2017 at 13:10

I use SW4STM32.

I noticed that when I generate a project with SW4STM32, the speed of my STM32F401VBT6 is twice faster.

For example, HAL_Delay(1000) actually awaits 500ms.

USART1 transmits data on the speed 230400, although 115200 is specified in cofiguration.

But if I generate a project using CubeMX it's all ok.

I transfered all the source code from the project generated by CubeMX into the project generatd by SW4STM32, but the problem remained.

#cube-mx #clocks
1 REPLY 1
Posted on May 25, 2017 at 16:44

Check that HSE_VALUE definition reflects the clock source crystal in use, and the PLL settings. The baud rate settings get computed by backing out the current RCC/PLL settings, and doing maths base on the assumed clocks source. Failures of the type described occur when the value the software is using differs from reality.

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