Enable CONFIG_USB_SERIAL_PL2303 on kernel

Fairly new to the Nvidia ecosystem. I am trying to port an application which uses serial communications via a USB to a motor driver at the other end from Linux x86 system onto the Nvidia ARM architecture. When the device is connected on the Linux machine using the USB port, I get the following message on dmesg --follow:
[14402.125064] usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[14402.125069] usb 1-7: Product: USB-Serial Controller
[14402.125072] usb 1-7: Manufacturer: Prolific Technology Inc.
[14402.151611] usbcore: registered new interface driver usbserial_generic
[14402.151622] usbserial: USB Serial support registered for generic
[14402.153860] usbcore: registered new interface driver pl2303
[14402.153870] usbserial: USB Serial support registered for pl2303
[14402.153892] pl2303 1-7:1.0: pl2303 converter detected
[14402.154585] usb 1-7: pl2303 converter now attached to ttyUSB0

In contrast, on the nvidia box (a Jetson Orin Nano 8GB), I only get the following output of the same sudo dmesg --follow command:
[ 1531.966106] usb 1-2.2.3: new full-speed USB device number 12 using tegra-xusb

As you can see the pl2303 chip inside the USB cable to enable the serial communication isn’t being assigned the ttyUSB0 (or anything else) port. Further investigations on the kernel options using zcat /proc/config.gz | grep 2303 outputs:

CONFIG_USB_SERIAL_PL2303 is not set

I have no experience rebuilding nvidia or linux kernels. Can I and if so how, can this kernel configuration be changed to a ‘m’ or ‘y’ option? I’m assuming that after this change, those serial communications will be enabled on the nvidia machine.
Please help.

Hi abhishekraman,

Are you using the devkit or custom board for Jetson Nano?
What’s your Jetpack version in use?

To enable the kernel config and rebuild the kernel image, please refer to Building the NVIDIA Kernel for details.

Incidentally, if you build just the module of the driver, and if that module is built against a kernel config which is otherwise a match for the running system (including CONFIG_LOCALVERSION), then install is as simple as a file copy, and a command to tell the kernel to look for new modules.

Appreciate the quick response KevinFFF. With regards to the Jetpack version:
$ sudo apt-cache show nvidia-jetpack
[sudo] password for dev:
Package: nvidia-jetpack
Version: 6.0-b52
Architecture: arm64
Maintainer: NVIDIA Corporation
Installed-Size: 194
Depends: nvidia-jetpack-runtime (= 6.0-b52), nvidia-jetpack-dev (= 6.0-b52)
Homepage: http://developer.nvidia.com/jetson
Priority: standard
Section: metapackages
Filename: pool/main/n/nvidia-jetpack/nvidia-jetpack_6.0-b52_arm64.deb
Size: 29294
SHA256: 01f3cfaed6f45ebabacbe5f2d4c3b74a296200ae928d68b97956470d54c4be98
SHA1: 950626b2b51381650e8ecb7e3b21f5e2e89cddb6
MD5sum: 1e58b6faa4b7a9695a1f5b0cb6035d85
Description: NVIDIA Jetpack Meta Package
Description-md5: ad1462289bdbc54909ae109d1d32c0a8

In regards to the hardware, I am using the dev kit. Looks like this: https://www.amazon.com/NVIDIA-Jetson-Orin-Nano-Developer/dp/B0BZJTQ5YP?th=1. Also, the following command confirms it:
$ cat /proc/device-tree/model
NVIDIA Jetson Orin Nano Developer Kit

Appreciate your sharing the link to build the kernel. Does one need to go through the entire set of steps to change just one of the kernel options? Can you elaborate on which step do I need to change the config for the line “CONFIG_USB_SERIAL_PL2303 is not set”? Thanks again for your help.

Appreciate the reply linuxdev. The output of lsusb is:
$ lsusb
Bus 002 Device 002: ID 0bda:0489 Realtek Semiconductor Corp. 4-Port USB 3.0 Hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 13d3:3549 IMC Networks Bluetooth Radio
Bus 001 Device 007: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port / Mobile Action MA-8910P
Bus 001 Device 009: ID 1a86:55d3 QinHeng Electronics USB Single Serial
Bus 001 Device 008: ID 1a86:55d3 QinHeng Electronics USB Single Serial
Bus 001 Device 006: ID 214b:7250 Huasheng Electronics USB2.0 HUB
Bus 001 Device 010: ID 045e:028e Microsoft Corp. Xbox360 Controller
Bus 001 Device 004: ID 214b:7250 Huasheng Electronics USB2.0 HUB
Bus 001 Device 002: ID 0bda:5489 Realtek Semiconductor Corp. 4-Port USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The device currently giving me issues is: Bus 001 Device 007: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port / Mobile Action MA-8910P

On my linux machine where the device works as expected, I see the following driver (.ko) files:
/lib/modules/5.15.0-100-generic/kernel/drivers/usb/serial$ ls
aircable.ko io_ti.ko navman.ko ti_usb_3410_5052.ko
ark3116.ko ipaq.ko omninet.ko upd78f0730.ko
belkin_sa.ko ipw.ko opticon.ko usb_debug.ko
ch341.ko ir-usb.ko option.ko usbserial.ko
cp210x.ko iuu_phoenix.ko oti6858.ko usb-serial-simple.ko
cyberjack.ko keyspan.ko pl2303.ko usb_wwan.ko
cypress_m8.ko keyspan_pda.ko qcaux.ko visor.ko
digi_acceleport.ko kl5kusb105.ko qcserial.ko whiteheat.ko
empeg.ko kobil_sct.ko quatech2.ko wishbone-serial.ko
f81232.ko mct_u232.ko safe_serial.ko xr_serial.ko
f81534.ko metro-usb.ko sierra.ko xsens_mt.ko
ftdi_sio.ko mos7720.ko spcp8x5.ko
garmin_gps.ko mos7840.ko ssu100.ko
io_edgeport.ko mxuport.ko symbolserial.ko

