This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM6548: Linux kernel freeze easily after sending message by can bus

Part Number: AM6548

Hi Ti,

We are developing a device based on the AM6526 SR2.0 processor.

For development, we use the PROCESSOR-SDK-LINUX-RT-AM65X  07_01_00_18 sdk.

In normal case, the board work well.

However, the Linux will freeze easily after after sending message by can bus.

If Linux freeze, I can't type any cmd, and system will auto reboot after a while.

In addition, there are not any kernel panic message.

Test cmd as below:

ip link set can0 up type can bitrate 800000 loopback on   //allow can bus enter loopback mode

cansend can0 135#02080426A10D112A                          // send message

Video as below:

As show on video, Linux freeze after sending ten can bus messages.

Could you help to check it?

Thanks.

Joey

  • Hi Ti,

    In addition, I can reproduce this issue on AM65X SR1.0 EVM too.

    The log as below.

    AM6548-system-freeze-log.txt

    Thanks

  • Hi,

    Do you have any updates?

    Thanks

  • Hi Joey,

    I see you are not setting the interface up.

    Can you please run the below command:

    # Check if the device is registered on not
    dmesg | grep can
    
    # Set bitrate and loopback mode
    ip link set can0 type can bitrate 1000000 loopback on
    
    # Set the interface up
    ip link set can0 up
    
    # Show details
    ip -details link show can0
    
    # Dump incoming packets
    candump can0
    
    # Send packets
    cansend can0 123#DEADBEEF
    

    Can you post the output of all of these?

    Regards,

    Karan

  • Hi, Karan

    The command output as below.

    root@am65xx-evm:~# dmesg | grep can
    [ 19.980934] m_can_platform 40528000.mcan: m_can device registered (irq=15, version=32)
    root@am65xx-evm:~# ip link set can0 type can bitrate 1000000 loopback on
    root@am65xx-evm:~# ip link set can0 up
    [ 79.815257] 000: IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
    root@am65xx-evm:~# ip -details link show can0
    3: 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 <LOOPBACK> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
    bitrate 1000000 sample-point 0.750
    tq 12 prop-seg 29 phase-seg1 30 phase-seg2 20 sjw 1
    m_can: tseg1 2..256 tseg2 1..128 sjw 1..128 brp 1..512 brp-inc 1
    m_can: dtseg1 1..32 dtseg2 1..16 dsjw 1..16 dbrp 1..32 dbrp-inc 1
    clock 80000000 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
    root@am65xx-evm:~# candump can0
    [ 110.198579] 000: can: controller area network core (rev 20170425 abi 9)
    [ 110.207423] 000: NET: Registered protocol family 29
    [ 110.224653] 000: can: raw protocol (rev 20170425)


    ^Croot@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    ^[[Aroot@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~#
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~# cansend can0 123#DEADBEEF
    root@am65xx-evm:~#

    According to above message, our board still crash after sending 33 messages

    Then, it auto reboot after a while.

    Thanks.

    Joey

  • Hi Joey:

    After 33times transferring, may you share the crash dump log?

    Thanks.

    BR Rio

  • Hi Joey,

    Along with the crash dump as Rio has asked for, can you confirm that the first 33 messages were also received or not?

    As you are running in internal loopback mode, you can try to run the below to see the messages: 

    candump can0 &

    This needs to run after you setup the interface and before you send the messages. The earlier command missed the "&" and hence won't run in parallel.

    This will run in the background and should echo back the same message which you are sending (if the transfer happened successfully).

    Regards,

    Karan