AM625: Can overrun issue

Part Number: AM625
Other Parts Discussed in Thread: SK-AM62-LP, SN65HVD230

Tool/software:

Hi Expert,

We used SK-AM62-LP for CAN communication verification (standard frame, 1Mbps). The verification method was to continuously send message using another board .

In the initial SDK9 version, both the main can and the MCU can would occasionally have overrun errors.

Later, following FAE's advice, I switched to the latest SDK11.01.05.03 (not RT-Linux), and the overrun error no longer occurs. However, if you plug or unplug the network cable or start our application at this time, the overrun error will still occur.

main can test:

mcu can test:

When changing RT-Linux, overrun will also appear when plugging or unplugging the network cable.

We analyzed that the cause of the overrun error is that the kernel failed to remove the data in the fifo of the CAN drive in time. Is that so? Is there any way to solve it?

  • Let me add some of the methods we have tried
    1. Increased the cache, but it had no effect;

    sudo sysctl -w net.core.rmem_default=1048576

    sudo sysctl -w net.core.rmem_max=4194304

    2.Changing the polling interval of the mcu can from 1ms to 0.1ms has improved but still cannot be completely solved.

  • Looking forward to the responses from all the experts!

  • Looking forward to the responses from all the experts!

    Hi Liang

        I am debugging this issue, but meet some issue, when I tried to send can frame, all MCAN interfaces report bus off

        wait some time

    ----------------------------

    root@am62pxx-evm:~#
    root@am62pxx-evm:~# ip link set mcu_mcan0 type can bitrate 1000000
    root@am62pxx-evm:~#
    root@am62pxx-evm:~# ip link set mcu_mcan1 type can bitrate 1000000
    root@am62pxx-evm:~#
    root@am62pxx-evm:~#
    root@am62pxx-evm:~# ip link set main_mcan0 type can bitrate 1000000
    root@am62pxx-evm:~#
    root@am62pxx-evm:~#
    root@am62pxx-evm:~#
    root@am62pxx-evm:~# ip link set mcu_mcan0 up
    root@am62pxx-evm:~#
    root@am62pxx-evm:~# ip link set mcu_mcan1 up
    root@am62pxx-evm:~#
    root@am62pxx-evm:~# ip link set main_mcan0 up
    root@am62pxx-evm:~#
    root@am62pxx-evm:~#
    root@am62pxx-evm:~# cansend mcu_mcan0 123#F00DCAFE
    [ 86.394611] can: controller area network core
    [ 86.399103] NET: Registered PF_CAN protocol family
    [ 86.411660] can: raw protocol
    [ 86.416435] m_can_platform 4e08000.can mcu_mcan0: bus-off
    root@am62pxx-evm:~#
    root@am62pxx-evm:~# cansend mcu_mcan1 123#F00DCAFE
    [ 91.626712] m_can_platform 4e18000.can mcu_mcan1: bus-off
    root@am62pxx-evm:~#
    root@am62pxx-evm:~# cansend main_mcan0 123#F00DCAFE
    [ 98.314561] m_can_platform 20701000.can main_mcan0: bus-off
    root@am62pxx-evm:~#
    root@am62pxx-evm:~#

    ---------------------------------------------

    Regards

       Semon

  • Let me add some of the methods we have tried
    1. Increased the cache, but it had no effect;

    sudo sysctl -w net.core.rmem_default=1048576

    sudo sysctl -w net.core.rmem_max=4194304

    2.Changing the polling interval of the mcu can from 1ms to 0.1ms has improved but still cannot be completely solve

    Hi Liang

         I verified with SK-AM62-LP, not reproduce this issue, SDK 11.1.5

        root@am62xx-lp-evm:~#
    root@am62xx-lp-evm:~# uname -a
    Linux am62xx-lp-evm 6.6.58-ti-01497-ga7758da17c28-dirty #1 SMP PREEMPT Wed Nov 27 13:23:15 UTC 2024 aarch64 GNU/Linux
    root@am62xx-lp-evm:~#

        ------------------------------------

    ip -s -s link show mcu_mcan0

    root@am62xx-lp-evm:~# ip -s -s link show mcu_mcan0
    5: mcu_mcan0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
    link/can
    RX: bytes packets errors dropped missed mcast
    546417 94999 0 0 0 0
    RX errors: length crc frame fifo overrun
    0 0 0 0 0
    TX: bytes packets errors dropped carrier collsns
    12 509475 0 0 0 0
    TX errors: aborted fifo window heartbt transns
    0 0 0 0 1
    root@am62xx-lp-evm:~#

    ==============

    after unplug/plug CAN BUS, no CAN frame drop

    ------------------------------------------------

    root@am62xx-lp-evm:~#
    root@am62xx-lp-evm:~# ip -s -s link show mcu_mcan0
    5: mcu_mcan0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
    link/can
    RX: bytes packets errors dropped missed mcast
    10243447 1780915 0 0 0 0
    RX errors: length crc frame fifo overrun
    0 0 0 0 0
    TX: bytes packets errors dropped carrier collsns
    12 509475 0 0 0 0
    TX errors: aborted fifo window heartbt transns
    0 0 0 0 1
    root@am62xx-lp-evm:~# ip -s -s link show mcu_mcan0
    5: mcu_mcan0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
    link/can
    RX: bytes packets errors dropped missed mcast
    10354133 1800239 0 0 0 0
    RX errors: length crc frame fifo overrun
    0 0 0 0 0
    TX: bytes packets errors dropped carrier collsns
    12 509475 0 0 0 0
    TX errors: aborted fifo window heartbt transns
    0 0 0 0 1
    root@am62xx-lp-evm:~#

    -------------------------

    send from another J722S evm BOARD:

    root@j722s-evm:~# cangen mcu_mcan0 -g 0 -p 10 -x
    ^Croot@j722s-evm:~#
    root@j722s-evm:~# cangen mcu_mcan0 -g 0 -p 10 -x

    ---------------------------

    after unplug/plug Ethernet calbe, the error occured,

    -------------------------------------

    root@am62xx-lp-evm:~#
    root@am62xx-lp-evm:~# [ 2556.944600] am65-cpsw-nuss 8000000.ethernet eth0: Link is Down
    [ 2558.992644] am65-cpsw-nuss 8000000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
    [ 2559.001307] m_can_platform 4e08000.can mcu_mcan0: msg lost in rxf0
    [ 2559.007695] m_can_platform 4e08000.can mcu_mcan0: msg lost in rxf0
    [ 2559.014058] m_can_platform 4e08000.can mcu_mcan0: msg lost in rxf0
    [ 2559.020420] m_can_platform 4e08000.can mcu_mcan0: msg lost in rxf0
    [ 2559.026776] m_can_platform 4e08000.can mcu_mcan0: msg lost in rxf0
    [ 2559.033128] m_can_platform 4e08000.can mcu_mcan0: msg lost in rxf0
    [ 2559.039464] m_can_platform 4e08000.can mcu_mcan0: msg lost in rxf0
    [ 2559.045808] m_can_platform 4e08000.can mcu_mcan0: msg lost in rxf0
    [ 2559.052141] m_can_platform 4e08000.can mcu_mcan0: msg lost in rxf0
    [ 2559.058477] m_can_platform 4e08000.can mcu_mcan0: msg lost in rxf0
    [ 2559.064817] m_can_platform 4e08000.can mcu_mcan0: msg lost in rxf0
    [ 2559.071156] m_can_platform 4e08000.can mcu_mcan0: msg lost in rxf0
    [ 2559.077497] m_can_platform 4e08000.can mcu_mcan0: msg lost in rxf0

    --------------------------

    Regards

       Semon

  • HI Spatton

        please help investigate this issue, 

        when enable main_mcan0 for receive, 

        same issue happened, even main_mcan0 is interrupt-mode,

       ----------------------------

    main_mcan0 7E7 [8] 79 0C 4A 30 59 31 17 5B
    main_mcan0 [ 504.345705] m_can_poll 1063, WORK 64, quota 64
    ^CF 43 30 FD C0 1E
    [ 504.355499] m_can_platform 20701000.can main_mcan0: msg lost in rxf0
    root@am62xx-lp-evm:~# [ 504.363715] m_can_poll 1063, WORK 64, quota 64
    [ 504.370015] m_can_platform 20701000.can main_mcan0: msg lost in rxf0
    [ 504.376520] m_can_poll 1063, WORK 64, quota 64
    [ 504.380981] m_can_platform 20701000.can main_mcan0: msg lost in rxf0
    [ 504.387483] m_can_poll 1063, WORK 64, quota 64
    [ 504.391945] m_can_platform 20701000.can main_mcan0: msg lost in rxf0
    [ 504.398455] m_can_poll 1063, WORK 64, quota 64
    [ 504.402920] m_can_platform 20701000.can main_mcan0: msg lost in rxf0
    [ 504.409422] m_can_poll 1063, WORK 64, quota 64
    [ 504.413885] m_can_platform 20701000.can main_mcan0: msg lost in rxf0
    [ 504.420394] m_can_poll 1063, WORK 64, quota 64
    [ 504.424862] m_can_platform 20701000.can main_mcan0: msg lost in rxf0
    [ 504.431364] m_can_poll 1063, WORK 64, quota 64
    [ 504.435829] m_can_platform 20701000.can main_mcan0: msg lost in rxf0
    [ 504.442324] m_can_poll 1063, WORK 64, quota 64
    [ 504.446807] m_can_platform 20701000.can main_mcan0: msg lost in rxf0
    [ 504.453306] m_can_poll 1063, WORK 64, quota 64
    [ 504.457773] m_can_platform 20701000.can main_mcan0: msg lost in rxf0
    [ 504.464274] m_can_poll 1063, WORK 64, quota 64
    [ 504.468742] m_can_platform 20701000.can main_mcan0: msg lost in rxf0

    -----------------------------------------

    the problem is that m_can can't receive the frame quickly, 

    after stop TX, it will recover from error,

    ---------------------

    Regards

       Semon

  • Hi,

    Could you please describe how you have setup the board? Which transceivers are you using?

    On the AM62 when it is receiving frames, what program is being used to read the frames from the CAN interface?

    Best Regards,

    Schuyler

  • Could you please describe how you have setup the board? Which transceivers are you using?

    On the AM62 when it is receiving frames, what program is being used to read the frames from the CAN interface?

    Best Regards,

    Hi Schuyler

        connect AM62 main_mcan0 (with CAN transceiver SN65HVD230) to J722S mcu_mcan0(other board is same too), 

    ----------------------------------------------------------------

    send traffic from J722S with following command:

    -------------------------------------------------

     cangen mcu_mcan0 -g 0 -p 10 -x

    --------------------------------------------

    then unplug/plug eth0 cable of sk-AM62x-lp, following log will be printed:

    ------------------------------------------------------

     [ 504.370015] m_can_platform 20701000.can main_mcan0: msg lost in rxf0
    [ 504.376520] m_can_poll 1063, WORK 64, quota 64
    [ 504.380981] m_can_platform 20701000.can main_mcan0: msg lost in rxf0
    [ 504.387483] m_can_poll 1063, WORK 64, quota 64
    [ 504.391945] m_can_platform 20701000.can main_mcan0: msg lost in rxf0
    [ 504.398455] m_can_poll 1063, WORK 64, quota 64
    [ 504.402920] m_can_platform 20701000.can main_mcan0: msg lost in rxf0
    [ 504.409422] m_can_poll 1063, WORK 64, quota 64
    [ 504.413885] m_can_platform 20701000.can main_mcan0: msg lost in rxf0
    [ 504.420394] m_can_poll 1063, WORK 64, quota 64
    [ 504.424862] m_can_platform 20701000.can main_mcan0: msg lost in rxf0
    [ 504.431364] m_can_poll 1063, WORK 64, quota 64
    [ 504.435829] m_can_platform 20701000.can main_mcan0: msg lost in rxf0

    ----------------

    if stop CAN traffic, AM62x can recover, 

    follow the steps in the AM62X can test setup.

    4.1.7. How to enable MCAN in Linux — Processor SDK AM62x Documentation

    Regards

       Semon

  • Hi,

    Thank you for the data on the test setup.

    - Is there a program on the AM62a such as candump reading the frames from the CAN interface?

    - If I am reading the cangen command correctly messages with no gap between them. Would it be possible to describe the use case here? Is this level of traffic needed?

    - Please note there is not a flow control method so dropped frames will occur if the system is doing something else and is not able to get the frame out of the CAN buffer. 

    Best Regards,

    Schuyler

  • - Is there a program on the AM62a such as candump reading the frames from the CAN interface?

    - If I am reading the cangen command correctly messages with no gap between them. Would it be possible to describe the use case here? Is this level of traffic needed?

    - Please note there is not a flow control method so dropped frames will occur if the system is doing something else and is not able to get the frame out of the CAN buffer. 

    HI Schuyler

        1. no candump is running on AM62X, 

        2. yes cangen send with no gap, but it can not over the CAN max speed 1M bsp

        3. yes, if lower down the sending speed, there will be no frame loss, do you think it is reasonable for AM62X cant receive frame less than 1Mbps?

    Regards

       Semon