Linux CAN bus: Difference between revisions

From Variscite Wiki
No edit summary
No edit summary
Line 22: Line 22:
  # cansend can0 500#1E.10.10
  # cansend can0 500#1E.10.10


 
{{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M-PLUS |
 
For DART-MX8M-PLUS SoMs, the reference interface is can2 instead of can0.
|}}


{{#ifexpr: {{#var:YOCTO_VERSION}} > 3.0 |
{{#ifexpr: {{#var:YOCTO_VERSION}} > 3.0 |

Revision as of 12:47, 9 February 2022

CAN bus

Connect two boards like the following:

Board A   Board B

 CAN_H --- CAN_H
 CAN_L --- CAN_L
  GND ----- GND

Set up the boards by running the following on each of them:

# ip link set can0 up type can bitrate 125000

Then:
On board A:

# candump can0

On board B:

# cansend can0 500#1E.10.10