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.

AM3352: CAN ports can't work simutaneously

Genius 13655 points
Part Number: AM3352

Hello Champs,

AM3352 own board

Linux Kernel : linux-rt-4.19.38+gitAUTOINC+1224cd679e-g1224cd679e

can0/can1 can work respectively. But when they work simutaneously, can1 is blocked until can1 released.

Two boards connected by can1.

1st board:

$ /bin/ip link set can0 type can bitrate 1000000;/bin/ip link set can0 up

$ /bin/ip link set can1 type can bitrate 1000000;/bin/ip link set can1 up

$ candump can0 &

$ candump can1 &

2nd board:

$ /bin/ip link set can0 type can bitrate 1000000;/bin/ip link set can0 up

$ /bin/ip link set can1 type can bitrate 1000000;/bin/ip link set can1 up

$cansend can1 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88

After 2nd board executed "cansend" , 1st board can't recieve data. When stopping can0, 

$ /bin/ip link set can0 down

It can receive  "<0x010> [8] 11 22 33 44 55 66 77 88"

Attached is the kernel config file.
tisdk_am335x-evm-rt_defconfig.txt

Thanks.
Rgds

Shine

  • Hi,

    What boards are you using TI EVMs or custom boards?

    Do you have CANBUS analyzer to look at the traffic on the CANBUS?

    Could you please attach the results of this command from board 1 before the cansend on can1 and after from board 2?

    ip -d -s link show can1

    Best Regards,

    Schuyler

  • Hi Schuyler,

    Thanks for your support.

    Customer used his own boards. One board is for Master and the other board is for Slave.
    Master CAN0-----Slave CAN0
    Master CAN1-----Slave CAN1

    The Master is normal. After inputing "cansend" in Slave,  CAN1 state is changed from "ERROR-ACTIVE" to "BUS-OFF"

    If only using CAN1, there is no such issue. Is the issue caused by Kernel configuration or the Driver bug? 

    Attached is the Dual CAN and Single CAN test results.

    /bin # /bin/ip link set can1 type can bitrate 1000000;/bin/ip link set can1 up
    /bin # ip -d -s link show can0;ip -d -s link show can1
    2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN qlen 10
        link/can 
        can state STOPPED (berr-counter tx 0 rx 0) restart-ms 0 
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns 
        0          0        0       0       0       0      
    3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can 
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0 
        bitrate 1000000 sample-point 0.750 
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns 
        0          0        0       0       0       0      
    /bin # cansend can1 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
    interface = can1, family = 29, type = 3, proto = 1
    /bin # ip -d -s link show can0;ip -d -s link show can1
    2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN qlen 10
        link/can 
        can state STOPPED (berr-counter tx 0 rx 0) restart-ms 0 
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns 
        0          0        0       0       0       0      
    3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can 
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0 
        bitrate 1000000 sample-point 0.750 
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns 
        8          1        0       0       0       0      
    /bin # 
    
    /bin # /bin/ip link set can1 type can bitrate 1000000;/bin/ip link set can1 up
    /bin # ip -d -s link show can0;ip -d -s link show can1
    2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN qlen 10
        link/can 
        can state STOPPED (berr-counter tx 0 rx 0) restart-ms 0 
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns 
        0          0        0       0       0       0      
    3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can 
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0 
        bitrate 1000000 sample-point 0.750 
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns 
        0          0        0       0       0       0      
    /bin # cansend can1 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
    interface = can1, family = 29, type = 3, proto = 1
    /bin # ip -d -s link show can0;ip -d -s link show can1
    2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN qlen 10
        link/can 
        can state STOPPED (berr-counter tx 0 rx 0) restart-ms 0 
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns 
        0          0        0       0       0       0      
    3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can 
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0 
        bitrate 1000000 sample-point 0.750 
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns 
        8          1        0       0       0       0      
    /bin # 
    
    /bin # /bin/ip link set can0 type can bitrate 1000000;/bin/ip link set can0 up
    /bin # /bin/ip link set can1 type can bitrate 1000000;/bin/ip link set can1 up
    /bin # ip -d -s link show can0;ip -d -s link show can1
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      
    3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      
    /bin # candump can0 &
    /bin # interface = can0, family = 29, type = 3, proto = 1
    
    /bin # candump can1 &
    /bin # interface = can1, family = 29, type = 3, proto = 1
    
    /bin # ip -d -s link show can0;ip -d -s link show can1
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      
    3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      
    /bin # 
    /bin # /bin/ip link set can0 type can bitrate 1000000;/bin/ip link set can0 up
    /bin # /bin/ip link set can1 type can bitrate 1000000;/bin/ip link set can1 up
    /bin # ip -d -s link show can0;ip -d -s link show can1
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      
    3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      
    /bin # cansend can1 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
    interface = can1, family = 29, type = 3, proto = 1
    /bin # ip -d -s link show can0;ip -d -s link show can1
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      
    3: can1: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN qlen 10
        link/can
        can state BUS-OFF (berr-counter tx 248 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          1          1         
        RX: bytes  packets  errors  dropped overrun mcast   
        24         3        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      
    /bin # 


    Master:


    /bin # /bin/ip link set can0 type can bitrate 1000000;/bin/ip link set can0 up
    /bin # /bin/ip link set can1 type can bitrate 1000000;/bin/ip link set can1 up
    /bin # ip -d -s link show can0;ip -d -s link show can1
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      
    3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      
    /bin # candump can0 &
    /bin # interface = can0, family = 29, type = 3, proto = 1

    /bin # candump can1 &
    /bin # interface = can1, family = 29, type = 3, proto = 1

    /bin # ip -d -s link show can0;ip -d -s link show can1
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      
    3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      
    /bin #

    Salve:


    /bin # /bin/ip link set can0 type can bitrate 1000000;/bin/ip link set can0 up
    /bin # /bin/ip link set can1 type can bitrate 1000000;/bin/ip link set can1 up
    /bin # ip -d -s link show can0;ip -d -s link show can1
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      
    3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      
    /bin # cansend can1 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
    interface = can1, family = 29, type = 3, proto = 1
    /bin # ip -d -s link show can0;ip -d -s link show can1
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      
    3: can1: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN qlen 10
        link/can
        can state BUS-OFF (berr-counter tx 248 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          1          1         
        RX: bytes  packets  errors  dropped overrun mcast   
        24         3        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      
    /bin #

    Result:

    Thanks

    Rgds
    Shine

  • Hi Shine,

    The only thing I can suggest from what I can see at the moment is to check the cabling and line terminations on the both boards for both can interfaces. The bus-off condition I believe typically means something is wrong with the electrical signaling. Since can1 is showing bus-off indication it was not able to send the can frame. So if this condition only appears when both can0 and can1 perhaps can0 and can1 are not electrically isolated.

    Best Regards,

    Schuyler

  • Hi Schuyler,

    Customer did another test. He adjusted the connection. Connect Master CAN0, CAN1 to Slave CAN0. 

    Below is the test steps:

    Master$ /bin/ip link set can0 type can bitrate 1000000;/bin/ip link set can0 up
    Master$ /bin/ip -d -s link show can0
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0   

    Salve$ /bin/ip link set can0 type can bitrate 1000000;/bin/ip link set can0 up
    Salve$ candump can0 &
    interface = can0, family = 29, type = 3, proto = 1

    Salve$ /bin/ip -d -s link show can0
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0     

    Master$ cansend can0 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
    interface = can0, family = 29, type = 3, proto = 1

    Salve$ <0x010> [8] 11 22 33 44 55 66 77 88

    # Master can0 cable is normal.

    Master$ /bin/ip link set can0 down
    Master$ /bin/ip link set can1 type can bitrate 1000000;/bin/ip link set can1 up
    Master$ /bin/ip -d -s link show can1
    3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      

    Master$ cansend can1 -i 0x20 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
    interface = can1, family = 29, type = 3, proto = 1

    Salve$ <0x020> [8] 11 22 33 44 55 66 77 88

    # Master can1 cable is normal.

    Master$ /bin/ip link set can0 up
    Master$ ip -d -s link show can0; ip -d -s link show can1
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        8          1        0       0       0       0      
    3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        8          1        0       0       0       0      

    Master$ cansend can1 -i 0x20 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
    interface = can1, family = 29, type = 3, proto = 1

    # Wait for some time, Salve did not receive any response.


    Master$ ip -d -s link show can0; ip -d -s link show can1
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        8          1        0       0       0       0      
    3: can1: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN qlen 10
        link/can
        can state BUS-OFF (berr-counter tx 248 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          1          1         
        RX: bytes  packets  errors  dropped overrun mcast   
        24         3        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        8          1        0       0       0       0      

    The CAN0, CAN1 can run correctly independently. But they can't run correctly when being opened simutaneously. After sending "cansend can state ", it will be in  BUS-OFF.

    Thanks.
    Rgds

    Shine

  • Hi Shine,

    I looked at the cansend instruction that the are using, what is the -i being used for? This is the command they are using. It does not look to be causing an error from output but that may not mean that an error is not happening. I see that they are using the same command for both the single and dual case. Can they try without the -i option?

    cansend can1 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88

    TI includes the cansend from a public repo in the SDK and uses the code to prove basic functionality. We are not experts on this code so there maybe an issue with it.

    Best Regards,

    Schuyler

  • Hi Schuyler:

    I ’m the person who asked this question, this is the case after removing the “i” parameter

    Color Define: Color is a command , Color is a respond, Color is a comment

     

    Master# /bin/ip link set can0 type can bitrate 1000000;/bin/ip link set can0 up
    Master# /bin/ip -d -s link show can0
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      

    Salve# /bin/ip link set can0 type can bitrate 1000000;/bin/ip link set can0 up
    Salve# candump can0 &
    interface = can0, family = 29, type = 3, proto = 1

    Salve# /bin/ip -d -s link show can0
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      

    Master# cansend can0 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
    interface = can0, family = 29, type = 3, proto = 1

    Salve# <0x001> [8] 11 22 33 44 55 66 77 88

    The master CAN0 cable is normal.


    Master# /bin/ip link set can0 down
    Master# /bin/ip link set can1 type can bitrate 1000000;/bin/ip link set can1 up
    Master# /bin/ip -d -s link show can1
    3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0    
        0        0       0       0       0      


    Master# cansend can1 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
    interface = can1, family = 29, type = 3, proto = 1

    Salve# <0x001> [8] 11 22 33 44 55 66 77 88

    # The master CAN1 cable is normal.


    Master# /bin/ip link set can0 up
    Master# ip -d -s link show can0; ip -d -s link show can1
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        8          1        0       0       0       0      
    3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        8          1        0       0       0       0     

    Master# cansend can1  0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
    interface = can1, family = 29, type = 3, proto = 1

    # Wait for some time, Salve did not receive any response.

    Master# ip -d -s link show can0; ip -d -s link show can1
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        8          1        0       0       0       0      
    3: can1: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN qlen 10
        link/can
        can state BUS-OFF (berr-counter tx 248 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          1          1         
        RX: bytes  packets  errors  dropped overrun mcast   
        24         3        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        8          1        0       0       0       0    

    Salve# /bin/ip -d -s link show can0
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        16         2        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      


    Observation results:

    After starting two sets of DCAN,As long as "cansend" is sent, the state will jump from ACTIVE to OFF, if only one set is started, it will not happen.

     

    Thanks.



  • Hi Schuyler:

    I ’m the person who asked this question, this is the case after removing the “i” parameter

    Color Define: Color is a command , Color is a respond, Color is a comment

     

    Master# /bin/ip link set can0 type can bitrate 1000000;/bin/ip link set can0 up
    Master# /bin/ip -d -s link show can0
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      

    Salve# /bin/ip link set can0 type can bitrate 1000000;/bin/ip link set can0 up
    Salve# candump can0 &
    interface = can0, family = 29, type = 3, proto = 1

    Salve# /bin/ip -d -s link show can0
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      

    Master# cansend can0 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
    interface = can0, family = 29, type = 3, proto = 1

    Salve# <0x001> [8] 11 22 33 44 55 66 77 88

    The master CAN0 cable is normal.


    Master# /bin/ip link set can0 down
    Master# /bin/ip link set can1 type can bitrate 1000000;/bin/ip link set can1 up
    Master# /bin/ip -d -s link show can1
    3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0    
        0        0       0       0       0      


    Master# cansend can1 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
    interface = can1, family = 29, type = 3, proto = 1

    Salve# <0x001> [8] 11 22 33 44 55 66 77 88

    # The master CAN1 cable is normal.


    Master# /bin/ip link set can0 up
    Master# ip -d -s link show can0; ip -d -s link show can1
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        8          1        0       0       0       0      
    3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        8          1        0       0       0       0     

    Master# cansend can1  0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
    interface = can1, family = 29, type = 3, proto = 1

    # Wait for some time, Salve did not receive any response.

    Master# ip -d -s link show can0; ip -d -s link show can1
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        0          0        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        8          1        0       0       0       0      
    3: can1: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN qlen 10
        link/can
        can state BUS-OFF (berr-counter tx 248 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          1          1         
        RX: bytes  packets  errors  dropped overrun mcast   
        24         3        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        8          1        0       0       0       0    

    Salve# /bin/ip -d -s link show can0
    2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 1000000 sample-point 0.750
        tq 83 prop-seg 4 phase-seg1 4 phase-seg2 3 sjw 1
        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          0          0          0         
        RX: bytes  packets  errors  dropped overrun mcast   
        16         2        0       0       0       0      
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0      


    Observation results:

    After starting two sets of DCAN,As long as "cansend" is sent, the state will jump from ACTIVE to OFF, if only one set is started, it will not happen.

     

    Thanks.



  • Hello Schuyler:

    Thank you, the problem has been solved, there is a problem with the GPIO of the board to be tested, and it can be solved by replacing the board.