TS-7680 CAN: Difference between revisions

From embeddedTS Manuals
(Created page with "The i.MX28 CPU has two FlexCAN ports that use the linux SocketCAN implementation. The ports can be set up and used with the following commands: <source lang="bash"> ip link s...")
 
(Added note on CAN_EN# pin)
Line 12: Line 12:
   can0  123  [4] DE AD BE EF
   can0  123  [4] DE AD BE EF
</source><br>
</source><br>
{{Note|The CAN_EN# signal is connected to a CPU DIO and is active low.  The pin is de-asserted until the TS systemd script runs and asserts the enable bit.  See the [[#DIO|DIO section]] for more information.}}




See the [http://developer.berlios.de/projects/socketcan/ SocketCAN] webpage for more information on utilizing SocketCAN.
See the [http://developer.berlios.de/projects/socketcan/ SocketCAN] webpage for more information on utilizing SocketCAN.

Revision as of 17:11, 17 March 2016

The i.MX28 CPU has two FlexCAN ports that use the linux SocketCAN implementation. The ports can be set up and used with the following commands:

ip link set can0 up type can bitrate 1000000
ip link set can1 up type can bitrate 1000000


At this point the ports can be used with standard SocketCAN libraries. In debian we provide cansend and candump to test the ports or as a simple packet send/recv tool. In order to test the two ports together, tie CAN_H of both CAN ports together, and do the same for CAN_L. Then use the following commands:

candump can0 &
cansend can1 123#DEADBEEF
#This command will return
  can0  123  [4] DE AD BE EF


Note: The CAN_EN# signal is connected to a CPU DIO and is active low. The pin is de-asserted until the TS systemd script runs and asserts the enable bit. See the DIO section for more information.


See the SocketCAN webpage for more information on utilizing SocketCAN.