Problem with CAN on jetson tx2

Hello,

Been having problems trying to get CAN working on the Jetson tx2
It has been flashed with jetpack 3.3 and tegra18_defconfig includes CONFIG_MTTCAN = m.

The CAN transceivers used are mcp2561 and we have made sure that all the connections are not loose, and the pins are connected to the right place, following various diagrams seen in these forums in the past.

The commands we use to setup the CAN are:

sudo modprobe can
sudo modprobe can-raw
sudo modprobe mttcan

sudo ip link set can0 type can bitrate 500000 dbitrate 2000000 berr-reporting o$
sudo ip link set can1 type can bitrate 500000 dbitrate 2000000 berr-reporting o$
sudo ip link set up can0
sudo ip link set up can1

Everything looks fine at this point. can0 and can1 show up when we do ifconfig. However, when cansend can0 5A1#11.22.33 is run, this is the output on 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:72 Metric:1
RX packets:5 errors:2 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:40 (40.0 B) TX bytes:0 (0.0 B)
Interrupt:171

Candump does not have any output.

dmesg:

[ 1914.000250] mttcan c310000.mttcan can0: Bitrate set
[ 1914.034140] mttcan c320000.mttcan can1: Bitrate set
[ 1914.079463] mttcan_controller_config: ctrlmode 30
[ 1914.084294] mttcan c310000.mttcan can0: Bitrate set
[ 1914.117927] mttcan_controller_config: ctrlmode 30
[ 1914.122732] mttcan c320000.mttcan can1: Bitrate set
[ 1915.297722] mttcan c310000.mttcan can0: Bit0 Error Detected
[ 1915.303440] mttcan c310000.mttcan can0: IR 0x8000000 PSR 0x75d
[ 1915.309460] mttcan c310000.mttcan can0: entered error warning state
[ 1915.315893] mttcan c310000.mttcan can0: entered error passive state
[ 1915.322582] mttcan c310000.mttcan can0: entered bus off state
[ 1915.328609] mttcan c310000.mttcan can0: Bit0 Error Detected
[ 1915.334424] mttcan c310000.mttcan can0: IR 0xb800000 PSR 0x7e5

Also, when using the oscilloscope, the jetson is constantly outputting 3.3V through the Can TX pins, leading us to think that the messages are not even getting sent.

Is there anything we could do to solve this and get out jetson communicating through the can bus?

Hi ekuo1,

We even had the same setup and at first it was running into same failure.

After debugging it was found communicating fine with having same clock rates for both the nodes.
I would suggest you to please try with making the similar configuration.

Let us know if you still have problem.

Thanks & Regards,
Sandipan

Hi Sandipan,

We tried many bit rates for can0 and can1, and even connected two identical Jetsons with default settings via CAN, which should have the same clock rate at the hardware level. That was with and without the flexible data rates (fd flag), but the problem is still present.