Team,
One of our customers need to use the non-standard UART baud rate of 5787 on AM3351, is this supported ?
Best Regards, Shiv
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Team,
One of our customers need to use the non-standard UART baud rate of 5787 on AM3351, is this supported ?
Best Regards, Shiv
Hi,
UART baud rate configuration is described in sections 19.3.8.1.1 and 19.3.8.1.2 of the AM335x TRM Rev. Q. For 5787bps, if you use 13x oversampling you will get a divisor value of 638 decimal. Then 48MHz / 13 / 638 = 5 787.3bps, which will give a 0.005% baud rate error. This is perfectly acceptable in almost all use cases.
Hi Shiv,
If you ask how to program linux user space to use custom baud rate, please refer to the link
https://stackoverflow.com/questions/12646324/how-can-i-set-a-custom-baud-rate-on-linux
The answer show to use BOTHER in termios2 c_flag. I haven't used this method though.
Or you can refer to link
which shows the 'legacy' method to set termios c_flag = B38400 then set the divisor in .custom_divisor. The divisor value would be 0x1027e for your use case. The value of 0x27e is the divisor value 638 as Biser explained above, and BIT16 set to 1 to tel the kernel driver to use 13x oversampling.