linuxcan installation on TX1


I’m installing linuxcan for Kvaser Leaf Light V2 on Jetpack 3.1 Ubuntu. It got built fine. But I got error when installing it,

nvidia@tegra-ubuntu:/media/nvidia/SD32G/sw/linuxcan$ sudo make installInstalling common
Installing leaf
install: failed to access ‘/lib/modules/4.4.38-tegra/kernel/drivers/usb/misc/leaf.ko’: Not a directory
Makefile:119: recipe for target ‘install’ failed
make: *** [install] Error 1

On TX1, usb/misc is a file, not a binary,
nvidia@tegra-ubuntu:/lib/modules/4.4.38-tegra/kernel/drivers/usb$ ll misc
-rw-r–r-- 1 root root 968400 Nov 17 18:26 misc

On my Ubuntu 16.04 PC, usr/misc is a directory and I can install linuxcan without any issue.

Would you help?



Hi Steve,

I would suggest to use the below steps to setup CAN communication on your TX1/TX2 board.

Steps to enable and check CAN on Tegra:

  1. Enable kernel support for mttcan (Other required modules are already supported)

  2. Insert CAN BUS subsystem support module.
    modprobe can

  3. Insert Raw CAN protocol module (CAN-ID filtering)
    modprobe can_raw

  4. Real CAN interface support (for our case, it is: mttcan)
    modprobe mttcan (dependent module is can_dev: can driver with netlink support)

  5. CAN interface settings for both the controllers
    ip link set can0 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on
    ip link set up can0
    ip link set can1 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on
    ip link set up can1

  6. Installation of user app to check CAN communication
    sudo apt-get install can-utils

  7. Commands to run to check CAN packet send/receive
    broadcasting a can data packet:
    cansend <can_interface> <can_frame>
    e.g. cansend can0 123#abcdabcd

Receiving a can data packet:
candump can_interface
e.g. candump can1

Different tools (i.e. cangen, cangw etc) can be used for various filtering options.

  1. To check the interface statistics
    ip -details -statistics link show can0
    ip -details -statistics link show can1

Thanks & Regards,

Hi Sandipan,

Thanks for the detailed reply. I figured out how to run linuxcan. Basically I reinstalled JetPack 3.1 and make sure kernel header files are installed in /usr/src and /lib/modules properly. Then everything just works, thanks,