Hi nvidia team:
I am using orin CAN for transfer data. Under normal circumstances, no problem.
But for fault-tolerant test, if I short-circuit CAN-H or CAN-L with GND, the controller switches to bus off and then tries to recover (dmesg wait for the bus off), If I remove the short circuit, messages can only be sent again when the driver has been removed and reloaded.
below is my config
sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan
sudo ip link set can0 type can bitrate 500000 restart-ms 5000
sudo ip link set can1 type can bitrate 500000 restart-ms 5000
sudo ip link set up can0
sudo ip link set up can1
Hi WayneWWW:
I add debug code ,and I am sure when dmesg out: mttcan c310000.mttcan can0: entered error warning state mttcan c310000.mttcan can0: entered error passive state mttcan c310000.mttcan can0: entered bus off state
and then bus off restart. mttcan_state_change
but when exec can_send next time. after some send messge ok.
than print write: No buffer space available.
and i read code locate to mttcan_start_xmit msg_no
[ 473.783686] mttcan c310000.mttcan can0: entered error warning state
[ 473.783936] mttcan c310000.mttcan can0: entered error passive state
[ 473.784671] mttcan c310000.mttcan can0: entered bus off state
[ 478.942215] mttcan_controller_config: ctrlmode 0
[ 478.942260] mttcan c310000.mttcan can0: Bitrate set
[ 478.942275] mttcan c310000.mttcan can0: wait for bus off seq
[ 479.815360] msg_no[0]
[ 480.818888] msg_no[1]
[ 481.822996] msg_no[-12]
root@mos:/home# ./test.sh
write: No buffer space available
write: No buffer space available
write: No buffer space available
write: No buffer space available
write: No buffer space available
root@mos:/home/file# ./can-mogo
error:: No buffer space available
error:: No buffer space available
error:: No buffer space available
root@mos:/home/file# dmesg -c
[ 627.330683] mttcan c310000.mttcan can0: Bitrate set
[ 627.335128] mttcan_controller_config: ctrlmode 0
[ 627.335149] mttcan c310000.mttcan can0: Bitrate set
[ 627.335718] msg_no[0]
[ 628.336198] msg_no[1]
[ 629.336671] msg_no[-12]
Hi i am dealing with the similar problem.
I want to recover from a state of bus off in can bus, by setting restart configuration, but it would restart only after electrical restart of the jetson.
as the pm wrote, i also use the sn65vhd25 can transiver.
its look like the driver not supporting the restart configuration or its not fully flushing all its data after setting the can interface down.
I use the same configuration over PeakCan usb interface and its works fine.
modprobe -r mttcan
modprobe mttcan
can return to noraml.
so I think look like what you say its not fully flushing all its data after setting the can interface down
You right, it should automatic recover, but for me its a progressive step, because until now i was restarting the jetson after each “bus-off” error.
This use case seems unreasonable to us. It would not be the normal use case with shorting and corrupting the CAN signal. Is there any reference or document for you with this test method?
I don’t work with SevenTian,but facing the same problem.
I am for Tolerance test .
Make a vision: in special circumstances, due to vibration the CAN_H short to GND, and the CAN can’t work,and must reboot,
is not a good solution.