Changes between Version 3 and Version 4 of canbus


Ignore:
Timestamp:
08/31/2018 12:38:06 AM (15 months ago)
Author:
Tim Harvey
Comment:

added newport details

Legend:

Unmodified
Added
Removed
Modified
  • canbus

    v3 v4  
    11[[PageOutline]]
    22
    3 = Controller Area Network (CAN) Bus =
    4 Most boards in the Gateworks Ventana product family has one or more CAN bus interfaces. The CAN bus is popular in automotive, industrial, and marine applications where robust signaling is necessary in an electrically noisy environment.
     3= Controller Area Network (CAN) Bus
     4The CAN bus is popular in automotive, industrial, and marine applications where robust signaling is necessary in an electrically noisy environment.
    55
    66CAN bus is one of the five protocols used in the on-board diagnostics (OBD)-II vehicle diagnostics standard mandatory for all cards and light trucks sold in the US since 1996.
     
    88CAN bus was originated in 1983 at Bosch and was released in 1986 at the Society of Automotive Engineers (SAE). The first CAN controller chips were produced by Intel and Philips and came to market in 1987. The CAN 2.0 spec was published in 1991.
    99
    10 == Signalling and Termination ==
     10
     11== Signalling and Termination
    1112CAN is a form of multidrop serial communications using a differential signal making it suitable for noisy environments. As it is differential the bus is made of up two wires:
    1213 * CAN_H
     
    1718Typically a CAN bus network requires a single 120ohm termination resistor at each end of the bus (these are in parallel so a properly terminated bus should have a total resistance of 60 ohms). The maximum distance for any device from the bus is six meters.
    1819
    19 == Arbitration ==
     20
     21== Arbitration
    2022CAN bus arbitration happens when two or more ECUs (nodes) start to transmit at the same time. Every transmitter listens to the bus to ensure what it sent was what it received - if there is a difference than the CAN controller stops transmitting. The winner will always be the CAN messages with the lowest identifier.
    2123
    22 == Framing ==
     24
     25== Framing
    2326There are four different types of frames for communicating info and the state of the bus:
    2427 * Data frame (send data) - uses a header (identifier) of 29bits (CAN 2.0B) or 11bits (CAN 2.0A) followed by data (0 to 8 bytes in length)
     
    2730 * Overload frame (inserts a delay)
    2831
    29 == CAN FD spec ==
     32
     33== CAN FD spec
    3034The CAN FD spec was published in 2012 and specified an improved CAN data link layer protocol which extends the data section of the message from 8 bytes to 64 bytes per frame (not all devices support this).
    3135
    32 == Specifications and standards ==
     36
     37== Specifications and standards
    3338* [http://en.wikipedia.org/wiki/ISO_11898 ISO 11898-1 or ISOBUS] (2003) describes the CAN data link layer protocol
    3439* [http://en.wikipedia.org/wiki/SAE_J1939 SAE J1939] is a standard maintained by Society of Automotive Engineers (SAE) defining how information is transferred across a network to allow ECUs to communication information (a software specification that rides on top of a CAN bus). It uses CAN 2.0B and replaces J1587 and J1708. It is used on commercial vehicles (tractor/trailers, cement mixers, military trucks, etc). Paramter Group Number (PGN) indicates the message being sent.
    3540* [http://en.wikipedia.org/wiki/NMEA_2000 NMEA 2000] (aka NMEA2k or N2K) is compatible with CAN Bus and is used for connecting marine sensors and display units within ships and boards. It uses SAE J1939, runs at 250kbps and specifies a standardised !DeviceNet Micro-C M12 5-pin screw connector. Raymarine, !SeaTalk 2, Raymarine !SeaTalk, Simrad Simnet, Furuno CAN are rebranded imlementations of NMEA 2000 though may not use the standardized connectors.
    3641
    37 === SAE J1939 ===
     42
     43=== SAE J1939
    3844While not currently part of the Gateworks BSP's, there are various sources for a source-code level software stack for SAE J1939:
    3945 * [http://www.simmasoftware.com/j1939-software-faq.html Simma Software] - available for purchase / license
    4046 * [https://esd.eu/en/products/j1939-protocol-stack ESD Electronic system design] - available for purchase / license
    4147
    42 == CAN ID ==
     48
     49== CAN ID
    4350Devices on a CAN bus have a unique CAN ID which also defines the message priority. In the early 1990's the choice of IDs was done simply on the basis of identifying the type of data and the sending node but this has now changes where IDs are determined based on the deadline of the message (lower the number, higher the priority).
    4451
    45 == Gateworks Hardware ==
    46 Gateworks uses the [http://www.microchip.com/wwwproducts/en/MCP2562 MCP2562 Transceiver] chip from Microchip.
    47  * Note: There is an EEPROM bit that must be set for CAN to be enabled. This is already done by default on most boards. Please contact Gateworks support for any further questions.
    48 
    49 Boards that feature CAN Bus:
    50  * GW52xx
    51  * GW53xx
    52  * GW54xx
    53  * GW551x (*No Transceiver on GW5510, use with GW16111)
    54 To find which pins and which connectors have the CAN Bus signals, please refer to the [http://www.gateworks.com/usermanuals hardware user manuals]
    55 
    56  
    57 Boards that do not have CAN Bus:
    58  * GW552x
    59  * GW51xx
    60  * GW553x
    61  * GW2xxx
    62  
     52
     53== Gateworks Hardware
     54The following Gateworks products have CAN:
     55||= Family =||= Board =||= Device =||= Driver =||= STBY =||= Notes =||
     56|| Newport  || GW6404-B+ || [http://dev.gateworks.com/datasheets/MCP25625.pdf MCP25625] || mcp251x || N/A || ^^^1^^^ ||
     57||          || GW6304-E+ || [http://dev.gateworks.com/datasheets/MCP25625.pdf MCP25625] || mcp251x || N/A || ^^^1^^^ ||
     58||          || GW6204-B+ || [http://dev.gateworks.com/datasheets/MCP25625.pdf MCP25625] || mcp251x || N/A || ^^^1^^^ ||
     59|| ||
     60|| Ventana  || GW551x+GW16111 || IMX6 || flexcan || || ^^^2^^^ ||
     61||          || GW54xx    || IMX6 / [http://dev.gateworks.com/datasheets/MCP2562.pdf MCP2562] || flexcan || GPIO1_IO02 / gpio-2 || ||
     62||          || GW53xx    || IMX6 / [http://dev.gateworks.com/datasheets/MCP2562.pdf MCP2562] || flexcan || GPIO1_IO02 / gpio-2 || ||
     63||          || GW52xx    || IMX6 / [http://dev.gateworks.com/datasheets/MCP2562.pdf MCP2562] || flexcan || GPIO1_IO09 / gpio-9 || ||
     64 1. The Newport product family uses the MCP25625 CAN over SPI device thus the spi-cavium and spi-cavium-thunderx drivers are required as well. Because the Thunderx SPI controller only supports half-duplex transactions a patch is needed to the mcp251x driver. See [https://github.com/Gateworks/linux-newport/commit/cb270339619ccf2b50dfd3604a03626f85830453 commit-1], [https://github.com/Gateworks/linux-newport/commit/d67245936bf53b0e83831ae98931c7ce6a89f2d2 commit-2], [https://github.com/Gateworks/linux-newport/commit/184249e625fcc99837e35df95de2624f91d23067 commit-3]
     65 2. The GW551x does not have a transceiver on board; CAN_RXD / CAN_TXD go to application connector
     66
    6367CAN Bus can be found on the [http://www.gateworks.com/product/item/ventana-gw16113-expansion-adapter GW16113 Expansion card], but note this card will need to be custom programmed and does not have a transceiver.
    6468
    65 === CAN Transceiver STBY ===
    66 The STBY signal is connected to a GPIO on Ventana baseboards:
    67  * GW54xx/GW53xx: gpio-2
    68  * GW52xx: gpio-9
    69  * When using a 'device-tree' kernel such as the 3.10.x and beyond kernel under OpenWrt, you must manually enable the transceiver:
    70   * For example on a GW53xx/GW54xx:
     69
     70=== CAN Transceiver STBY
     71For boards that have a CAN STBY signal connected to a GPIO, the signal must be driven high to enable CAN:
     72 * For example on a GW53xx/GW54xx which use GPIO1_I02:
    7173{{{
    7274echo 2 > /sys/class/gpio/export
     
    7476echo 0 > /sys/class/gpio/gpio2/value
    7577}}}
    76   * For example on a GW52xx:
     78 * For example on a GW52xx which use GPIO1_IO09:
    7779{{{
    7880echo 9 > /sys/class/gpio/export
     
    8082echo 0 > /sys/class/gpio/gpio9/value
    8183}}}
    82   * This is done automatically when the transceiver interface is brought up in the 3.0.35 kernel used on Yocto v1.3 and Android BSP's
    83 
    84 == Software ==
    85 CAN bus is supported under Yocto, OpenWrt, and Android Board Support Packages for the Ventana product family.
    86 
    87 Software included in Gateworks BSP:
    88  * kernel driver: flexcan (a SocketCAN driver)
    89  * userspace:
    90   * can-utils (gitorious) - a set of the major community tools that are usually used and references (does not require libsocketcan to compile or run)
    91 
     84
     85
     86== Software
     87CAN bus is supported on the various BSP's supported by Gateworks.
     88
     89Kernel Drivers:
     90 * flexcan (Ventana / IMX6)
     91 * mcp251x / spi-cavium / spi-cavium-thunderx (Newport / CN80XX)
     92
     93Userspace:
     94 * [https://github.com/linux-can/can-utils can-utils] - a set of userspace community tools that are most commonly used for CAN over Linux (does not require libsocketcan to compile or run)
    9295
    9396Other Software: