CANH and CANL were short connected, ORIN’s CAN reset failed

When CANH and CANL were short connected, ORIN’s CAN controller stopped working,it is the bus-off state.I use this instruction to initialize:
ip link set can0 up type can bitrate 500000 restart-ms 5000

When it is reset it does not work and error:
write: No buffer space available

I input:echo 1000 > /sys/class/net/can0/tx_queue_len
error disappear,but you still can’t use can0.
it is jetpack 5.0.2,Can you give me some advice? Thank you

Hi SevenTian,

Are you using the devkit or custom board for AGX Orin?

Could you move to latest JP5.1.1(R35.3.1) and give it a try?

thank you reply,i use custom board and my circuit design is the same as the official one.But I don’t have this problem with xavier using JP4.4, and I also have this problem with xavier using JP5.0.2

Why you write data to can2 instead of can0 here?

Have you tried to reproduce on the devkit?

Please provide the detailed reproduce steps for us to verify this use case.

sorry,
I typed wrong,it’s can0.

1.CANH and CANL were connected and add resistor
2.Run the script
#!/bin/sh
gnome-terminal – bash -c “candump -x any”

while true
do
cansend can0 011#1111111122222222
sleep 1
done

this is a normal result,the listening window can receive data sent by can0
3.Then keep CANH and CANL short for 20s to 30s,errors will occur:
titan@titan:./can0_1.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

this is log:

[ 145.559944] mttcan c310000.mttcan can0: entered error warning state
[ 145.560321] mttcan c310000.mttcan can0: entered error passive state
[ 145.561015] mttcan c310000.mttcan can0: entered bus off state
[ 150.752703] mttcan_controller_config: ctrlmode 0
[ 150.752790] mttcan c310000.mttcan can0: Bitrate set
[ 150.752861] mttcan c310000.mttcan can0: wait for bus off seq
[ 150.765323] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready

I don’t know why I can’t upload the file, so I can only describe the problem
i’msorry

JP4.4‘s xavier perform the preceding operations without any problem.

hi,KevinFFF,
I compared JP4.4 to modify kernel/nvidia/drivers/net/can/mttcan/native/m_ttcan_linux.c and there is no such error. I wonder if it will have any impact

  1. if (psr & MTT_PSR_BO_MASK) {
    /* Set state as Error Active after restart from BUS OFF /
    priv->can.state = CAN_STATE_ERROR_ACTIVE;
    } else if (psr & MTT_PSR_EP_MASK) {
    /
    Error Passive /
    priv->can.state = CAN_STATE_ERROR_PASSIVE;
    } else if (psr & MTT_PSR_EW_MASK) {
    /
    Error Warning /
    priv->can.state = CAN_STATE_ERROR_WARNING;
    } else {
    mttcan_controller_config(dev);//change
    ttcan_clear_intr(ttcan);//change
    ttcan_clear_tt_intr(ttcan);//change
    /
    Error Active */
    priv->can.state = CAN_STATE_ERROR_ACTIVE;
    }

    /* start Tx/Rx and enable protected mode */
    if (!priv->tt_param[0]) {
    ttcan_reset_init(ttcan);

2.if (ndev->flags & IFF_UP)
mttcan_start(ndev);
priv->can.state = CAN_STATE_ERROR_ACTIVE;//change
if (netif_running(ndev)) {
netif_device_attach(ndev);
netif_start_queue(ndev);
}

Hi Seven0,

I’ve checked this issue with internal.

This is unexpected use case for us. Please do not short CANH and CANL, and always connect CANH to CANH, CANL to CANL for can bus transmission.

You could transmit packet from CAN0 to CAN1 with CAN0 → Can Transceiver → Can Transceiver → CAN1. I’ve verified it would work on AGX Orin devkit with R35.3.1.
Just refer to the following instruction:
Controller Area Network (CAN) — Jetson Linux Developer Guide documentation (nvidia.com)

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