How to build Kvaser USB driver for Jetson TX2

According to https://elinux.org/CAN_Bus, the driver for Kvaser USB name is kvaser_usb. Jetson TX2 kernel does not include this driver, hence, it would not automatically recognize the device as CAN device though the “lsusb” still recognizes the device (the full Ubuntu desktop version can recognize this device as CAN device since it has the driver as mentioned). So after some investigation, I know that I need to install this driver/module somehow.

Information you may need:

  • Jetpack version.
    Type: head -n 1 /etc/nv_tegra_release
    Example output: # R28 (release), REVISION: 2.0, GCID: 10567845, BOARD: t186ref .... This indicates L4T 28.2 which is JetPack 3.2
  • By following JetsonHacks tutorial, you will need to get the kernel source. If your current Jetpack version does not match with the latest branch in JetsonHacks git, make sure to check out the branch version match with yours:
    For exampe: type git tag -l to get the list of version. vL4T28.2r3 is the latest revision for L4T28.2, so I checked out this version with git checkout vL4T28.2r3

JetsonHack video has full detail steps for the rest. Follow exact  here to build kernel and module:

Finding the Module

At the “Find” step, you need to look for “kvaser usb” then there will be option to select.

After module installation is finished and your TX2 is reboot successfully, you can check whether the driver kvaser_usb.ko exists at:

​/lib/modules/your-new-kernel-name/kernel/drivers/net/can/usb

(You can check prior to installation as well, kvaser_usb.ko should not be there. You can also check on your Ubuntu on PC, the PC version has more complete drivers and it should be there)

The case of Kvaser Mini PCI Express 2xHS (not v2)

This device is recognized as a USB feature. Therefore, they also use the ​kvaser_usb driver. However, at this moment, Jetpack 3.2 is at kernel 4.4 in the Linux source where the kvaser_usb driver does not include this device. My way of solving this is to still build the kvaser_usb driver anyways, then update the module with more recent update. More detail how to update can be found in this post:

https://devtalk.nvidia.com/default/topic/1044805/jetson-tx2/need-kvaser-driver-that-is-not-available-in-latest-source-kernel/

Finally

You can go ahead and set up SocketCAN with this through the steps here to test:

https://scratchrobotics.com/2018/07/28/how-to-setup-kvaser-on-linux-ubuntu/

Reference:

https://devtalk.nvidia.com/default/topic/860092/jetson-tk1/how-do-i-know-what-version-of-l4t-my-jetson-tk1-is-running-/
https://elinux.org/CAN_Bus
https://elinux.org/Bringing_CAN_interface_up
https://sgframework.readthedocs.io/en/latest/cantutorial.html
https://www.jetsonhacks.com/2017/07/31/build-kernel-ttyacm-module-nvidia-jetson-tx2/

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s