Skip to content

Commit 78c948f

Browse files
committed
Update CAN bus usage. 1ebb7e1
1 parent 8152cfc commit 78c948f

7 files changed

Lines changed: 270 additions & 22 deletions

File tree

_sources/nvidia/advanced/canbus.rst.txt

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ Hardware Pinout
2727
Configuration
2828
-------------
2929

30-
1. Make the system update
30+
1. Install necessary packages
3131

3232
.. code-block:: bash
3333
3434
sudo apt update
35-
sudo apt upgrade
35+
sudo apt install iproute2 can-utils
3636
3737
2. Configure the bitrate for can0
3838

@@ -46,6 +46,12 @@ In this command, **bitrate** can be any valid CAN bitrate for stand CAN.
4646

4747
| 125000(125 Kbps), 250000(250 Kbps), 500000(500 Kbps) and 1000000(1Mbps) are supported bitrates for Tegra MTTCAN driver.
4848
| Any other bitrate is not validated on Tegra MTTCAN driver.
49+
50+
If you want to show more configuration usage:
51+
52+
.. code-block:: bash
53+
54+
ip link set can0 type can help
4955
5056
3. Turn on can0
5157

@@ -62,14 +68,51 @@ In this command, **bitrate** can be any valid CAN bitrate for stand CAN.
6268
Test
6369
----
6470

65-
1. To send CAN bus data out of can0:
71+
1. Connect CAN_H and CAN_L to other machines.
72+
73+
2. To receive CAN bus data from can0:
6674

6775
.. code-block:: bash
6876
6977
candump can0 -t A
7078
79+
3. To send CAN bus data out of can0:
80+
81+
.. code-block:: bash
82+
83+
cansend can0 123#1122334455667788
84+
85+
Loopback Test
86+
-------------
87+
88+
If you just want to self-test the CAN function:
89+
90+
1. Turn loopback on:
91+
92+
.. code-block:: bash
93+
94+
sudo ip link set can0 down
95+
sudo ip link set can0 type can loopback on
96+
sudo ip link set can0 type can bitrate 1000000
97+
sudo ip link set can0 up
98+
7199
2. To receive CAN bus data from can0:
72100

73101
.. code-block:: bash
74102
75-
cansend can0 123#1122334455667788
103+
candump can0 -t A
104+
105+
3. To send CAN bus data out of can0:
106+
107+
.. code-block:: bash
108+
109+
cansend can0 123#1122334455667788
110+
111+
4. Remember to turn loopback off
112+
113+
.. code-block:: bash
114+
115+
sudo ip link set can0 down
116+
sudo ip link set can0 type can loopback off
117+
sudo ip link set can0 type can bitrate 1000000
118+
sudo ip link set can0 up

_sources/roscube-pico/nvidia/advanced/canbus.rst.txt

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ Hardware Pinout
2727
Configuration
2828
-------------
2929

30-
1. Make the system update
30+
1. Install necessary packages
3131

3232
.. code-block:: bash
3333
3434
sudo apt update
35-
sudo apt upgrade
35+
sudo apt install iproute2 can-utils
3636
3737
2. Configure the bitrate for can0
3838

@@ -46,6 +46,12 @@ In this command, **bitrate** can be any valid CAN bitrate for stand CAN.
4646

4747
| 125000(125 Kbps), 250000(250 Kbps), 500000(500 Kbps) and 1000000(1Mbps) are supported bitrates for Tegra MTTCAN driver.
4848
| Any other bitrate is not validated on Tegra MTTCAN driver.
49+
50+
If you want to show more configuration usage:
51+
52+
.. code-block:: bash
53+
54+
ip link set can0 type can help
4955
5056
3. Turn on can0
5157

@@ -62,14 +68,51 @@ In this command, **bitrate** can be any valid CAN bitrate for stand CAN.
6268
Test
6369
----
6470

