Changes between Version 5 and Version 6 of canbus
- Timestamp:
- 08/31/2018 12:51:15 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
canbus
v5 v6 51 51 52 52 53 [=#gateworks] 53 54 == Gateworks Hardware 54 55 The following Gateworks products have CAN: … … 68 69 69 70 71 [=#stby] 70 72 === CAN Transceiver STBY 71 73 For boards that have a CAN STBY signal connected to a GPIO, the signal must be driven high to enable CAN: … … 84 86 85 87 88 [=#software] 86 89 == Software 87 90 CAN bus is supported on the various BSP's supported by Gateworks. 88 91 89 Kernel Drivers: 90 * flexcan (Ventana / IMX6) 91 * mcp251x / spi-cavium / spi-cavium-thunderx (Newport / CN80XX) 92 93 Userspace: 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 95 96 97 === IMX6 Kernel drivers - SocketCAN 98 SocketCAN is a set of open source CAN drivers and a networking stack contributed by Volkswagon Research to the Linux kernel and was formerly known as Low Level CAN Framework (LLCF). 99 92 SocketCAN is a set of open source CAN drivers and a networking stack contributed to the Linux Kernel by Volkswagon Research to the Linux kernel and was formerly known as Low Level CAN Framework (LLCF). 93 94 The [https://github.com/linux-can/can-utils can-utils] project is a set of userspace community tools that are most commonly used with SocketCAN drivers for CAN over Linux. 95 96 97 [=#newport] 98 === Newport CAN Kernel drivers 99 The Newport product family uses the [http://dev.gateworks.com/datasheets/MCP25625.pdf MCP25625] CAN over SPI device. This is both a CAN controller as well as a CAN transceiver. Because this operates over the SPI bus, the '''spi-cavium''' and '''spi-cavium-thunderx''' kernel drivers are required as well as the '''mcp251x''' driver. Because the Thunderx SPI controller only supports half-duplex transactions patches are needed to the mcp251x driver which Gateworks has in its [https://github.com/Gateworks/linux-newport linux-newport] kernel repository: 100 - [https://github.com/Gateworks/linux-newport/commit/cb270339619ccf2b50dfd3604a03626f85830453 can: mcp251x: convert driver to half-duplex SPI] 101 - [https://github.com/Gateworks/linux-newport/commit/d67245936bf53b0e83831ae98931c7ce6a89f2d2 can: mpc251x: wait for chip to come out of reset] 102 - [https://github.com/Gateworks/linux-newport/commit/184249e625fcc99837e35df95de2624f91d23067 can: mcp251x: configure the interrupt type for level triggered] 103 104 105 [=#ventana] 106 === Ventana IMX6 Kernel drivers 100 107 The Freescale IMX6 FlexCAN module is a full implementation of the CAN protocol specification version 2.0 B which supports both standard and extended message frames. The '''flexcan''' driver source can be found at: 101 108 * [http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/net/can/flexcan.c mainline linux kernel] … … 122 129 * https://www.kernel.org/doc/Documentation/networking/can.txt - detailed socket API 123 130 124 === can-utils === 131 132 [=#canutils] 133 === can-utils 125 134 The can-utils package is a sub-project of the SocketCAN project and is the more popular and maintained set of userspace configuration tools for SocketCAN interfaces. 126 135 … … 128 137 129 138 Configure SocketCAN interface (using '''ip''' from the '''iproute2''' package) (for 250kbps in this example): 130 {{{ 139 {{{#!bash 131 140 ip link set can0 type can bitrate 250000 listen-only off 132 141 ip link set can0 up … … 134 143 135 144 Send a frame (consisting of 4 hex bytes to 0x100): 136 {{{ 145 {{{#!bash 137 146 cansend can0 100#11.22.33.44 138 147 }}} 139 148 140 149 Receive frames: 141 {{{ 150 {{{#!bash 142 151 candump can0 143 152 }}} 144 153 145 154 Example: 146 {{{ 155 {{{#!bash 147 156 root@ventana:~# candump can0 148 157 can0 1CFF0105 [7] 47 9F 10 00 00 00 00 … … 165 174 166 175 Notes: 167 * see #TransceiverSTBYabove to enable the SocketCAN transceiver176 * see [#STBY STBY] above to enable the SocketCAN transceiver 168 177 169 178 Reference: … … 171 180 172 181 182 [=#android] 173 183 === Android BSP 174 184 * Freescale has not released can-utils or userspace utilities for CAN in Android … … 189 199 190 200 201 [=#hardware] 191 202 = CAN Bus Hardware 192 203 204 [=#nmea2000] 193 205 == NMEA 2000 Equipment 194 206 Some examples of NMEA 2000 equipment we have tested our products with: … … 196 208 * [http://www.lowrance.com/en-US/Products/NMEA-2000/Point-1-en-us.aspx Lowrance POINT-1 GPS] - NMEA 2000 GPS (12V powered 250kbps bitrate) 197 209 210 198 211 == Chip-Level 199 212 An example chip that would interface to the Ventana board would be: … … 201 214 202 215 203 216 [=#apgdt002] 204 217 = CAN Bus Development Tools 205 218 - Microchip APGDT002 Can Bus Analyzer: