AM3351: CAN controller RX buffer overflow

Part Number: AM3351


Hi Expert,

I found an issue about dual CAN interface on Draco. The situation like below:

  • Dual CAN interface work at the same time.  The CPU info like below:

root@fs360d-xc720:~# cat /proc/cpuinfo

processor       : 0

model name      : ARMv7 Processor rev 2 (v7l)

BogoMIPS        : 597.60

Features        : half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32

CPU implementer : 0x41

CPU architecture: 7

CPU variant     : 0x3

CPU part        : 0xc08

CPU revision    : 2

 

Hardware        : Generic AM33XX (Flattened Device Tree)

Revision        : 0000

Serial          : 0000000000000000

  • CAN interface parameter like below:

root@fs360d-xc720:~# ip -s -d link show can0

2: 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.812

          tq 125 prop-seg 6 phase-seg1 6 phase-seg2 3 sjw 3 brp 3

          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

          0          0          0          1          0          0         numtxqueues 1 gso_max_size 65536 gso_max_segs 65535

    RX:  bytes packets errors dropped  missed   mcast

         21385    2681      0       0       0       0

    TX:  bytes packets errors dropped carrier collsns

          4753     681      0       0       0       0

root@fs360d-xc720:~# ip -s -d link show can1

3: 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-ACTIVE (berr-counter tx 0 rx 59) restart-ms 0

          bitrate 500000 sample-point 0.812

          tq 125 prop-seg 6 phase-seg1 6 phase-seg2 3 sjw 3 brp 3

          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

          0          0          0          1          0          0         numtxqueues 1 gso_max_size 65536 gso_max_segs 65535

    RX:  bytes packets errors dropped  missed   mcast

           487      70      0       0       0       0

    TX:  bytes packets errors dropped carrier collsns

            49       7      0       0       0       0

  • Dual CAN bus receiving can frame continuously, the CAN network topology shown like below:

  • On DRACO1 MPU, can message indicates CAN controller RX buffer overflow.

can_frame.can_id & CAN_ERR_FLAG != 0                                            //can.h

can_frame.data[1] & CAN_ERR_CRTL_RX_OVERFLOW != 0              //error.h

Question:

Is there any approach we can apply to eliminate this issue, like adjust parameters or patch?

 

BR,

Biao

  • Hi,

    I may not be following what you are asking. I have a couple of follow up questions:

    - Is this an RT Linux kernel?

    - Are you both CAN interfaces operating simultaneously?

    - What is the application being use to receive the CAN frames? Please note that anything that prints to the console will have an impact on CAN reception.

    - What other applications are running?

    Best Regards,

    Schuyler

  • Hi Schuyler,

    pls see below answer from customer.

    • We tried it on both  PREEMPT and PREEMPT_RT Linux kernel, this issue happens on both.

    root@fs360d-xc720:~# uname -a

    Linux fs360d-xc720 5.10.214+git0f399690a2c1 #1 PREEMPT Thu May 16 09:05:29 AM UTC 2024 armv7l GNU/Linux

     

    root@fs360d-fc:~# uname -a

    Linux fs360d-fc 5.10.214-rt106+git95c6ba8523a5 #1 PREEMPT_RT Thu Jan 23 03:55:02 AM UTC 2025 armv7l GNU/Linux

     

    • Yes, but at last we tried on single CAN interface, this issue can also happen but with low frequency
    • We run canopend on both CAN interface, and has some log output, but not some much. The CPU load&usage is not so high

    Mem: 94624K used, 410312K free, 11480K shrd, 0K buff, 44444K cached
    CPU:   4% usr   4% sys   0% nic  89% idle   0% io   0% irq   1% sirq
    Load average: 0.02 0.10 0.09 1/118 22372
      PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
    19116 19111 root     S     4524   1%   0   2% /data/can/canopend can0 -i 1 -c tcp-5656
    21632 19111 root     S     4524   1%   0   1% /data/can/canopend can1 -i 1 -c tcp-5657

    • Others are system, and some application may use uart (but I didn’t connect any peripheral device to uart yet)

     

     BR,

    Biao