TS-7600 CAN: Difference between revisions

From embeddedTS Manuals
(Created page with "The CPU brings out one CAN port compatible with the linux SocketCAN implementation. The ports can be set up and used with the following command: <source lang="bash"> ifconfig...")
 
(Reordered and updated send example to match generic section)
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
<source lang="bash">
<source lang="bash">
ifconfig can1 up
ifconfig can1 up
</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.  The following are some simple commands that can be used:
<source lang="bash">
candump can1
cansend can1 123#DEADBEEF
</source><br>
</source><br>


Line 22: Line 16:
</source><br>
</source><br>


See the [http://developer.berlios.de/projects/socketcan/ SocketCAN] webpage for more information on utilizing SocketCAN.
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. The following are some simple commands that can be used:
<source lang="bash">
candump can1
cansend can1 7Df#03010c
</source><br>

Latest revision as of 10:23, 20 July 2016

The CPU brings out one CAN port compatible with the linux SocketCAN implementation. The ports can be set up and used with the following command:

ifconfig can1 up


In order to set the baud rate of the CAN interface, the interface must first be brought down with:

ifconfig can1 down


At this point, the desired baud rate can be directly entered in to the file "/sys/devices/platform/FlexCAN.1/bitrate". For example, to set a baud rate of 750kHz on the interface:

ifconfig can1 down
echo 750000 > /sys/devices/platform/FlexCAN.1/bitrate
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. The following are some simple commands that can be used:

candump can1
cansend can1 7Df#03010c