65-
1. To send CAN bus data out of can0:
71+
1. Connect CAN_H and CAN_L to other machines.
72+
73+
2. To receive CAN bus data from can0:
6674

6775
.. code-block:: bash
6876
6977
candump can0 -t A
7078
79+
3. To send CAN bus data out of can0:
80+
81+
.. code-block:: bash
82+
83+
cansend can0 123#1122334455667788
84+
85+
Loopback Test
86+
-------------
87+
88+
If you just want to self-test the CAN function:
89+
90+
1. Turn loopback on:
91+
92+
.. code-block:: bash
93+
94+
sudo ip link set can0 down
95+
sudo ip link set can0 type can loopback on
96+
sudo ip link set can0 type can bitrate 1000000
97+
sudo ip link set can0 up
98+
7199
2. To receive CAN bus data from can0:
72100

73101
.. code-block:: bash
74102
75-
cansend can0 123#1122334455667788
103+
candump can0 -t A
104+
105+
3. To send CAN bus data out of can0:
106+
107+
.. code-block:: bash
108+
109+
cansend can0 123#1122334455667788
110+
111+
4. Remember to turn loopback off
112+
113+
.. code-block:: bash
114+
115+
sudo ip link set can0 down
116+
sudo ip link set can0 type can loopback off
117+
sudo ip link set can0 type can bitrate 1000000
118+
sudo ip link set can0 up

_sources/roscube-x/nvidia/advanced/canbus.rst.txt

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ Hardware Pinout
2727
Configuration
2828
-------------
2929

30-
1. Make the system update
30+
1. Install necessary packages
3131

3232
.. code-block:: bash
3333
3434
sudo apt update
35-
sudo apt upgrade
35+
sudo apt install iproute2 can-utils
3636
3737
2. Configure the bitrate for can0
3838

@@ -46,6 +46,12 @@ In this command, **bitrate** can be any valid CAN bitrate for stand CAN.
4646

4747
| 125000(125 Kbps), 250000(250 Kbps), 500000(500 Kbps) and 1000000(1Mbps) are supported bitrates for Tegra MTTCAN driver.
4848
| Any other bitrate is not validated on Tegra MTTCAN driver.
49+
50+
If you want to show more configuration usage:
51+
52+
.. code-block:: bash
53+
54+
ip link set can0 type can help
4955
5056
3. Turn on can0
5157

@@ -62,14 +68,51 @@ In this command, **bitrate** can be any valid CAN bitrate for stand CAN.
6268
Test
6369
----
6470

65-
1. To send CAN bus data out of can0:
71+
1. Connect CAN_H and CAN_L to other machines.
72+
73+
2. To receive CAN bus data from can0:
6674

6775
.. code-block:: bash
6876
6977
candump can0 -t A
7078
79+
3. To send CAN bus data out of can0:
80+
81+
.. code-block:: bash
82+
83+
cansend can0 123#1122334455667788
84+
85+
Loopback Test
86+
-------------
87+
88+
If you just want to self-test the CAN function:
89+
90+
1. Turn loopback on:
91+
92+
.. code-block:: bash
93+
94+
sudo ip link set can0 down
95+
sudo ip link set can0 type can loopback on
96+
sudo ip link set can0 type can bitrate 1000000
97+
sudo ip link set can0 up
98+
7199
2. To receive CAN bus data from can0:
72100

73101
.. code-block:: bash
74102
75-
cansend can0 123#1122334455667788
103+
candump can0 -t A
104+
105+
3. To send CAN bus data out of can0:
106+
107+
.. code-block:: bash
108+
109+
cansend can0 123#1122334455667788
110+
111+
4. Remember to turn loopback off
112+
113+
.. code-block:: bash
114+
115+
sudo ip link set can0 down
116+
sudo ip link set can0 type can loopback off
117+
sudo ip link set can0 type can bitrate 1000000
118+
sudo ip link set can0 up

