hi all:
we use NVIDIA TX2 running L4T28.1,and add mttcan module, we test CAN by the following steps:
1.connect CAN transceiver(TI SN65HVD230) to TX2 Board J26
TX2–J26:
PIN FUNC
2 3.3V POWER
5 CAN0 RX
7 CAN0 TX
10 GND
11 GND
15 CAN1 RX
17 CAN1 TX
2.
sudo ip link set can0 type can bitrate 500000
sudo ip link set up can0
sudo ip link set can1 type can bitrate 500000
sudo ip link set up can1
ifconfig
sudo candump can0 &
sudo candump can1 &
sudo cansend can0 123#abcdabcd
sudo cansend can1 1F334455#1122334455667788
we found CAN did not work, and the can bus is off,this is the dmesg log:
nvidia@tegra-ubuntu:~$ sudo ip link set can0 type can bitrate 500000
nvidia@tegra-ubuntu:~$ sudo ip link set up can0
nvidia@tegra-ubuntu:~$ ifconfig
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING NOARP MTU:16 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:171
eth0 Link encap:Ethernet HWaddr 00:04:4b:8c:6b:2d
inet addr:192.168.86.99 Bcast:192.168.86.255 Mask:255.255.255.0
inet6 addr: fe80::8083:613:29f2:2b13/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:392 errors:0 dropped:0 overruns:0 frame:0
TX packets:441 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:33726 (33.7 KB) TX bytes:668513 (668.5 KB)
Interrupt:42
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:210 errors:0 dropped:0 overruns:0 frame:0
TX packets:210 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:15813 (15.8 KB) TX bytes:15813 (15.8 KB)
wlan0 Link encap:Ethernet HWaddr 00:04:4b:8c:6b:2b
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
nvidia@tegra-ubuntu:~$ sudo cansend can0 123#abcdabcd
nvidia@tegra-ubuntu:~$ ifconfig
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP NOARP MTU:16 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:24 (24.0 B) TX bytes:0 (0.0 B)
Interrupt:171
eth0 Link encap:Ethernet HWaddr 00:04:4b:8c:6b:2d
inet addr:192.168.86.99 Bcast:192.168.86.255 Mask:255.255.255.0
inet6 addr: fe80::8083:613:29f2:2b13/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:467 errors:0 dropped:0 overruns:0 frame:0
TX packets:481 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:40025 (40.0 KB) TX bytes:674408 (674.4 KB)
Interrupt:42
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:210 errors:0 dropped:0 overruns:0 frame:0
TX packets:210 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:15813 (15.8 KB) TX bytes:15813 (15.8 KB)
wlan0 Link encap:Ethernet HWaddr 00:04:4b:8c:6b:2b
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
nvidia@tegra-ubuntu:~$ sudo dmesg -c
[ 59.659198] mttcan c310000.mttcan can0: Bitrate set
[ 63.917779] mttcan_controller_config: ctrlmode 0
[ 63.922459] mttcan c310000.mttcan can0: Bitrate set
[ 74.525538] mttcan c310000.mttcan can0: entered error warning state
[ 74.531849] mttcan c310000.mttcan can0: entered error passive state
[ 74.538170] mttcan c310000.mttcan can0: bus-off
[ 74.542728] mttcan c310000.mttcan can0: entered bus off state
nvidia@tegra-ubuntu:~$ sudo ip -details -statistics link show can0
4: can0: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10
link/can promiscuity 0
can state BUS-OFF (berr-counter tx 248 rx 0) restart-ms 0
bitrate 500000 sample-point 0.875
tq 25 prop-seg 34 phase-seg1 35 phase-seg2 10 sjw 1
mttcan: tseg1 2…255 tseg2 0…127 sjw 1…127 brp 1…511 brp-inc 1
mttcan: dtseg1 1…31 dtseg2 0…15 dsjw 1…15 dbrp 1…15 dbrp-inc 1
clock 40000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 1 1 0
RX: bytes packets errors dropped overrun mcast
24 3 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
nvidia@tegra-ubuntu:~$
what’s wrong with the TX2 CAN? Any help would be appreciated.
