Hello everyone,
I’m sharing a detailed procedure for integrating additional CAN-bus or CAN-FD interfaces on Nvidia Jetson platforms, focusing on my experience with JetPack 6.1.2. This guide should be helpful for anyone looking to add PEAK-System PCAN devices.
My Test Environment:
- Jetson Platform:
- Nvidia AGX Jetson running JetPack 6.1.2 w/ Advantech industrial PC MIC-733
- CAN Interfaces (PEAK-System Technik GmbH):
- PCAN-USB
- PCAN-USB FD
- PCAN-M.2
- PCAN-miniPCIe FD
My initial expectation was that these PEAK devices would be recognized out-of-the-box via SocketCAN in the mainline Linux kernel. However, on the Jetson platforms with JetPack 6.1.2, this wasn’t the case, since it is not mainline kernel.
Understanding PEAK Driver Options
For PEAK devices on Linux, you typically have two driver choices:
- CharCAN Driver: This is a proprietary driver from PEAK-System. It allows you to use their free tool, PCAN-View, for CAN communication and analysis.
- SocketCAN Driver: This driver integrates with the standard Linux SocketCAN framework. While it doesn’t support PCAN-View, it works seamlessly with a wide range of open-source SocketCAN-compatible tools (e.g., can-utils).
For my setup, I opted for the SocketCAN approach to leverage the existing Linux ecosystem.
Addressing the GCC Dependency
A crucial point I discovered during installation was a GCC version mismatch. The PEAK driver requires GCC 12 or newer, but JetPack 6.1.2 comes pre-installed with GCC 11.4.0. You’ll need to upgrade GCC first.
Step-by-Step Installation
- Verify and Install GCC 12: First, check your current GCC version:
$ gcc -v
If it’s not GCC 12 or newer, install it:
$ sudo apt install gcc-12
- Install the PEAK CharCAN Driver (Initial Setup): Begin by downloading the peak-linux-driver from the official PEAK website. Once downloaded, extract it:
$ tar -xzf peak-linux-driver-8.20.0.tar.gz
Then, navigate into the extracted directory and compile/install the driver. This will initially set up the CharCAN driver.
$ cd peak-linux-driver-X.Y.Z # Replace X.Y.Z with your driver version
$ sudo make
$ sudo make install
$ sudo modprobe pcan
$ cat /proc/pcan # Verify the driver is loaded
- Switch to SocketCAN Driver: If you prefer to use the SocketCAN interface (as I did), you’ll need to recompile the driver with SocketCAN support.
$ sudo rmmod pcan # Unload the CharCAN module first
$ make clean # Clean previous build artifacts
$ make NET=NETDEV_SUPPORT # Recompile with SocketCAN support
$ sudo make install
$ sudo modprobe pcan # Load the new SocketCAN module
$ cat /proc/pcan # Verify SocketCAN is active
Important: If you ever need to switch back to the proprietary CharCAN driver, you’ll have to repeat the full installation process from Step 2.
I hope this detailed guide helps others looking to add CAN capabilities to their Nvidia Jetson setups! Feel free to ask any questions.