Enable CONFIG_USB_SERIAL_PL2303 on kernel
Issue Overview
Users are encountering difficulties with the Nvidia Jetson Orin Nano Dev board when attempting to establish serial communication through a USB to a motor driver. The primary issue arises when the USB device is connected; while it is recognized on a standard Linux x86 system, it fails to be assigned a ttyUSB port on the Jetson Orin Nano.
Symptoms and Errors
-
On the Linux machine, the
dmesg
output shows successful recognition of the USB device:usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=0 usb 1-7: Product: USB-Serial Controller usb 1-7: Manufacturer: Prolific Technology Inc. pl2303 converter now attached to ttyUSB0
-
Conversely, on the Jetson Orin Nano, the
dmesg
output only indicates a new USB device without assigning it to any ttyUSB port:usb 1-2.2.3: new full-speed USB device number 12 using tegra-xusb
Context
-
The issue occurs during the setup phase when users attempt to connect a Prolific Technology PL2303-based USB serial device.
-
The Jetson Orin Nano is running Jetpack version 6.0-b52 and has an ARM architecture.
Frequency and Impact
- This issue appears consistently when users attempt to connect the specific USB device, severely impacting their ability to communicate with hardware components that rely on serial communication.
Possible Causes
-
Kernel Configuration: The kernel configuration for
CONFIG_USB_SERIAL_PL2303
is not enabled (not set
), preventing the driver from being loaded. -
Driver Issues: The absence of the
pl2303.ko
module in the Jetson’s kernel modules directory indicates that the driver needed for this specific USB device is missing. -
Incompatibility: Differences in kernel versions between the Linux machine (5.15.0-100-generic) and the Jetson (5.15.122-tegra) may lead to incompatibility issues.
-
User Misconfiguration: Users may not be familiar with rebuilding kernel modules or configuring kernel options correctly.
Troubleshooting Steps, Solutions & Fixes
Step-by-Step Instructions
-
Verify Kernel Version:
- Check the current kernel version running on your Jetson Orin Nano:
uname -r
- Check the current kernel version running on your Jetson Orin Nano:
-
Check Current Kernel Configuration:
- Confirm that
CONFIG_USB_SERIAL_PL2303
is not set:zcat /proc/config.gz | grep CONFIG_USB_SERIAL_PL2303
- Confirm that
-
Download Kernel Source:
- Obtain the correct kernel source for your L4T version (R36):
cat /etc/nv_tegra_release
- Obtain the correct kernel source for your L4T version (R36):
-
Configure Kernel Options:
- Navigate to your kernel source directory and modify the
.config
file or usemenuconfig
ornconfig
tools to enableCONFIG_USB_SERIAL_PL2303
. - Set it as a module (
m
) or built-in (y
).
- Navigate to your kernel source directory and modify the
-
Build Kernel Module:
- Run the following commands to build only the necessary module:
make tegra_defconfig make menuconfig # Enable CONFIG_USB_SERIAL_PL2303 here make modules_prepare make M=drivers/usb/serial modules
- Run the following commands to build only the necessary module:
-
Install Module:
- Copy the resulting
.ko
file to the appropriate directory:sudo cp ./drivers/usb/serial/pl2303.ko /lib/modules/$(uname -r)/kernel/drivers/usb/serial/
- Copy the resulting
-
Update Module Dependencies:
- Run this command to refresh module dependencies:
sudo depmod -a
- Run this command to refresh module dependencies:
-
Reconnect Device:
- Unplug and replug your USB device or reboot your system.
-
Verify Device Recognition:
- Check if the device is now recognized by running:
dmesg --follow ls /dev/ttyUSB*
- Check if the device is now recognized by running:
Additional Resources
- For detailed instructions on building and customizing kernels for Nvidia devices, refer to the NVIDIA Jetson Linux Developer Guide.
Best Practices for Prevention
-
Regularly check for updates in Jetpack and L4T versions that may include necessary drivers.
-
Familiarize yourself with kernel configuration and building processes if working with custom hardware setups.
Unresolved Aspects
While users successfully rebuilt their kernels and enabled the pl2303 driver, further investigation may be required for those unfamiliar with Linux kernel compilation processes or who encounter additional errors during installation.