I am attempting to run /dev/ttyTHS2 at 8 Mbit/s, in order to stream data from a microcontroller to the Jetson TX2. I’m using Ubuntu 16.04 LTS, Python 3.5, and PySerial on the TX2. I have configured the UART on the MCU and TX2 to use two stop bits. I have found that communication works well for small transfers at 4 Mbit/s. However, when I try to use a baud rate of 8 Mbit/s, the TX2 UART transmits at the wrong baud rate – using an oscilloscope, I can see that the true baud rate used by the TX2’s UART is as high as 8.8%. When trying to use a baud rate of 12.5 MB/s on the TX2, I found an even higher baud rate error of ~16%.
Presumably the issue is that a clock frequency is being used for which there is no integer divisor that produces the desired baud rate. Unfortunately the API I am using (PySerial) doesn’t give me much visibility into how the UART is actually being configured…
Can anyone recommend either
- A serial API in Python, C or C++ which is known to work with baud rates over 4 Mbit/s on the TX2, or
- Some other way of modifying -- or even just viewing -- UART register configuration, without having to write my own serial driver