Skip to main content
Chuev.Vladimir
Associate III
May 25, 2017
Question

STM32F4 works twice as fast

  • May 25, 2017
  • 1 reply
  • 601 views
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
This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
May 25, 2017
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 VenmoUp vote any posts that you find helpful, it shows what's working..