TX2 CAN bus can't work

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.

Hi,

Can you check if the transceiver is having a lose connection or so?
Sometime back we fell into the same problem and it took time to find out the loose connection. And then fixing the connection with proper soldering helped to achieve CAN communication properly.

Also please re-check enabling CAN software in the kernel with below discussion threads.
https://devtalk.nvidia.com/default/topic/1006762/jetson-tx2/how-can-i-use-can-bus-in-tx2-/post/5178022/#5178022
https://devtalk.nvidia.com/default/topic/1025010/jetson-tx2/how-to-use-can-on-jetson-tx2-/post/5213792/#5213792

For connection reference, you may also look into the attachment.

Thanks & Regards,
Sandipan
JetsonTX2_CAN.png

hi spatra:
thanks for your replay,just as you said,it’s because transceiver lose connection,we mistook NXP TJA1050 as TI SN65HVD230,and gave a wrong 3.3V supply to NXP TJA1050,so it didn’t work.when we found this mistake and supply 5.Ov TO NXP TJA1050,then the TX2 CAN TX&RX success!

Hi ,

I have a transceiver AMIS-30663-D. I have connected pin 7 of J26 port as transmitter and pin 5 to the receiver. The DB9 connector of transceiver is connected to Vector Canalyser.
I am trying to send messages
$cansend can0 123#abcdabcd

But I am unable to receive it on the Canalyser.
It shows an error active status.
I have run the following commands before setting up CAN communication.

sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan
sudo ifconfig -a
sudo ifconfig can0 down
sudo ifconfig can1 down
sudo ip link set can0 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on
sudo ip link set up can0
sudo ifconfig can0 up
sudo ip link set can1 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on
sudo ip link set up can1
sudo ifconfig can1 up
sudo apt-get install can-utils
cansend can0 123#abcdabcd

Kindly help.