From: eLinux.org

CAN Bus

Contents

Overview

The CAN bus is an ISO standard bus originally developed for vehicles. It
manages the Chassis Electrical System Control and is responsible for
critical activities like engine electrical, and skid control. This
system is also used to provide vehicle diagnostic information for
maintenance. A multi-star configuration seems typical of this bus with a
primary bus line that branches into sub bus lines at its extremities
then attaches to multiple device nodes. Differential voltage is applied
over twisted pair at 1.5 to 2.5V and 2.5 to 3.5V for noise resistant
signaling. Bit rates up to 1 Mbit/s are possible at network lengths
below 40 m. Decreasing the bit rate allows longer network distances
(e.g., 500 m at 125 kbit/s). (Jeremiah J. Flerchinger
Source) Controllers supporting
CAN FD, an enhanced CAN version with frames up to 64 byte and bit rates
up to 4 Mbit/s, will be available in the second half of 2014. A
can4linux version supportig CAN FD on a IFI
CAN
is ready to be used.

Although developed as car communication network CAN is used in many
other areas, industrial, medical, maritime laboratory and more. Most
often with a CAN based higher layer protocol like
CANopen on top of it.

Additional information can be found at:

http://en.wikipedia.org/wiki/CAN_bus

SocketCAN News

CiA CAN in Automation CAN user association

CAN Wiki

CAN FD Specification Version
1.0

CAN Support in Linux

CAN is supported by Linux device drivers. Mainly two types exist.
Character device based drivers and network socket based drivers. The
Linux kernel supports CAN with the SocketCAN framework.

One of the character based drivers is can4linux.

SocketCAN Supported Protocols

  • RAW: send & receive raw CAN frames
  • BCM: Broadcast manager, offload repetitive work to the Linux kernel
  • ISOTP …
  • SAE J1939

SocketCAN Supported Controllers

  • Microchip MCP251x
  • Atmel AT91 SoCs
  • ESD 331 CAN Cards
  • NXP (Philips) SJA1000
  • Freescale MPC52xx SoCs
  • Bosch CC770
  • Intel AN82527
  • TIs SoCs
  • Serial/network devices utilizing ASCII protocol (slcan driver)














































































































































































VendorDevice NameDriver Module NameControllerKconfig OptionLinux MainlineRemarks
VScomNET-CANslcan(unknown)CONFIG_CAN_SLCAN2.6.38needs slcand and socat
VScomPCI-2CANslcan(unknown)CONFIG_CAN_SLCAN2.6.38needs slcand
VScomSER-CANslcan(unknown)CONFIG_CAN_SLCAN2.6.38needs slcand
VScomUSB-CANslcan(unknown)CONFIG_CAN_SLCAN2.6.38needs slcand
LAWICELCAN232slcan(unknown)CONFIG_CAN_SLCAN2.6.38needs slcand
LAWICELCANUSBslcan(unknown)CONFIG_CAN_SLCAN2.6.38needs slcand
PEAKPCAN-PCIpeak_pcisja1000CONFIG_CAN_PEAK_PCI3.2supports all PCAN-[mini]PCI[e][104] variants
PEAKPCAN-USBpeak_usb(unknown)CONFIG_CAN_PEAK_USB3.4supports PCAN-USB[pro][hub] (no LIN support)
KvaserPCIcanxkvaser_pcisja1000CONFIG_CAN_KVASER_PCI2.6.31supports all PCI-[mini]PCI[e][104] variants
KvaserLeafkvaser_usb(unknown)CONFIG_CAN_KVASER_USB3.8supports USB Leaf / Memorator / Blackbird / R (see detailed USB device IDs in kvaser_usb.c)
KvaserUSBCan-IIkvaser_usb(unknown)CONFIG_CAN_KVASER_USBcommits pulled-in for the 3.20 releasesupports:

  • Kvaser USBCan-II HS/LS

  • Kvaser USBCan-II HS/HS

  • Kvaser USBcan Rugged ("USBcan Rev B")

  • Kvaser Memorator HS/LS

  • Kvaser Memorator HS/HS

  • Scania VCI2 (if you have the Kvaser logo on top)

EMS WünscheCPC-Cardems_pcmciasja1000CONFIG_CAN_EMS_PCMCIA3.2discontinued
EMS WünscheCPC-USB/ARM7ems_usb(unknown)CONFIG_CAN_EMS_USB3.2
EMS WünscheCPC-PCI/PCIeems_pcisja1000CONFIG_CAN_EMS_PCI3.2up to four channel
EMS WünscheCPC-PC104Pems_pcisja1000CONFIG_CAN_EMS_PCI3.2up to four channel on a PC104+ board
8devicesUSB2CANusb_8dev(STR750FV2)CONFIG_CAN_8DEV_USB3.9STR750FV2 Firmware
SoftingCANcard2softing_cssja1000 or NEC-005(?)CONFIG_CAN_SOFTING_CS2.6.38Supports {CAN,EDIC}card{,SJA,2} PCMCIA cards

Needs firmware softing-fw-4.6-binaries.tar.gz

SocketCAN Support in Programming Languages/Environments

can4linux Supported Controllers

  • Allwinner A20 with integrated CAN (on
    the popular BananaPi single-board
    computer.)
  • Analog Devices BlackFin BF537
  • Atmel AT91 SoCs
  • Freescale FlexCAN (ColdFire 5282,
    i.MX25, i.MX28, i.MX35)
  • Intel 82527 (the replacement Bosch CC770 should work)
  • Microchip Stand Alone CAN MCP2515
  • NXP Stand Alone CAN
    SJA1000 (on
    different ISA or PCI/PCIe boards)
  • Xilinx
    Zynq with XCAN
  • ‘virtual’ CAN mode without CAN hardware
  • ‘virtual’ CAN mode supporting CAN
    FD
  • IFI CAN FPGA IP, in
    classic CAN mode and CAN FD mode

can4linux Support in Programming Languages/Environments

  • C - many examples and useful applications are provided with the
    package, check can4linux-examples/
  • Tcl/Tk
    also in can4linux-examples/
  • Python
    also in can4linux-examples/

CAN Controllers Emulation (WIP/experimental)

  • SJA1000 CAN controller based PCI board emulation for QEMU
    • Cards models provided:
      • Simple memory mapped SJA1000 in the first PCI BAR with
        ad-hoc PCI ID
      • Kvaser PCIcan-S single I/O mapped SJA1000 model compatible
        with kvaser_pci Linux driver on guest side
    • The emulated CAN buses can be connected to virtual or physical
      SocketCAN interface if Linux is used as host system
    • Project repository:
      https://github.com/CTU-IIG/qemu
    • Work started by 2013 GSoC project when RTEMS project donated its
      slot to work on QEMU CAN support - see RTEMS related
      page

      for more info and use instructions

SocketCAN Bechmarking

SocketCAN Tutorials

Category: