Skip to Content
CAN XL · Linux

CAN XL is coming to Linux: driver development via SocketCAN

CAN XL on Linux with SocketCAN

The introduction of CAN XL (CAN with eXtended frame Length) is not limited to physical layer challenges. On Linux, CAN communication has for years been shaped by SocketCAN, the kernel's unified CAN networking framework — which is evolving once again to accommodate the new frame formats, timing parameters, and controller functions.

This article takes the perspective of driver development for CAN XL on Linux: how the existing SocketCAN concepts were extended, what challenges arise when moving from prototype to real hardware, and why driver configuration becomes central once CAN XL controllers and transceivers are no longer theoretical.

Extend CAN APIs and drivers for CAN XL

Extended CAN XL controllers and transceivers bring new functions and new constraints for the API to handle. New elements — the acceptance field (AF), the service data unit type (SDT), and virtual CAN network identifiers (VCID) — must be set and evaluated by the application. On the driver side, configuration options must be provided for the additional XL bit rate and the transceiver mode switch (TMS) for rates up to 20 Mbit/s. These extensions are designed so that users can reuse their existing knowledge of CAN and CAN FD configuration.

CAN XL development bench: PEAK interface, boards, and oscilloscope
The CAN XL development bench: PEAK interface, evaluation boards and oscilloscope.

From prototype to real hardware

Basic CAN XL support was introduced in Linux 6.1 in December 2022, providing the user API with all data structures and virtual CAN drivers. This enabled the development of tools to read, write, generate, or capture CAN XL traffic, as well as proof-of-concept implementations of the CiA 611-1, 611-2, and 613-3 protocols.

With the arrival of "real" CAN XL hardware, the question of specific driver configuration has gained importance. On the Linux side, an initial NXP proof of concept started as early as 2022 on a Terasic DE1-SOC FPGA board, running Ubuntu 16.04 with three BOSCH XCANB IP cores. Two boards were later ported to Ubuntu 22.04.4 LTS and the latest Linux Mainline kernel. Although this Linux 6.9 environment passed a CiA 613-3 integration test at a plug-fest in May 2024, CAN XL controller configuration still had to be fixed at compile time.

Oscilloscope measurement of a CAN XL frame
Oscilloscope measurement of a CAN XL frame in switched mode.

The PCAN-USB XL bundle marks the beginning

Driver configuration integration work was boosted by the April 2025 release of the all-in-one bundle for getting started with CAN XL: a new PCAN-USB XL interface bundled with the early access version of PCAN-Explorer 7 for Windows 11. This PCAN XL Starter Bundle not only delivered new CAN XL hardware for interoperability testing, but also user feedback on CAN XL usability and configuration on another operating system.

Mixed CAN CC / CAN FD / CAN XL mode
Mixed CAN CC / CAN FD / CAN XL mode operation on the same bus.

Easier onboarding with PCAN-Explorer 7

CAN CC/FD/XL bit rate settings — including compensation calculations for transmitter delay, error signaling, and PWM calculations in case of CAN XL transceiver mode switching — have proven very useful for understanding the real effects of the published ISO CAN standard. In addition to visualizing CAN XL configuration restrictions via the Bitrate Manager, PCAN-Explorer 7 provides access to all CAN XL-specific frame content, down to the SEC and RRS bits, which some competing tools do not display by default.

These interoperability tests provided early feedback to the developers of the PEAK Linux driver, who are involved in discussions on the Linux CAN XL configuration API. This helped define simple options that expose only the necessary settings and automatically derive certain controller options (e.g. error signaling). Since CAN XL driver configuration has been publicly available since Linux 6.19, it is only a matter of time before the PCAN-USB XL is supported in the Mainline kernel — offering a complete plug-and-play CAN XL solution with all compatible Linux tools, including Wireshark.

CAN XL configuration in PCAN-Explorer 7
CAN XL configuration and analysis in PCAN-Explorer 7.
Bitrate Manager for PCAN-Explorer 7
The Bitrate Manager visualizes the configuration restrictions of CAN XL bit rates.
CAN XL configuration options via SocketCAN
Simplified CAN XL configuration options on the Linux / SocketCAN driver side.

About SocketCAN

SocketCAN is the official CAN implementation in the Linux kernel. It provides a set of drivers and a network framework enabling CAN communication via the standard BSD socket API: CAN buses are treated as network interfaces, using familiar concepts rather than proprietary APIs. Contributed to the kernel in 2008, it has since been maintained by Dr. Oliver Hartkopp, who worked with CAN as early as 1996 at Bosch, then pioneered CAN support under Linux at Volkswagen (an open source project since 2006).

Neutralized