[SOLVED] Unable to install CP210x drivers for USB serial communication on TX2 with Orbitty

Hi,

I’m using a Jetson TX2 in my laboratory with a ConnectTech Orbitty career board. I flashed it with ConnectTech’s BSP L4T 28.2 kernel version 4.4.38-tegra and then installed the necessary packages with Jetpack 3.2.1.

I am trying to interface this to an Arduino based board: TREX controller. Here is the description of my problems and the steps I have taken:

  1. When uploading a sketch from arduino IDE (on TX2), upload fails with following error:
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00

Also arduino board and the TREX board are recognized as ttyS0, instead of ttyACM or ttyUSB.

  1. To solve this, I tried to install the CP2102N USB drivers from https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers.

When I run the make command in the folder of the driver, I get this error:

make -C /lib/modules/`uname -r`/build M=/home/nvidia/Downloads/Linux_3.x.x_4.x.x_VCP_Driver_Source modules
make[1]: Entering directory '/usr/src/linux-headers-4.4.38-tegra'
  CC [M]  /home/nvidia/Downloads/Linux_3.x.x_4.x.x_VCP_Driver_Source/cp210x.o
<b>scripts/basic/fixdep: 1: scripts/basic/fixdep: Syntax error: "(" unexpected</b>
scripts/Makefile.build:267: recipe for target '/home/nvidia/Downloads/Linux_3.x.x_4.x.x_VCP_Driver_Source/cp210x.o' failed
make[2]: *** [/home/nvidia/Downloads/Linux_3.x.x_4.x.x_VCP_Driver_Source/cp210x.o] Error 2
Makefile:1414: recipe for target '_module_/home/nvidia/Downloads/Linux_3.x.x_4.x.x_VCP_Driver_Source' failed
make[1]: *** [_module_/home/nvidia/Downloads/Linux_3.x.x_4.x.x_VCP_Driver_Source] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.38-tegra'
Makefile:7: recipe for target 'all' failed
make: *** [all] Error 2

Although this looks like a syntax error, the following sources say that its due to some errors in kernel headers.

https://www.incentivespro.com/forum/viewtopic.php?t=214
https://github.com/thoughtpolice/enable_arm_pmu/issues/4

  1. According to their suggestion, I tried the following command:
cd /usr/src/linux-headers-4.4.38-tegra
sudo make modules_prepare

which fails with the error:

grep: scripts/../arch/x86/entry/syscalls/syscall_32.tbl: No such file or directory
  1. When I searched about that error, I found from NVIDIA forums that it occurs only if I try to cross compile from an x86 system. But I’m doing all this on the TX2 board itself.

https://devtalk.nvidia.com/default/topic/1027484/jetson-tx2/trying-to-build-a-module-with-no-luck/


I have another TX2 in the lab which is fitted with a larger (different) development board. I have no problem communicating with arduino from that.

Therefore, all I want is to communicate with my arduino. I have spent about 10 days trying to figure this out. Kernel modification is beyond my linux experience, but I now believe this is a problem due to the customized kernel released by ConnectTech for their Orbitty career board.

I would appreciate any kind help regarding any step of this problem. Thanks

I have no experience with Arduino or Orbitty, so this is just in hopes that it helps in some general way. Also, in my examples below I am using R28.2 which is a 4.x series Linux kernel. Your source appears to be for a 3.x series kernel, so it probably isn’t a valid mix. If it is the CP310 driver you want, then this doesn’t need out of tree build (details below) and probably isn’t needed at all for a recent version. You should mention which L4T release this is based on (see “head -n 1 /etc/nv_tegra_release”).

The use of the name ttyS0 versus ttyUSB0 versus ttyACM0 is a choice of editing the original ttyS0 name (which is the default) to become one of the others. This is done via udev renaming, so it implies udev has not been told to use one of the modified names.

By default earlier Jetsons required the end user to enable this (though I think in current releases this is probably already configured). If your release was from an earlier date, then ttyS0 isn’t your device. See what the result is from:

zcat /proc/config.gz | grep ACM

Earlier L4T releases did not configure this, but more recently (R28.2, but not sure when enable began by default) I see:

CONFIG_USB_ACM=y

You don’t need the build steps from below if this is already “=y”. You might need to adjust if it is there and shows as a tty notation other than what you want. I am not convinced that ttyS0 is actually the ACM serial UART (ttyS0 is almost always exclusively used for serial console).

About modules_prepare:

If you are building out of tree kernel source, then you’d do the modules_prepare before any actual build. Here is what I’d suggest (I don’t know if this is sufficient for your case, but you can always ask further questions):

  1. Copy "/proc/config.gz" to "/usr/src/linux-headers-4.4.38-tegra/".
  2. gunzip config.gz
  3. mv config.gz .config
  4. Edit CONFIG_LOCALVERSION of ".config". If "uname -r" is to be "4.4.38-tegra" (what do you see from "uname -r"?), then this must be "-tegra":
    CONFIG_LOCALVERSION="-tegra"
    
  5. make modules_prepare

You will probably need to be aware that the board support package for any particular carrier board is probably not valid on a different carrier board. Mostly this is due to the device tree and bootloader config. For a different carrier board you would probably have the BSP from the manufacturer of the carrier. Mostly the default L4T release would be the same with perhaps some tweaks to kernel, and definitely a lot of changes to the device tree. If the Jetson was previously mounted on a different model of carrier board, then it won’t work correctly (or at least completely) on the different carrier board. Have you used the Orbitty BSP?

Additional note on this error:

grep: scripts/../arch/x86/entry/syscalls/syscall_32.tbl: No such file or directory

…this error is unrelated to what you are doing and doesn’t do anything to stop the build. This is a desktop PC’s config and it isn’t present on arm64.

Thanks a lot for the detailed reply. Much appreciated.

  1. head -n 1 /etc/nv_tegra_release gives:
R28 (release), REVISION: 2.1, GCID: 11272647, BOARD: t186ref, EABI: aarch64, DATE: Thu May 17 07:29:06 UTC 2018
  1. zcat /proc/config.gz | grep ACM gives:
# CONFIG_FB_MACMODES is not set
# CONFIG_USB_ACM is not set
CONFIG_USB_F_ACM=y
CONFIG_USB_CONFIGFS_ACM=y
# CONFIG_USB_G_ACM_MS is not set
  1. uname -r gives: 4.4.38-tegra

  2. I am using Orbitty BSP for L4T 28.2 and higher. The TX2 was previously mounted on a different board, but I mounted it to the current Orbitty board and flashed it with Orbitty BSB’s L4T and then Jetpack 3.2.1 (without overwriting the BSP).

  3. After copying and applying gunzip on config.gz, I opened it and it contains:

CONFIG_LOCALVERSION="-tegra"
  1. The last error: I am running all these steps on this Jetson TX2, not on a desktop PC. But I am getting this error, when I try modules_prepare. Any idea why?

Should I manually edit the /proc/config.gz file and set CONFIG_USB_ACM=y also?

We solved the problem today. The BSB provided by orbitty had kernel headers conflicting with the nvidia kernel. Modifying the config file and building the kernel again helped.

Thanks a lot for your effort and time. :-)

Here’s the solution:

  1. Download drivers from here and extract them
    https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers
  2. Open a terminal as root (sudo su) and copy the kernal object file fromt the extracted folder to kernel modules:
cp cp210x.ko /lib/modules/`uname -r`/kernel/drivers/usb/serial
  1. Update the kernel module dependencies
depmod -a
cd /lib/modules/`uname -r`
man depmod