The PEAK-System PC-CAN interfaces product family is fully operational with any Linux OS.
Many Linux distributions, or rather the used Linux Kernels, already contain the drivers for PEAK-System's CAN interfaces. The CAN interfaces are then accessed via the common SocketCAN framework as network devices (aka netdev).
If you are using Linux environments missing a driver (e.g. minimized Linux environments, older Kernels) or you want to use our character-based driver (chardev) e.g. in connection with the PCAN-Basic API, you need our PCAN Driver for Linux package and compile the driver yourself.
Open a terminal and type:
grep PEAK_ /boot/config-`uname -r`
All PEAK drivers are listed (y = included in kernel, m = separate module) but this may not work in every Linux environment.
Open a terminal and type:
lsmod | grep ^peak
If, for example, a USB-based CAN interface from PEAK is connected and initialized, the output will be at least one line starting with
peak_*mainline drivers you need.
peak_*mainline drivers that are out-of-date or might contain issues.
Since the CAN bus is a real-time network then it obviously may need of a real-time system. PEAK-System offers several solutions to support its interfaces in different real-time environments based on the Linux kernel.
As in the standard Linux environment, the choice of the solution depends on the desired application interface: in standard Linux, if the choice is made according to the chardev or netdev interface, in the real-time world, it is made according to the RTDM or RT-socket-CAN interface. Whatever the chosen interface, the PEAK-System software offer will provide an adapted solution. The table below summarizes this offer:
|RT extension||Linux-RT||Xenomai 3.1 (Mercury skin)||Xenomai 3.1 (Cobalt co-kernel)||RTAI 5.x|
|Driver API||chardev||netdev||See linux-rt||RTDM||RT-Socket-CAN||RTDM|
Linux-RT is the real-time version of the Linux Kernel that brought real-time facilities to the standard Kernel (see https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/). Applications don't care about it ; real-time is entirely handled by the patched Kernel.
Xenomai is a living project that regularly proposes real-time extensions to the various longterm Linux kernels, for different hardware architectures like ARM, PPC or x86 (see https://source.denx.de/Xenomai/xenomai/-/wikis/home).
Xenomai 3.1 Mercury is not supported here since it is a simple Xenomai interface (skin) to a Linux-RT patched Kernel.
Xenoma 3.1 Cobalt co-kernel is the hard real-time version of Xenomai. Like RTAI, it implements the Real Time Driver Model interface the RT version of the "pcan" driver supports when it is built with "make xeno". Xenomai 3.1 also includes the support of the real-time socket for the CAN bus (aka "RT-Socket-CAN"). With the driver "xeno_can_peak_pci", the RT-Socket-CAN core natively includes support of all the PCI/PCIe CAN 2.0 interfaces of PEAK-System. At the time this note is written (2021/05/06), the PCIe CAN FD interfaces are supported by the driver "xeno_can_peak_pciefd" from the git version of Xenomai (see https://xenomai.org/gitlab/xenomai), in CAN 2.0 mode *ONLY* (CAN FD is not yet supported by the RT-Socket-CAN core).
To take advantage of real-time under Xenomai, an application must be compiled and linked with the real-time libraries that offer access to the real-time facilities added by the Xenomai extension. That's the reason why the pcan library (which encapsulates the calls to the kernel entry points) must be compiled in real-time mode too.
Finally, as shown in the above table, RT-Socket-CAN is not supported by the "pcan" driver.
RTAI is another Linux kernel extension coming with user libraries and RTDM API that also supports different hardware architectures like ARM, PPC, x86 and m68k (see https://www.rtai.org/).
Unlike Xenomai, RTAI doesn't propose any native support of real-time CAN sockets. Therefore, the RTDM version of the "pcan" driver and its library (built with "make rtai") is the only way to take advantage of the benefits brought by real-time under RTAI when using the PC CAN interfaces of PEAK-System.
About RTAI 5.3 (release date: May 19, 2021): the x86 version of the base modules prevents the pcan driver to run correctly. This is a confirmed bug in RTAI 5.3 (only) that must be manually fixed until a new version of RTAI 5 is delivered:
We provide the PCAN-Basic API to allow the development of your own CAN applications for Linux. Programmers can use the languages C++, Java, and Python 3.x. More information about PCAN-Basic is available at its product web page.
System requirements: This API requires the chardev driver. Please use the Driver Package for Proprietary Purposes.
PCAN-View is a simple CAN monitor software for receiving and transmitting CAN and CAN FD messages. PCAN-View for Linux is based on the NCurses library.
System requirements: This software requires the chardev driver. Please use the Driver Package for Proprietary Purposes.
Installing software through repository needs first to register the repository only once. Next to the first installation of the software, there is nothing you have to do, except installing available updates when prompted by your system.
Download and install the following file
peak-system.list from the PEAK-System website:
$ wget -q http://www.peak-system.com/debian/dists/`lsb_release -cs`/peak-system.list -O- | sudo tee /etc/apt/sources.list.d/peak-system.list
Note: If the
lsb_release tool is not installed on your Linux system then replace
`lsb_release -cs` by the name of your Linux distribution. For example:
$ wget -q http://www.peak-system.com/debian/dists/wheezy/peak-system.list -O- | sudo tee /etc/apt/sources.list.d/peak-system.list
Then, download and install the PEAK-System public key for
apt-secure, so that the repository is trusted:
$ wget -q http://www.peak-system.com/debian/peak-system-public-key.asc -O- | sudo apt-key add -
pcanview-ncurses next, do:
$ sudo apt-get update
$ sudo apt-get install pcanview-ncurses
|Trusty 14.04 LTS|
|Xenial 16.04 LTS|
|Bionic 18.04 LTS|
|Focal 20.04 LTS|
|OpenSUSE Tumbleweed||see Xenial