This patch fixes the rounding in calculating BRR for UARTv1 and UARTv2 for STM32. It was originally done by Jon Challenger, and I'm submitting it here for him.
It fixes an issue with a STM32 talking to a RaspberryPi at 921600 baud. With STM32_PCLK1=42000000 and speed=921600 the code would come up with a BRR of 45. With this fix the BRR comes out as 46.
A value of 45 gives an error of 1.27% in the desired baudrate. A value of 46 gives an error of 0.94%. Perhaps surprisingly, this makes all the difference when talking to the RaspberryPi, and the link starts working.
Patch is against branch 18.2.x, tested on STM32F427, STM32F405 and STM32F765
Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
2 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests