Problem description
The setting method is as follows:
sudo busybox devmem 0x0c303018 w 0xc458
sudo busybox devmem 0x0c303010 w 0xc400
sudo busybox devmem 0x0c303008 w 0xc458
sudo busybox devmem 0x0c303000 w 0xc400
sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan
sudo ip link set can0 up type can bitrate 500000 dbitrate 1000000 berr-reporting on fd on
sudo ip link set can1 up type can bitrate 500000 dbitrate 1000000 berr-reporting on fd on
After an exception occurs during the transmission of data on Orin’s canbus (such as an exception caused by short circuiting can_h and can_l).
Set the restart ms to 100 (IP link set can0 type can bitrate 500000 restart-ms 100). The sending of can cannot be restored, but the receiving can be automatically restored.
After down and up, the sending of CAN cannot be restored, but the receiving can be restored.
After reloading the mttcan driver, receiving and sending can be restored.
err dmesg log
[ 186.258118] net can0: mttcan device registered (regs=000000008bb8ab7b, irq=14)
[ 186.291835] mttcan c310000.mttcan can0: Bitrate set
[ 186.291922] mttcan c310000.mttcan can0: Bitrate set
[ 186.291999] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
[ 222.951261] mttcan c310000.mttcan can0: Bit0 Error Detected
[ 222.957017] mttcan c310000.mttcan can0: IR 0x8000000 PSR 0x71d
[ 222.963028] mttcan c310000.mttcan can0: entered error warning state
[ 222.969471] mttcan c310000.mttcan can0: entered error passive state
[ 222.975927] mttcan c310000.mttcan can0: entered bus off state
[ 222.981830] mttcan c310000.mttcan can0: Bit0 Error Detected
[ 222.987560] mttcan c310000.mttcan can0: IR 0xb800000 PSR 0x7e5
[ 400.816856] mttcan c310000.mttcan can0: Bitrate set
[ 400.816941] mttcan c310000.mttcan can0: Bitrate set
[ 400.816949] mttcan c310000.mttcan can0: wait for bus off seq
[ 400.829018] mttcan c310000.mttcan can0: Bit0 Error Detected
[ 400.829061] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
[ 400.834776] mttcan c310000.mttcan can0: IR 0xa000000 PSR 0x70d
May I ask what solution is available for this situation? Thank you very much
If these suggestions don’t help and you want to report an issue to us, please attach the model, command/step, and the customized app (if any) with us to reproduce locally.
thansks, but what you said doesn’t match my question。
After comparing the mttcan driver for the 5.1.4 kernel, I modified it to be the same as the 5.1.4 driver.
canbus setting as follows:
sudo ip link set can0 type can bitrate 500000 restart-ms 100
sudo ip link set can0 up
However, After an exception occurs during the transmission of data on Orin’s canbus (such as an exception caused by short circuiting can_h and can_l). there may still be sending errors as follows:
ylx@ugv :/ opt/bsp/canfd$ cansend can0 123#23
write: No buffer space available
I add some log in the kernel. bit0 err and bus off–>start–>bit0 err:
if I add the setting as “sudo ip link set can0 txqueuelen 1000”. Canbus does not report an error of insufficient buffer. However, canbus still cannot send data.
I tried two methods as fllow:
1.I connected CAN1 and CAN2 for testing, but it still has the same error
2.I set the loopback on as fllow:
sudo ip link set can0 type can bitrate 500000 berr-reporting on restart-ms 100 loopback on
sudo ip link set can0 up
After short circuiting can_h and can_l, the kernel did not report any errors. it can send and receive normal. why?
I don’t want to loop back on.
My problem still hasn’t been solved。Perhaps my answer above was not expressed clearly。Let me rephrase it once again。
I tried two methods as fllow:
1.I try the loopback test like Jetson/L4T/peripheral/ - eLinux.org.
I connected CAN0 and CAN1 for testing, but it still has the same error。
After an exception occurs during the transmission of data on Orin’s canbus (such as an exception caused by short circuiting can_h and can_l). there may still be sending errors as follows:
ylx@ugv :/ opt/bsp/canfd$ cansend can0 123#23
write: No buffer space available
2.I set the loopback on as fllow:
sudo ip link set can0 type can bitrate 500000 berr-reporting on restart-ms 100 loopback on
sudo ip link set can0 up
After short circuiting can_h and can_l, the kernel did not report any errors. it can send and receive normal. why?
I don’t want to loop back on,this is not a routine operation.
I also tested the ORIN module with a new one, and the results were still the same。