TS-7670 CAN: Difference between revisions

From embeddedTS Manuals
(Created page with "The TS-7670 i.MX286 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"> ...")
 
(changed some formatting)
Line 6: Line 6:
ifconfig can0 up
ifconfig can0 up
ifconfig can1 up
ifconfig can1 up
</source>
</source><br>


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:
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:
Line 14: Line 14:
#This command will return
#This command will return
   can0  123  [4] DE AD BE EF
   can0  123  [4] DE AD BE EF
</source>
</source><br>


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 15:29, 3 October 2013

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

devmem 0x80018110 32 0x3ff5f5f
#Note that this is only necessary on the October 2, 2013 TS-7670 image.
modprobe flexcan
ifconfig can0 up
ifconfig can1 up


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


See the SocketCAN webpage for more information on utilizing SocketCAN.