i.MX6 HummingBoard – CAN bus
CAN Bus is only supported on Hummingboard Edge/Gate/CBi and i.MX6 SOM Rev. v1.5 and higher.
Overview
A Controller Area Network (CAN bus) is a robust vehicle bus standard designed to allow microcontrollers and devices to communicate with each other in applications without a host computer. It is a message-based protocol, designed originally for multiplex electrical wiring within automobiles to save on copper, but is also used in many other contexts. (source http://wikipedia.com ).
Hardware Modification
Notes
Requires SOM rev 1.4 and newer
Requires HummingBoard Edge/Gate/CBi
Overlaps with HDMI connector CEC function. So only this or the HDMI connector can be assembled
In order to get the CAN bus up and running, following hardware modifications need to be done:
Disassemble D5 and the HDMI connector
Assemble:
R54
R53
C100
U10003 (CAN transceiver , for example TJA1050)
R55
L12
L13
C101
C102
L13
J28
Per the HummingBoard CBi schematics:HummingBoard CBi Quick Start Guide
Software Modification
Device Tree Changes
Edit following lines in the Device tree
Disable HDMI-CEC by setting status = “disabled” – in Github DeviceTree
Enable Flexcan1 in Github DeviceTree
(Re-)Compile DeviceTree
Generically speaking, the raw .dts files can be compiled into .dtb using the device-tree-compiler dtc. The most straightforward way to invoke it is by configuring the linux kernel tree, and then running
make dtbs
The kernel-tree needs to be configured first. Please refer to i.MX6 Kernel for generic instructions, or consult the distro documentation
DTB files can also be de- and recompiled. Consult the manpage of dtc for additional information.
(Re-)Compile Linux Kernel
Either recompile linux kernel with config :
CONFIG_CAN=y
CONFIG_CAN_RAW=y
CONFIG_CAN_DEV=y
CONFIG_CAN_FLEXCAN=y
or activate modules:
modprobe can
modprobe flexcan
modprobe can-dev
modprobe can-rawTest CanBUS
Enable device can0:
(ex:125000)
Checking:
The easiest way to test the CanBUS is to use the CAN-Utils, which are available for Debain/Ubuntu etc.
Example commands:
Sending:
receiving:
Related pages
SolidRun Ltd.