cancel
Showing results for 
Search instead for 
Did you mean: 

UART cannot set high baud rate

fkst
Associate II

I have a uart peripheral whose baud rate can only be set to 3.125M. However, the baud rate of another uart peripheral with the same clock configuration in the project can be set to 12.5M. I want to know what the baud rate limit is based on? How to increase the baud rate from 3.125M to 12.5M?

 

fkst_0-1703066288603.png

fkst_2-1703066511624.png

 

fkst_1-1703066310126.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

CubeMX is using the UART5 clock selection to determine the acceptable UART7 speeds. Clearly a bug. In MCUA it's set to SYSCLK=200MHz but in MCUB it's set to PCLK1=50MHz, hence the difference in behavior.

Easy workaround: enable UART5, set the clock selection to SYSCLK to match that of UART7, then disable UART5.

TDK_0-1703134308790.png

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

12 REPLIES 12
AScha.3
Chief II

You selected probably different oversampling modes or clock prescaler settings (in adv. parameters).

-> read in  rm....

If you feel a post has answered your question, please click "Accept as Solution".

hi, AScha.3 

 Thanks for your answer, I checked the parameters are the same.

gbm
Lead III

With the default 16x oversampling, the max baud rate is uart_input_clock / 16. Set the oversampling to 8 if you need more - then it's limited to uart_input_clock / 8. Or increase the UART input clock frequency if it is possible.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice

But in pics you show : different speed limits, but for same peripheral - how this can be at same parameters and clk ?

AScha3_0-1703073194893.png

but 

 

AScha3_1-1703073230602.png

I  can do same :

AScha3_0-1703074115338.png

and :

AScha3_1-1703074162521.png

 

:)

If you feel a post has answered your question, please click "Accept as Solution".
TDK
Guru

The baud rate limit is based on the internal UART clock and the settings you use for the UART.

Attach your IOC if you're having issues. You show limits for the same peripheral twice, which isn't consistent with your question.

If you feel a post has answered your question, please click "Accept as Solution".

In my project, two identical MCUs need to cross-communicate, but the upper limit of the baud rate of MCUB is limited, which troubles me.

Since i am not allowed to send ioc files, I took screenshots of the clock and uart configuration of the two chips. In addition, I am using the linux version(1.12.0) of CubeIDE. 

MCUA

fkst_0-1703125081801.png

fkst_4-1703125250309.png

 

MCUB

fkst_1-1703125131194.png

 

fkst_5-1703125295931.png

 

Thanks.

 

fkst
Associate II

In my project, two identical MCUs need to cross-communicate, but the upper limit of the baud rate of MCUB is limited, which troubles me.

Since i am not allowed to send ioc files, I took screenshots of the clock and uart configuration of the two chips. In addition, I am using the linux version(1.12.0) of CubeIDE. 

MCUA

fkst_6-1703125787306.png

 

fkst_7-1703125787359.png

 

 

MCUB

fkst_8-1703125786670.png

 

 

fkst_9-1703125787638.png

 

 

Thanks.

I understand the issue you're describing now.

You can rename your IOC files to *.TXT and attach them.

It appears there is a bug with how CubeMX is calculating the max rate here, as it isn't adjusted for the selected clock source. There's probably a workaround, but I can't duplicate the issue. Seeing your IOC files would be insightful.

If you feel a post has answered your question, please click "Accept as Solution".
fkst
Associate II