4.4 KiB
PCAN-USB Adapter Setup on Jetson Orin Nano
Hardware
- Board: NVIDIA Jetson Orin Nano Engineering Reference Developer Kit Super
- Hostname: mikkeli-orin-nano-2
- OS: Ubuntu 22.04.5 LTS (aarch64)
- Kernel: 5.15.148-tegra (L4T 36.4.4, JetPack r36.4)
- Adapter: PEAK-System PCAN-USB (ID
0c72:000c)
Onboard CAN
The Jetson Orin Nano has a built-in CAN controller:
- Interface:
can0 - Controller: MTTCan (
c310000.mttcan) — SoC peripheral at memory address0xc310000 - Driver:
mttcan(built into NVIDIA Tegra kernel) - Module:
can_dev - Clock: 50 MHz
- Status: Always present, currently DOWN
USB CAN Adapter — Initial Detection
Problem
The PCAN-USB adapter was physically connected and detected by the USB subsystem:
Bus 001 Device 005: ID 0c72:000c PEAK System PCAN-USB
But no CAN interface appeared. The mainline kernel driver peak_usb (which supports this device since kernel v3.4) was not compiled into this NVIDIA Tegra kernel.
Investigation
- Checked for the
peak_usbmodule — not present - Checked kernel config (
/boot/config-$(uname -r)) — not available (NVIDIA kernel) - Checked for kernel headers — none matched the
5.15.148-tegrakernel - The NVIDIA Tegra kernel from JetPack r36.4 (
repo.download.nvidia.com/jetson/t234) uses a custom versioning scheme and does not include PEAK's mainline drivers
Solution — Build PEAK's Proprietary Driver
Why PEAK's driver instead of mainline?
PEAK's mainline peak_usb driver would be the preferred approach (SocketCAN netdev, auto-loading, no rebuild needed on kernel updates). However, the NVIDIA Tegra kernel does not include it. PEAK's proprietary driver package can be built against any kernel that has headers available.
Step 1: Download PEAK Linux Driver Package
curl -L "https://www.peak-system.com/quick/PCAN-Linux-Driver" -o /tmp/pcan-driver.tar.gz
cd /tmp && tar -xzf pcan-driver.tar.gz
# Extracts to: /tmp/peak-linux-driver-9.2.0/
Step 2: Build with SocketCAN (netdev) Support
The PEAK driver defaults to chardev mode (character devices like /dev/pcanusb32). For standard SocketCAN tools (candump, ip link, etc.), we need netdev mode:
cd /tmp/peak-linux-driver-9.2.0/driver
sudo make clean
sudo make NET=NETDEV_SUPPORT all
Key output confirming netdev build:
CC [M] /tmp/peak-linux-driver-9.2.0/driver/src/pcan_netdev.o
LD [M] /tmp/peak-linux-driver-9.2.0/driver/pcan.ko
Step 3: Install the Module
cd /tmp/peak-linux-driver-9.2.0/driver
sudo cp pcan.ko /lib/modules/5.15.148-tegra/misc/pcan.ko
sudo depmod 5.15.148-tegra
Step 4: Load the Module
sudo modprobe -r pcan 2>/dev/null
sudo modprobe pcan
Result
$ ip link show type can
3: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
link/can
8: can1: <NOARP> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
link/can
can0= onboard MTTCancan1= PCAN-USB adapter
Step 5: Bring Up the Interface
sudo ip link set can1 up type can bitrate 500000
Step 6: Read CAN Traffic
sudo candump can1
Build Environment
- GCC: 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04.2)
- make: Available
- Kernel headers: Located at
/lib/modules/5.15.148-tegra/build - Driver version: PEAK Linux Driver 9.2.0
Important Notes
-
Out-of-tree module: This driver is built from PEAK's source against the running kernel. It will not survive a kernel update — you must rebuild after any kernel upgrade.
-
Netdev vs chardev: The PEAK driver defaults to chardev mode. For SocketCAN tools, you must build with
NET=NETDEV_SUPPORT. The chardev mode creates/dev/pcan*devices and requires PEAK's proprietary API. -
Blacklisting: The PEAK installer (
make install) blacklists the mainlinepeak_*drivers in/etc/modprobe.d/blacklist-peak.conf. Since the mainline drivers aren't available on this kernel anyway, this is harmless. -
Bitrate: The default CAN bitrate is 500 kbps. Adjust as needed for your car's bus (common values: 500000, 250000, 1000000).
-
Read-only use: For reading car CAN traffic without transmitting, you only need to bring the interface up. No special configuration is needed.
Cleanup
Source files left at /tmp/peak-linux-driver-9.2.0/ and /tmp/pcan-driver.tar.gz. Can be removed after verifying everything works.