Skip to content

Commit 810a54b

Browse files
committed
Add USB to Serial Drivers
1 parent 5c2d977 commit 810a54b

File tree

5 files changed

+105
-3
lines changed

5 files changed

+105
-3
lines changed

README.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,50 @@
11
# installACMModule
22
MIT License
33

4-
Copyright (c) 2017 Jetsonhacks
4+
Copyright (c) 2017-2018 Jetsonhacks
55

6+
There are scripts in this repository which install USB kernel modules which are not in the L4T 28.1 build. The modules:
7+
8+
<ul><li>cdc-acm</li>
9+
<li>cp210x</li>
10+
<li>ch341</li>
11+
</ul>
12+
13+
<h2>cdc-acm kernel module</h2>
614
Install the CDC ACM Module for the Jetson TX1 or Jetson TX2 Development Kit
715

8-
On the NVIDIA Jetson TX2 and Jetson TX1 Development Kits running L4T 28.1, this script adds a module for USB Host functions to support Communication Device Class (CDC) Abstract Control Module (ACM) USB Devices.
16+
This script adds a module for USB Host functions to support Communication Device Class (CDC) Abstract Control Module (ACM) USB Devices.
917

1018
Typically these USB devices report as ttyACM* (where * is an integer). ACM devices have a lineage that goes back to modems and other network types of devices. However, many USB devices (such as an Arduino) are implemented using this simple USB protocol. The stock L4T 28.1 kernel does not have a CDC ACM module built in to the kernel, or as a separate module. This script adds cdc-acm.ko as a module so that such devices can be accessed through ttyACM*.
1119

1220
To install:
1321

1422
$ sudo ./installCDCACM.sh
1523

16-
The script checks the version magic of the module and compares it to the kernel version running on the machine. If the two do not match, the user is asked if they still want to continue the installation. If the two match, the module is installed.
24+
<h2>cp210x USB to serial converter</h2>
25+
This script install the CP210x USB to serial converter module. There are several different types of USB to serial converters (FTDI is built into the L4T 28.1 kernel), the CP210x is used by devices such as the RP-LIDAR products
26+
27+
<h2>ch341</h2>
28+
This script install the CH-341 USB to serial converter module. There are several different types of USB to serial converters (FTDI is built into the L4T 28.1 kernel), this is the CH-341 which is used by many Arduino clones.
29+
30+
31+
<h2>Notes</h2>
32+
These scripts expect a stock kernel, kernel version 4.4.38-tegra
33+
34+
More than likely, you will need to replug the USB device for it to be detected properly after installing the kernel module.
35+
36+
These scripts check the version magic of the module and compares it to the kernel version running on the machine. If the two do not match, the user is asked if they still want to continue the installation. If the two match, the module is installed.
1737

1838
Note that on a version mismatch, the user can still install the module. However, some extra steps may be needed after the installation to get the module installed fully. The steps are not covered here, but should be readily available elsewhere.
1939

40+
These scripts are for L4T 28.1. L4T version 28.2 includes cp210x and cdc-acm modules.
41+
42+
<h2>Release Notes</h2>
43+
<em>February, 2018</em>
44+
Add cp210x and ch341 modules and install scripts
45+
46+
<em>November, 2017</em>
47+
Initial Release
48+
49+
2050

ch341.ko

282 KB
Binary file not shown.

cp210x.ko

328 KB
Binary file not shown.

installCH341.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
# Install the CH341 module
3+
# First, does the module version magic match the current kernel version?
4+
5+
MAGICVERSION=$(modinfo ch341.ko | grep vermagic)
6+
MODULEVERSION=$(echo $MAGICVERSION | cut -d " " -f 2)
7+
KERNELVERSION=$(uname -r)
8+
if [ "$MODULEVERSION" == "$KERNELVERSION" ]
9+
then
10+
echo "Kernel and Module Versions Match; Installing ..."
11+
else
12+
echo "The Kernel version does not match the Module Version"
13+
echo "Kernel Version: " $KERNELVERSION
14+
echo "Module Version: " $MODULEVERSION
15+
while true; do
16+
read -p "Would you still like to install the module? [Y/n] " response
17+
case $response in
18+
[Yy]* ) break ;;
19+
[Nn]* ) exit;;
20+
* ) echo "Please answer Yes or no. " ;;
21+
esac
22+
done
23+
# The module version did not match the kernel version, but user selected to install anyway
24+
echo "You may have to force the module to be inserted, i.e. "
25+
echo "$ sudo modprobe -f cp210x"
26+
fi
27+
# Install the ch341 module
28+
# Make sure that the drivers/usb/serial directory exists
29+
INSTALLDIRECTORY=/lib/modules/$(uname -r)/kernel/drivers/usb/serial
30+
sudo mkdir -p "$INSTALLDIRECTORY"
31+
# Then copy over the module file
32+
sudo cp -v ch341.ko $INSTALLDIRECTORY
33+
sudo depmod -a
34+
echo "Installed ch341 Module"
35+
36+

installCP210x.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
# Install the CP210x module
3+
# First, does the module version magic match the current kernel version?
4+
5+
MAGICVERSION=$(modinfo cp210x.ko | grep vermagic)
6+
MODULEVERSION=$(echo $MAGICVERSION | cut -d " " -f 2)
7+
KERNELVERSION=$(uname -r)
8+
if [ "$MODULEVERSION" == "$KERNELVERSION" ]
9+
then
10+
echo "Kernel and Module Versions Match; Installing ..."
11+
else
12+
echo "The Kernel version does not match the Module Version"
13+
echo "Kernel Version: " $KERNELVERSION
14+
echo "Module Version: " $MODULEVERSION
15+
while true; do
16+
read -p "Would you still like to install the module? [Y/n] " response
17+
case $response in
18+
[Yy]* ) break ;;
19+
[Nn]* ) exit;;
20+
* ) echo "Please answer Yes or no. " ;;
21+
esac
22+
done
23+
# The module version did not match the kernel version, but user selected to install anyway
24+
echo "You may have to force the module to be inserted, i.e. "
25+
echo "$ sudo modprobe -f cp210x"
26+
fi
27+
# Install the cp210x module
28+
# Make sure that the drivers/usb/serial directory exists
29+
INSTALLDIRECTORY=/lib/modules/$(uname -r)/kernel/drivers/usb/serial
30+
sudo mkdir -p "$INSTALLDIRECTORY"
31+
# Then copy over the module file
32+
sudo cp -v cp210x.ko $INSTALLDIRECTORY
33+
sudo depmod -a
34+
echo "Installed cp210x Module"
35+
36+

0 commit comments

Comments
 (0)