Linux CAN bus: Difference between revisions

From Variscite Wiki
No edit summary
No edit summary
Line 26: Line 26:
{{#ifexpr: {{#var:YOCTO_VERSION}} > 3.0 |
{{#ifexpr: {{#var:YOCTO_VERSION}} > 3.0 |
{{#switch: {{#var:HARDWARE_NAME}}
{{#switch: {{#var:HARDWARE_NAME}}
  | DART-MX8M-MINI   = '''Note''': For VAR-SOM-MX8M-MINI/NANO rev. 1.0/1.1/1.2, see: [[VAR-SOM-MX8M-MINI-CAN|VAR-SOM-MX8M-MINI/NANO rev. 1.0/1.1/1.2 CAN bus support]]
  | DART-MX8M-MINI
| VAR-SOM-MX8M-NANO
| VAR-SOM-MX8M-NANO = '''Note''': For VAR-SOM-MX8M-MINI/NANO rev. 1.0/1.1/1.2, see: [[VAR-SOM-MX8M-MINI-CAN|VAR-SOM-MX8M-MINI/NANO rev. 1.0/1.1/1.2 CAN bus support]]
  |
  |
}}
}}
|}}
|}}

Revision as of 16:48, 25 March 2021

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