Skip to content

Commit 1ebb7e1

Browse files
committed
Update CAN bus usage.
1 parent d948462 commit 1ebb7e1

1 file changed

Lines changed: 47 additions & 4 deletions

File tree

nvidia/advanced/canbus.rst

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

0 commit comments

Comments
 (0)