Part Number: AM3352
Tool/software: Linux
I'm facing a issue with DCAN and Linux in bad network conditions. (long cables, poor connectors or terminator resistors). Usually with the auto-restart option on network subsystem on Linux, DCAN is able to restart CAN after a BUS-OFF automatically. But after some minutes or hours with toggling between ACTIVE, PASSIVE and BUS-OFF state, the CAN is stopped and doesn't communicate anymore. If I inspect the network subsystem, it looks like DCAN is in PASSIVE mode:
ip -details -statistics link show can0
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 50
link/can promiscuity 0
can <TRIPLE-SAMPLING> state ERROR-PASSIVE (berr-counter tx 248 rx 5) restart-ms 500
bitrate 250000 sample-point 0.875
tq 250 prop-seg 4 phase-seg1 9 phase-seg2 2 sjw 1
c_can: tseg1 2..16 tseg2 1..8 sjw 1..4 brp 1..1024 brp-inc 1
clock 24000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
123 0 0 131 135 123
RX: bytes packets errors dropped overrun mcast
342850 71830 1 0 1 0
TX: bytes packets errors dropped carrier collsns
30738 17049 0 1807 0 0
But the DCAN controller is in BUS-OFF state: (Error and Status Reg: 0x481D0004: 0x000000E4). In the CTRL register it is visible that the INIT flag is set (CTRL Reg 0x481D0000: 0x0000000F) I guess this is normal in BUSS-OFF conditions.
For me it looks somehow Linux miss an state change interrupt for BUS-OFF and thats why Linux doesn't restart CAN. But this is just an assumption.
Linux: ti-lsk-linux-4.1.y
Some hints would be appreciated!
Thanks
Anton