NB: I am posting this in the Orin AGX Forum because that is my primary target device, but I am also seeing this problem with a Xavier NX dev kit. Both devices are running the stock JetPack 5.0.2 Ubuntu release.
I am running into an issue with USB-serial devices, whereby sometimes no data are available to read. Simply retrying one or more times will succeed - there is no need to reboot the Jetson machine or re-plug the USB device.
The device is configured using stty -F /dev/ttyUSB0 raw ispeed 115200 ospeed 115200
. Using cat /dev/ttyUSB0
will either return a continual stream of bytes as expected, or it will just block indefinitely with zero bytes returned. If there are zero bytes, there is nothing new present in the kernel logs. If we do receive bytes, that stream will continue as long as long as the device is generating bytes - the connection seems reliable once it has started. There don’t seem to be issues with device enumeration either - it is consistently present the whole time.
I did some investigation where I redirected /dev/random
on my host laptop (running Ubuntu 20) to a USB-serial device, and then attempted to read from it on a Xavier 200 times in a loop, tracking how many times it actually received bytes. I tried different baud rates and there seems to be a direct negative correlation of performance with baud rate, as the attached graph shows.
Further observations:
- If I run the test the other way, and send data from the Xavier (or Orin) to my laptop, it works 100% of the time regardless of baud rate. I am using the exact same
stty
command above to configure the serial port on both machines. - I first saw this problem with a device using a Si Labs CP2105 Dual USB-UART bridge, but the above testing involved a device with a Prolific PL23A3 USB-UART bridge.
- I tried another USB-serial device which appears as
/dev/ttyACM0
and that seemed to work fine regardless of baud rate. - I plugged a USB card into the Orin Dev Kit’s PCIe port; USB-serial devices plugged into one of those ports also seem to work consistently.
- I have also tried using a mains-powered USB hub rather than plugging devices directly into the Orin Dev Kit’s ports, but it has not made a difference.
Please could someone from NVidia try and replicate these findings and offer a solution?