CAN communication error frames cumulatively affect the normal communication of CAN

Dear NVIDIA, hello, I use Jetson AGX Xavier to communicate through CAN and other peripherals, and after running the application using CAN communication for a period of time, it is easy to reproduce the CAN communication interruption, abnormal transmission and reception, and must reset the CAN function configuration to return to normal.

The following two screenshots show the state of dmesg when CAN is interrupted and when transmitting.


img_v2_3b93cd3b-224c-4730-85cb-b3707b6b77ag
The following is my configuration using CAN

  busybox devmem 0x0c303000 32 0x0000C400                                                                                                                             
  busybox devmem 0x0c303008 32 0x0000C458                                                                                                                             
  busybox devmem 0x0c303010 32 0x0000C400                                                                                                                             
  busybox devmem 0x0c303018 32 0x0000C458 
rmmod mttcan
rmmod can-dev
rmmod can-raw
rmmod can
modprobe can
modprobe can-raw
modprobe can-dev
modprobe mttcan
ip link set can0 down
ip link set can0 type can bitrate 250000 sjw 127 dbitrate 250000 dsjw 15 berr-reporting on fd on restart-ms 100
ip link set up can0

Can you give me some advice? Thank you.

Hi DreamLan,

Are you using the devkit or custom board for AGX Xavier?
What’s your Jetpack version in use?

Could you apply the following patch to verify?
MTTCAN on Orin NX issues - #22 by KevinFFF

@KevinFFF ,hello, I tested according to your patch, I put priv->ttcan->tx_object = 0; Put it in the mttcan_bus_off_restart function, I set the parameter restart-ms 10, when entering the buf_off state, 10ms can be restored, but packet loss may occur, can the MTTCAN driver not enter the buf_off state? That is, set priv->ttcan->tx_object = 0 before entering the buf_off; Is this okay?

It would enter BUS_OFF because there’s wrong packet transmit/receive.
The patch is used to help it could recover from BUS_OFF.
Maybe you should find the reason for causing the error. (the errors showed in your dmesg).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.