CAN error passive/Bus-off

How to recover from the CAN error passive / Bus off state in the CAN communication ? I received error like this ,
can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can promiscuity 0 minmtu 0 maxmtu 0
can state ERROR-PASSIVE (berr-counter tx 128 rx 0) restart-ms 0
bitrate 793650 sample-point 0.793
tq 20 prop-seg 24 phase-seg1 25 phase-seg2 13 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 50000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 1 1 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
16 2 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0

Hi swedhar10,

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

You could use the following command to re-load module.

$ sudo rmmod mttcan
$ sudo modprobe mttcan

Hi Kevin,
We are using devkit jetson agx orin
Jetpack version 5.1.1
Yes, I already removed the driver and tried again reloading. Same thing happens.
I went through some websites, it mention as
when REC value reaches 256 enter in to BUS OFF state so to recover from that 128 times 11 recessive bit needs to send for to recover, 128 is half of 256 where it will enter active fault state how to do this?
Please reply asap for my request.
Thank you in advance

Could you share the all command you use and the result you get from console?
It should recover after re-loading the driver.

May I know which website you are referring?

Yes Kevin , I will share the steps,
$ sudo busybox devmem 0x0c303000 32 0x0000C400 “/* pinmux can1_dout*/”
$ sudo busybox devmem 0x0c303008 32 0x0000C458 “/* pinmux can1_din*/”
$ sudo busybox devmem 0x0c303010 32 0x0000C400 “/* pinmux can0_dout*/”
$ sudo busybox devmem 0x0c303018 32 0x0000C458 “/* pinmux can0_din*/”
$ sudo apt-get install can-utils
$ sudo modprobe can
$ sudo modprobe can_raw
$ sudo modprobe mttcan
$ sudo ip link set can0 type can bitrate 900000
$ sudo ip link set can1 type can bitrate 900000
$ sudo ip link set up can0
$ sudo ip link set up can1
$ candump can1
$ cansend can0 123#abcdabcd

It won’t receive anything or sending. It throw a error as

can0: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10
link/can promiscuity 0 minmtu 0 maxmtu 0
can state BUS-OFF (berr-counter tx 248 rx 0) restart-ms 0
bitrate 125000 sample-point 0.875
tq 40 prop-seg 87 phase-seg1 87 phase-seg2 25 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 50000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 1 1 1 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
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

can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can promiscuity 0 minmtu 0 maxmtu 0
can state ERROR-PASSIVE (berr-counter tx 128 rx 0) restart-ms 0
bitrate 500000 sample-point 0.870
tq 20 prop-seg 43 phase-seg1 43 phase-seg2 13 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 50000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 1 1 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
16 2 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 1 0 0

website link:embedded - Recovery from CAN Bus-off State - Stack Overflow
They are mentioning like this,
so it means you need to wait for:

  • 128 occurrences of successful Data Frames or Error Frames.
  • Or simply 128 occurrences of 11 consecutive recessive bits.
    to recover from Bus-Off
    Many websites mentioning like this.
    How to do this and recover from the error?
    In nvidia forums they mention as reload the drivers, but I tried.
    Please help me on this.
    Thanks in advance

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

It seems you would like to send data from can0 to can1.

Could you also share your connection block diagram?
Do you use two CAN transceivers in your setup?

and the dmesg after you load the kernel modules.