2024-07-12 08:08 AM
STM32H753 UART Baud is 15% low. I set it to 115200, but it's running at 98400. Is this a misconfigured clock?
Solved! Go to Solution.
2024-07-12 10:55 AM
Hi Tesla,
I tried modifying the HSE to a calculated 28,645,833 this made no difference whatsoever.
Thanks,
Glenn
2024-07-12 10:57 AM - edited 2024-07-12 10:59 AM
@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.
2024-07-12 11:07 AM
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.
2024-07-12 11:38 AM - edited 2024-07-12 11:39 AM
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.
2024-07-12 12:45 PM
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.
2024-07-12 01:02 PM
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.
2024-07-12 01:05 PM
I do not want to open the enclosure if I can avoid it.
2024-07-12 01:07 PM
Hi Pavel,
Thanks for the reply,
Why do you say they look cube-generated? There are no MX_ functions called, just HAL.
2024-07-12 01:08 PM
Hi Andrei,
Thanks for the reply.
That is an awesome idea!
2024-07-12 01:26 PM
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.