VAR-SOM-AM43 Can-bus: Difference between revisions

From Variscite Wiki
No edit summary
Line 1: Line 1:
{{PageHeader|VAR-SOM-AM43 - CAN Bus}} {{DocImage|category1=VAR-SOM-AM43|category2=Yocto}} __toc__
{{PageHeader|VAR-SOM-AM43 - CAN Bus}} {{DocImage|category1=VAR-SOM-AM43|category2=Yocto}} __toc__
 
The AM43 DVK exports two CAN Bus interfaces can0 & can1
*Connect CANL, CANH and GND pins of two VAR-SOM-AM43 boards (located on J17).
For testing CAN Bus:
*Power-up both boards.
*Short CANL, CANH and GND pins of the 2 CAN Bus interfaces CAN0, CAN1 (located on J11).
*Type the following into the shell of both boards for configuration the CAN bus device:
*Type the following into the shell for configuring both CAN bus interfaces:
<pre>$ ip link set can0 type can bitrate 50000 triple-sampling on
<pre>$ ip link set can0 type can bitrate 50000 triple-sampling on
$ ip link set can0 up
$ ip link set can0 up
$ ip link set can1 type can bitrate 50000 triple-sampling on
$ ip link set can1 up
</pre>
</pre>
*Type the following to the shell of board 1 (which is used for testing receiving over can0 device):
*Type the following to the shell for testing receiving over can0 interface):
<pre>$ candump can0
<pre>$ candump can0 &
</pre>
</pre>
*Type the following to the shell of board 2 (which is used for testing sending data packets over can0 device):
*Type the following to the shell for testing sending data packets over can1 interface):
<pre>$ cansend can0 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88</pre>
<pre>$ cansend can1 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88</pre>
*At this point, board 1 will receive the data packet sent from board 2:
*At this point, can0 interface will receive the data packet sent from can1 interface:
<pre><0x001> [8] 11 22 33 44 55 66 77 88
<pre><0x001> [8] 11 22 33 44 55 66 77 88
</pre>
</pre>

Revision as of 14:50, 24 December 2015

VAR-SOM-AM43 - CAN Bus

The AM43 DVK exports two CAN Bus interfaces can0 & can1 For testing CAN Bus:

  • Short CANL, CANH and GND pins of the 2 CAN Bus interfaces CAN0, CAN1 (located on J11).
  • Type the following into the shell for configuring both CAN bus interfaces:
$ ip link set can0 type can bitrate 50000 triple-sampling on
$ ip link set can0 up
$ ip link set can1 type can bitrate 50000 triple-sampling on
$ ip link set can1 up
  • Type the following to the shell for testing receiving over can0 interface):
$ candump can0 &
  • Type the following to the shell for testing sending data packets over can1 interface):
$ cansend can1 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
  • At this point, can0 interface will receive the data packet sent from can1 interface:
<0x001> [8] 11 22 33 44 55 66 77 88