Unreliable USB-Serial behaviour

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?

I don’t have a real solution for you, but is it possible to produce that same chart when using two stop bits? I’m thinking reliability would go up, but not all hardware can use two stop bits.

Hi,
This looks to be duplicate of
Serial port less reliable after upgrade to 35.1, continuation

We are checking it. Will update once there is further finding.

@DaneLLL I would say they are definitely related, but that involves UART directly, whereas this is USB, and specifically appears to be something around usbserialgiven that cdc_acm seems to be okay?

I have repeated this testing with the Xavier NX flashed to JetPack 4.6, and I do not have any issues with the USB-Serial connection. To me, this strongly points to it being an issue with Kernel 5.

Hello, I’m posting here as my thread is now locked, by curiosity I have also performed the same tests than in Serial port less reliable after upgrade to 35.1, continuation on the latest Jetpack 5.1, there is no improvement regarding the serial port performance.

Hi,
Please check if you can replicate the issue on Orin developer kit. If yes, please share the steps so that we can set up and try.