So, the one I care about pl2303.ko exists there. However in the Jetson Nano Orin machine, I only see the following:
/lib/modules/5.15.122-tegra/kernel/drivers/usb/serial$ ls
cp210x.ko ftdi_sio.ko option.ko usbserial.ko usb_wwan.ko

The kernel versions seem are different between those right (5.15.0-100-generic vs 5.15.122-tegra)? How do I build the kernel for the Jetson? Also, can you please elaborate on the steps you mentioned? Thanks a bunch.

Was trying to follow the instructions in the link you had mentioned. One of the first steps is to download the linux kernel for my L4T which is R36 I believe based on the following command output:
$ cat /etc/nv_tegra_release

R36 (release), REVISION: 2.0, GCID: 35084178, BOARD: generic, EABI: aarch64, DATE: Tue Dec 19 05:55:03 UTC 2023



But when I look at the downloads page (https://developer.nvidia.com/embedded/downloads#?search=linux%20driver), the latest version I found was 35.1. Any ideas?

Never mind- found it in the archives here: https://developer.nvidia.com/downloads/embedded/l4t/r36_release_v2.0/release/jetson_linux_r36.2.0_aarch64.tbz2

I was able to rebuild the kernel after much digging around. The right link to look through the instructions given my release tag was jetson_36.2 is available at: Kernel Customization — NVIDIA Jetson Linux Developer Guide 1 documentation

The problem now is that I don’t know what to change in order to build the required driver (pl2303.ko). I see that the source files (pl2303.c and pl2303.h) are present in the <install_path>/Linux_for_Tegra/source/kernel/kernel-jammy-src/drivers/usb/serial directory, but when I rebuild the kernel, only the current configuration of drivers gets rebuilt. I tried exporting a environment variable CONFIG_USB_SERIAL_PL2303=m, but that didn’t help. What should I do to include the build of this driver? Alternatively, as @linuxdev suggested, how can I just make the particular driver and not everything. Any advice will be appreciated.

It seems you are using Orin Nano rather than Jetson Nano.
I’ve moved your topic to correct category.

For Orin Nano with JP6 release, please refer to Kernel Customization — NVIDIA Jetson Linux Developer Guide 1 documentation.

Do you add “CONFIG_USB_SERIAL_PL2303=y” in defconfig?

That did it- thanks so much @KevinFFF :) Updated defconfig under Linux_for_Tegra/source/kernel/kernel-jammy-src/arch/arm64/configs as specified, rebuild the kernel and now the chip/driver is being recognized and installed as expected.

And yes, I had mentioned Jetson Orin Nano in my post but the topic was wrongly classified.

Your prompt and helpful replies are much appreciated @KevinFFF and @linuxdev

Yes, that is the missing module. It’s only a single file with a .ko suffix in the name. No need to reinstall everything. Because your Jetson is 5.15.122-tegra, the implication is that your kernel source was compiled with CONFIG_LOCALVERSION set to “-tegra”, whereas your other computer was compiled with a CONFIG_LOCALVERSION of “-generic”. The other computer used source code version 5.15.0-100 (which is a patched 5.15.0), but your Jetson is running NVIDIA’s 5.15.122. The shorter answer is that you need to compile against NVIDIA’s 5.15.122 after configuring the same configuration that currently runs, and after setting CONFIG_LOCALVERSION to “-tegra”. That usually means:

  1. Build the tegra_defconfig target.
  2. Set CONFIG_LOCALVERSION to “-tegra”.
  3. Find the pl2303 driver symbol, and enable that in a config editor (such as menuconfig or nconfig) as a module (with the “m” key, not integrated).
  4. Since you are only building a module, propagate the config, e.g., with target “modules_prepare”.
  5. Build modules. That gives you the .ko file.
  6. Copy that file to the same subdirectory of the Jetson’s “/lib/modules/$(uname -r)/kernel/” where the .ko. file is found in the built kernel source.
  7. Run sudo depmod -a. Possibly reboot.
  8. Smile, test it out!

Your L4T version can be found with “head -n 1 /etc/nv_tegra_release”. Go to the correct release to get the source:

Note that the kernel source is a package within a package. So you don’t need to extract everything, just extract the kernel source package, and then unpack that for the build.

Incidentally, if you’ve set up all other configuration correctly on the kernel, e.g., you’ve set CONFIG_LOCALVERSION correctly, and have perhaps run the build target tegra_defconfig, then the build target nconfig will bring up a configuration editor. That editor has a symbol search function. You could search for pl2303 and it would show you where that symbol exists. You would then go there and activate the feature as a module with the ‘m’ key. Then you would propagate the config with the modules_prepare target, which allows you to build modules (if you’ve built the Image target, then you don’t need modules_prepare).

That builds all modules, but this is a good acid test. You only need to copy the one .ko file to the correct location to install it. Probably running “sudo depmod -a” will tell the kernel it is there, and you could then use it (a USB device might require unplug/replug, or reboot).

Fantastic information and instructions. Thanks so much @linuxdev . I got the .ko file copied over, reinserted the usb cable and voila, it was being assisgned the USB port (ttyUSB0) as expected. Everything works!
Your help is much appreciated.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.