nvidia/advanced/canbus.html

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ <h2>Hardware Pinout<a class="headerlink" href="#hardware-pinout" title="Permalin
172172
<div class="section" id="configuration">
173173
<h2>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline"></a></h2>
174174
<ol class="arabic simple">
175-
<li><p>Make the system update</p></li>
175+
<li><p>Install necessary packages</p></li>
176176
</ol>
177177
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo apt update
178-
sudo apt upgrade
178+
sudo apt install iproute2 can-utils
179179
</pre></div>
180180
</div>
181181
<ol class="arabic simple" start="2">
@@ -192,6 +192,10 @@ <h2>Configuration<a class="headerlink" href="#configuration" title="Permalink to
192192
<div class="line">Any other bitrate is not validated on Tegra MTTCAN driver.</div>
193193
</div>
194194
</div>
195+
<p>If you want to show more configuration usage:</p>
196+
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>ip link <span class="nb">set</span> can0 <span class="nb">type</span> can <span class="nb">help</span>
197+
</pre></div>
198+
</div>
195199
<ol class="arabic simple" start="3">
196200
<li><p>Turn on can0</p></li>
197201
</ol>
@@ -206,17 +210,52 @@ <h2>Configuration<a class="headerlink" href="#configuration" title="Permalink to
206210
<div class="section" id="test">
207211
<h2>Test<a class="headerlink" href="#test" title="Permalink to this headline"></a></h2>
208212
<ol class="arabic simple">
209-
<li><p>To send CAN bus data out of can0:</p></li>
213+
<li><p>Connect CAN_H and CAN_L to other machines.</p></li>
214+
<li><p>To receive CAN bus data from can0:</p></li>
210215
</ol>
211216
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>candump can0 -t A
212217
</pre></div>
213218
</div>
219+
<ol class="arabic simple" start="3">
220+
<li><p>To send CAN bus data out of can0:</p></li>
221+
</ol>
222+
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>cansend can0 <span class="m">123</span><span class="c1">#1122334455667788</span>
223+
</pre></div>
224+
</div>
225+
</div>
226+
<div class="section" id="loopback-test">
227+
<h2>Loopback Test<a class="headerlink" href="#loopback-test" title="Permalink to this headline"></a></h2>
228+
<p>If you just want to self-test the CAN function:</p>
229+
<ol class="arabic simple">
230+
<li><p>Turn loopback on:</p></li>
231+
</ol>
232+
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo ip link <span class="nb">set</span> can0 down
233+
sudo ip link <span class="nb">set</span> can0 <span class="nb">type</span> can loopback on
234+
sudo ip link <span class="nb">set</span> can0 <span class="nb">type</span> can bitrate <span class="m">1000000</span>
235+
sudo ip link <span class="nb">set</span> can0 up
236+
</pre></div>
237+
</div>
214238
<ol class="arabic simple" start="2">
215239
<li><p>To receive CAN bus data from can0:</p></li>
216240
</ol>
241+
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>candump can0 -t A
242+
</pre></div>
243+
</div>
244+
<ol class="arabic simple" start="3">
245+
<li><p>To send CAN bus data out of can0:</p></li>
246+
</ol>
217247
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>cansend can0 <span class="m">123</span><span class="c1">#1122334455667788</span>
218248
</pre></div>
219249
</div>
250+
<ol class="arabic simple" start="4">
251+
<li><p>Remember to turn loopback off</p></li>
252+
</ol>
253+
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo ip link <span class="nb">set</span> can0 down
254+
sudo ip link <span class="nb">set</span> can0 <span class="nb">type</span> can loopback off
255+
sudo ip link <span class="nb">set</span> can0 <span class="nb">type</span> can bitrate <span class="m">1000000</span>
256+
sudo ip link <span class="nb">set</span> can0 up
257+
</pre></div>
258+
</div>
220259
</div>
221260
</div>
222261

0 commit comments

Comments
 (0)