Jetson AGX Orin CANBus "No buffer space available" after 10 times sending

Hi, We using [ Jetson AGX Orin + SN65HVD230 CAN Board ], and we got problems when using can-utils to test and cannot continue to send commands.

There was a problem with testing using CLI commands: “cansend”, which could not be sent continuously. The maximum sending times is about 6 to 10.
After that the client cannot receive anything,and then after sending more 10 times, it shows “write: No buffer space available”. at the mean time, Although it cannot send, but it still can receive messages from others on canbus.
After this occurs, the interface needs to be reloaded (down and up) to recover.

== Display pins assignment ==
PIN#29: can0_din
PIN#31: can0_dout
PIN#33: can1_dout
PIN#37: can1_din

== Enable pins assignment ==
# sudo /opt/nvidia/jetson-io/jetson-io.py

== Display registers value ==
# 工具安裝: sudo apt-get install busybox
0x0c303018 value:0x0000C454
0x0c303010 value:0x0000C408
0x0c303008 value:0x0000C454
0x0c303000 value:0x0000C408

== Load the CAN kernel drivers ==
        RESULT: CAN kernel modules loaded
Module                  Size  Used by
mttcan                 65536  0
can_dev                32768  1 mttcan
can_bcm                28672  0
can_raw                28672  23
can                    28672  2 can_raw,can_bcm
== Interface up ==
        RESULT: (ifconfig)
can0: flags=193<UP,RUNNING,NOARP>  mtu 16
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 704609  bytes 5580946 (5.5 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 330  bytes 2516 (2.5 KB)
        TX errors 0  dropped 2 overruns 0  carrier 2  collisions 0
        device interrupt 14

can1: flags=193<UP,RUNNING,NOARP>  mtu 16
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 226  bytes 1808 (1.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 16 overruns 0  carrier 16  collisions 0
        device interrupt 15

== Interface details ==
sysadm@orin-02:/data_ds/src/robot/dev_tools/can-scripts$ ip -details link show can0
20: can0: <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-ACTIVE (berr-counter tx 0 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 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
sysadm@orin-02:/data_ds/src/robot/dev_tools/can-scripts$ ip -details link show can1
21: 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 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535

== dmesg ==
[62379.067737] cpufreq: cpu0,cur:2404000,set:2201600,set ndiv:172
[62527.371177] mttcan_controller_config: ctrlmode 0
[62527.371196] mttcan c310000.mttcan can0: Bitrate set
[62527.888235] mttcan_controller_config: ctrlmode 0
[62527.888254] mttcan c320000.mttcan can1: Bitrate set
[62529.402079] cpufreq: cpu0,cur:2073000,set:2201600,set ndiv:172
[62529.404308] cpufreq: cpu4,cur:2041000,set:2201600,set ndiv:172
[62539.428313] cpufreq: cpu8,cur:2073000,set:2201600,set ndiv:172


I found can state in ERROR-PASSIVE or ERROR-WARNING for sometime, and set interface down then up could not fix it.

Now, there’s 2 actions for me:

  1. I maintains the default registers values. (Ignore file specified values: 0x0400, 0x0458)
  2. My reset script has been modified to include core module uninstallation. The current reset actions include:
    interface down: can0, can1
    modules remove: mttcan、can_bcm
    modules add: can_bcm、mttcan
    interface up: can0, can1
    And repeat till can state in ERROR-ACTIVE.

Now, it works fine.

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