What it comes down to is that you only need a driver, and the driver can be built as a module while leaving the kernel itself alone (this is what @mashash is giving information for, I am just adding information in case you want to understand the process). If you have configured a kernel source tree to match the running system (get that from the system’s “/proc/config.gz”), and then added that module (e.g., via “make nconfig”…which requires package “libncurses5-dev”…“sudo apt-get install libncurses5-dev”), his command will build just the driver. Assuming you are natively on the Jetson doing the build and have set the CONFIG_LOCALVERSION, then the “modules_install” step will also put the module in place.
Official documents show how to cross compile which also works, but requires you to manually copy the driver module to the Jetson (plus requires installing the cross compile tools). FYI, the downloads URL for a particular L4T release (found with “head -n 1 /etc/nv_tegra_release”) has a “driver package”, and the driver package (not to be confused with kernel drivers…it is a host side flash driver) is downloaded by JetPack if you’ve ever flashed with JetPack. You’d always use the same “driver package” as what is flashed to the Jetson (this is the version from the previously mentioned “head -n 1 /etc/nv_tegra_release”). You can see a list of driver packages here (you may need to go here, log in, and then go here again before it shows the releases):
(btw, that listing has an error…R28.2 works on the TX1 and so you might have R28.2, but it wasn’t listed as a TX1 release)
Within the driver package (which unpacks to a “Linux_for_Tegra/” subdirectory) is file “source_sync.sh”. This file can be used to download the right kernel version, and this script works from any Linux system…including the Jetson. If you copy this script to a TX1, and as an example if your L4T release is R28.2, then this would get the right kernel source:
./source_sync.sh -k tegra-l4t-r28.2
A complete list of native kernel build instructions are here, but you only need the “make modules_prepare” and “make modules” command…or you can use the command given by @mashash (which is simpler, but you’d still want to use the source_sync.sh step to get kernel source). I give the rest of this information in case you want to understand a full kernel build:
You should not need to “flash” anything, nor should you need to replace the kernel itself (the “/boot/Image” file).
Btw, if you were to manually copy the kernel module, the procedure would go something like this:
- Determine the output of "uname -r". I'll assume "4.4.38-tegra".
- sudo -s # You need to be root to do this.
- cd /lib/modules/4.4.38-tegra/kernel/
- Determine where the module is in the kernel source. I'll use the example:
drivers/usb/serial/ # This will have the cp210x* files, and resulting cp210x.ko module.
- You're already at the base of this in the modules directory, so:
cp /where/ever/it/is/cp210x.ko .
depmod -a # Or you could just reboot.
Your ttyUSB should now show up.