cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 change to 25MHz usart3 baud rate problem

Elliott Li
Associate II
Posted on October 05, 2017 at 15:38

Hi all,

I am using STM32F407VET6 with 25MHz crystal by STM32Cube_FW_F4_V1.16. I have changed HSE_VALUE to 25000000 in system_stm32f4xx.c and RCC_OscInitStruct.PLL.PLLM = 25 in SystemClock_Config main.c, but I found that usart3 baud rate is not correct. I set the baud rate to 9600, but I got 30075 from Oscilloscope. The method I used is in 

http://www.st.com/content/ccc/resource/technical/document/application_note/group0/66/fa/62/a2/5c/75/48/a8/DM00327191/files/DM00327191.pdf/jcr:content/translations/en.DM00327191.pdf

  Page 9.0690X00000608HKQAY.png

Here is my result.

0690X0000060488QAA.jpg

Please help me. Thank you

Regards,

Elliott

#usart #25mhz-crystal
5 REPLIES 5
Posted on October 05, 2017 at 15:57

Post your calculation and the read out value from USARTx_BRR.

JW

Posted on October 05, 2017 at 16:35

You'd want to check HSE_VALUE in stm32f4xx_hal_conf.h, and confirm actual value used in the USART configuration/clock code.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on October 05, 2017 at 17:01

Shouldn't autobaud be system-frequency-agnostic?

JW

Posted on October 05, 2017 at 17:11

One could make one that wasn't, not sure that's the case here.

Depending on where HSE_VALUE is set you can build code that has different ideas what the clock is, the conf.h is typically pulled by everything. Changing it in system_stm32f4xx.c isn't going to cut it.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on October 08, 2017 at 10:14

Thank you. It works for me.