Install USB to Serial Converter Kernel Modules – L4T 28.1

Have you experienced plugging in a USB device, and the Jetson not recognizing it? Sometimes all you need is the right USB to Serial Convert Kernel Module! Looky here:

Background

As we discovered in a previous article, Install ttyACM Module , sometimes a NVIDIA Jetson TX1 or Jetson TX2 running L4T 28.1 needs some help before it can properly talk to a USB device.

You might notice that a device is visible where you expect it, such as ttyACM or ttyUSB, but you cannot communicate with it. Some of the other devices you have work properly, but not others. Typically one of the causes is that the correct driver is not available for the device. For example, many Arduino clones use a QinHeng Electronics CH-340/341 USB-Serial Adapter. Another example is a Slamtec RPLIDAR which requires Cygnal Integrated Products CP210x UART Bridge support. Both of these chipsets basically do the same thing; they convert USB signals to serial that the device understands.

The L4T 28.1 kernel has support for the FTDI USB to Serial converter, so that’s why some devices work. One question that gets asked a lot is “Why aren’t all of these drivers built into the stock kernel?”

The answer, depending on your viewpoint, is “They aren’t.” The Jetson is an embedded development kit, meant for integrating in to products. The basic idea is you have a minimal configuration, and then add what you need for your application. Extra drivers and modules take up valuable memory in such devices, so better to add them judiciously.

The other side of that coin is that many of the Jetson users come from a Linux desktop environment where everything but the kitchen sink is enabled out the box. Therefore it’s a little confusing that something simple like this is missing. After you figure out what the issue is, you need to compile the kernel modules. Let’s just say that first time through building kernel modules on the Jetson is a little challenging. And it is frustrating for folks who just want to do something like connect an Arduino to the Jetson.

What to do, what to do …

Installation

Well, you’re in luck! Two of the more common USB to Serial kernel modules, CH341 and CP210x, are now in a JetsonHacks Github repository, along with installer scripts.

Plug your USB device in, and figure out which driver you need using:

$ lsusb

If you see the device reporting as a CH340/CH341 device or CP210x device, you’re in luck!

First, clone the repository, and switch to the repository directory:

$ git clone https://github.com/jetsonhacks/installACMModule
$ cd installACMModule

For a CH341 device:

$ ./installCH341.sh

For a CP210x device

$ ./installCP210x.sh

It takes a lot less time to install it than to explain it!

You will probably need to replug (unplug the device, then plug it back in) for the proper kernel module to load. You can examine the loaded modules using:

$ lsmod

Going forward!

In the next release of L4T, L4T 28.2, both the cdc-acm driver and the CP210x driver are part of the stock kernel. That should make life simpler.

Notes

The modules use 4.4.38-tegra as there “Kernel Magic” numbers. This means that they are for use with the stock L4T 28.1 kernel. If you are using a different kernel, you will have issues.

Be the first to comment

Leave a Reply

Your email address will not be published.


*