I’m encountering a strange issue with the UART baud rate, which I suspect might be a bug.
Everything works correctly at lower baud rates, but when I select 115200, the UART output becomes extremely slow — roughly equivalent to 110 baud or less.
I’ve modified the FCDX file to allow the MCU to run at 96 MHz, and I’ve configured the RCC settings according to STM32CubeMX without any reported errors.
I’ve attached the modified FCDX file and a screenshot of the RCC settings for reference.
I am kind of stuck any help would be great
Attachments
Cube RCC Settings.png (123.96 KiB) Viewed 194 times
I believe I’ve found the source of the problem.
I had to set RCC_PLL_SRC to OFF, as this was the only way the delay timings correctly matched 96 MHz when verified on the oscilloscope.
However, when I change the PLL source to HSE, the UART baud rate improves slightly, but it still doesn’t reach the correct speed — the issue remains.
So, the question is:
Is it possible to run the STM32 at 96 MHz without causing timing or UART issues in Flowcode?
So with the original FCDX and running at 16MHz using HSI default Settings, the problem is gone and the UART works fine @115200 .
But I need to use the External 8MHz crystal HSE mode and PLL to 96Mhz, which is half of what this MCU can do
is that possible?
I'm not near my PC at the moment to check much, but a couple of points that might help...
You need to set the Flowcode Clock speed to the source rate, ie either 16 or 8Mhz.
If you want to double the 96, then change the PLL divider from /8 to /4
Thanks for your reply. That was exactly the issue — I had assumed it was the system clock, not the source clock.
That’s why I thought the MCU was limited to a maximum of 26 MHz.
Now the UARTs are working fine at 115200 bps.
However, I’ve noticed another problem: the timer interrupt frequency is being calculated incorrectly. The calculation is based on 8 MHz, but after the PLL -> APB1 ends up to be 48 MHz.
As a result, the interrupt frequency is calculated as 8.503 Hz, when in reality it should be 50.1 Hz.
Glad it's working for you now.
Yes, interrupt timing calculations on these ST devices is a known issue.
That Flowcode dialogue doesn't have the information to work out the final clock frequency driving the timers.
So the parameters need to be calculated manually unfortunately. For now.