cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H753 UART Baud is 15% low.

GlennH
Associate III

STM32H753 UART Baud is 15% low. I set it to 115200, but it's running at 98400. Is this a misconfigured clock?

25 REPLIES 25

Hi Tesla,

I tried modifying the HSE to a calculated 28,645,833 this made no difference whatsoever.

 

Thanks,

Glenn

 

BarryWhit
Senior III

@GlennH wrote:

STM32H753 UART Baud is 15% low. I set it to 115200, but it's running at 98400. Is this a misconfigured clock?


What are you actually measuring and how? Please describe the measurement process that yielded 98400 as the result.

- If a post has answered your question, please acknowledge the help you received by clicking "Accept as Solution".
- Once you've solved your issue, please consider posting a summary of any additional details you've learned. Your new knowledge may help others in the future.

For 15% slower

25000000 / 115200 * 98400 = 21354167

They using the 64 MHz HSI as the known clock.

If you scope the data, and it's still wildly off you're going to need to look at the clock settings in the RCC / PLL, and perhaps the hardware more broadly, say checking VCAP's get you to 4u7 F and you see 1.25V there.

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

Please check the clock source for the UART: is it derived from the HSE or not? UARTs of STM32H7 have several possible clock sources.

By the way, the code snippets look like cube-generated.

 

Throw together a basic model in CubeMX with the crystal frequency that you are using and the UART baud that you want, generate code and compare it to your code. 

If you don't want to use CubeMX code, don't use it, just use their calculations.

Hi Barry,

Thanks for the reply.

I measured the time for 1 bit on an oscilloscope then 1/time. Then I dialed it in on Realterm until I received reliable characters.

I do not want to open the enclosure if I can avoid it.

 

Hi Pavel,

Thanks for the reply,

Why do you say they look cube-generated? There are no MX_ functions called, just HAL.

 

Hi Andrei,

Thanks for the reply.

That is an awesome idea! 

 

When you say:

"I tried modifying the HSE to a calculated 28,645,833 this made no difference whatsoever."

You're not using HSE. Check your equivalent to a Cube generated SystemClock_Config. 

Definitely check SystemClock_Config before mucking around with the UART settings.