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
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
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
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);