Linux CAN bus: Difference between revisions

From Variscite Wiki
m (Eran moved page DART-6UL Can-bus to IMX Can-bus)
(Add template COMPAT_DEBIAN_LST_MODEL)
 
(21 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{PageHeader|CAN bus}}
<!-- Set release according to "release" parameter in URL and use RELEASE_DUNFELL_V1.0_VAR-SOM-MX6 as default
{{DocImage|category1=Yocto|category2=VAR-SOM-MX6}}[[Category:DART-6UL]] [[Category:VAR-SOM-MX7]]
--> {{INIT_RELEASE_PARAM|RELEASE_DUNFELL_V1.0_VAR-SOM-MX6}}<!--
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!--
--> {{#lst:B2QT_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!--
--> {{#lst:Debian_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!--
--> {{COMPAT_DEBIAN_LST_MODEL}} <!--
--> {{PageHeader|CAN bus}} {{DocImage|category1=Yocto|category2=Debian}}[[Category:Boot2Qt]][[Category:Android]][[Category:VAR-SOM-MX6]][[Category:DART-6UL]][[Category:VAR-SOM-MX7]][[Category:DART-MX8M]][[Category:DART-MX8M-MINI]][[Category:VAR-SOM-MX8M-NANO]][[Category:VAR-SOM-MX8X]][[Category:VAR-SOM-MX8]][[Category:DART-MX8M-PLUS]]


Starting Release 4 of Yocto, CAN bus is integrated into the system. No patch required.
Connect two boards like the following:<br>
<u>Board A</u>  <u>Board B</u>
  CAN_H --- CAN_H
  CAN_L --- CAN_L
  GND ----- GND


Connect 2 boards. Each board JP26 connect to the other with the right cable.<br>
Set up the boards by running the following on each of them:<br>  
# ip link set can0 up type can bitrate 125000


Set up the 2 boards by running on each of them:<br>  
Then:<br>
<pre>
On board A:<br>  
$ ip link set can0 up type can bitrate 125000
# candump can0
</pre>


On board #1:<br>  
On board B:<br>  
<pre>
# cansend can0 500#1E.10.10
$ cansniffer can0
</pre>


On board #2:<br>
{{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M-PLUS |
<pre>
'''Note''': For DART-MX8M-PLUS SoMs, the reference interface is can2 instead of can0.
$ cansend can0 500#1E.10.10
|}}
</pre>
 
{{#ifexpr: {{#var:YOCTO_VERSION}} > 3.0 |
{{#switch: {{#var:HARDWARE_NAME}}
| DART-MX8M-MINI
| 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]]
|
}}
|}}

Latest revision as of 21:56, 6 June 2023

Warning: This page is designed to be used with a 'release' URL parameter.

This page is using the default release RELEASE_DUNFELL_V1.0_VAR-SOM-MX6.
To view this page for a specific Variscite SoM and software release, please follow these steps:

  1. Visit variwiki.com
  2. Select your SoM
  3. Select the software release
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