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.

AM6442 can port

Other Parts Discussed in Thread: AM6442, TCA6424

AM6442 SDK 07_03_01_006  can0 can1 are control by R-core.

 AM6442  SDK 08.00.00.21 can0 can1 are control by A-core.

My software is update to 08.00.00.21,but I don't want to use can0 can1 by A-core.

How can I change code?

1.I have changed k2-am642-evm.dts

&main_mcan0 {
    status = "disabled";
};

&main_mcan1 {
    status = "disabled";
};

then,can0 can1 are  disappeared in A-core,but can0 can1 can't receive msgs.

&main_i2c1 {
    pinctrl-names = "default";
    pinctrl-0 = <&main_i2c1_pins_default>;
    clock-frequency = <400000>;

    exp1: gpio@22 {
        compatible = "ti,tca6424";
        reg = <0x22>;
        gpio-controller;
        #gpio-cells = <2>;
        gpio-line-names = "GPIO_eMMC_RSTn", "CAN_MUX_SEL",
                  "GPIO_CPSW1_RST", "GPIO_RGMII1_RST",
                  "GPIO_RGMII2_RST", "GPIO_PCIe_RST_OUT",
                                  "MCAN0_STB_3V3", "MCAN1_STB_3V3",

MCAN0_STB_3V3 MCAN1_STB_3V3 are high level.

I think the lines of i2c are setted like that:

main_i2c1_pins_default: main-i2c1-pins-default {
        pinctrl-single,pins = <
            AM64X_IOPAD(0x0268, PIN_INPUT_PULLUP, 0) /* (C18) I2C1_SCL */
            AM64X_IOPAD(0x026c, PIN_INPUT_PULLUP, 0) /* (B19) I2C1_SDA */
        >;
    };

Do you agree with me?

I don't know that MCAN0_STB_3V3 MCAN0_STB_3V3 reg. Can you tell me ?

  • Hello,

    I don't know that MCAN0_STB_3V3 MCAN0_STB_3V3 reg. Can you tell me ?

    From the UG:

    STB pin of the IC is by default connected to ground to avoid IC entering stand-by mode. The STB pin is controlled by GPIO to enable Standby mode.

    Can you also try setting "transceiver1" and transceiver2" to "status = "disabled";? Or, just remove them entirely? I believe they are driving the STB signals high.

    Thanks.

  • how can work?

    cans receive msgs and send to A-core by ipc ,then A-core receive the msgs to show can?

    I test the can0 with bitrate 500000,but the can0 only receives 4 packets.

    can0: flags=128<NOARP> mtu 16 metric 1
    unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
    RX packets 0 bytes 0 (0.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 0 bytes 0 (0.0 B)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    device interrupt 36

    can1: flags=128<NOARP> mtu 16 metric 1
    unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
    RX packets 0 bytes 0 (0.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 0 bytes 0 (0.0 B)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    device interrupt 38

  • Hi,

    I am having trouble following what you are trying to do. Do you want the A53 cores to process the packets? 

    Could you please list the steps that you are using to test the CAN interfaces?

    Best Regards,

    Schuyler

  • I have two tasks,one task is cans only be  used in R-core;one task is cans be used in A-core.

    The processor_8.0.0.21 has been released, so I develop on this basis.

  • Hi,

    Again I apologize as I am not sure what you are asking for.  You said there a two tasks, one for each core. What I am not sure about is if you want to run a CAN interface from the A53 and another CAN interface on the R5 core at the same time?  It also seems like you want to run both CANs interfaces on both cores A53 and R5 simultaneously. Which of the these two use cases are you trying to accomplish? The simultaneous use case will not work as either the A53 cores or the R5 cores has to be controlling a CAN interface.

    Best Regards,

    Schuyler

  • Let me explain that, I want to A53 control two can interface.

    The can port0 only receive 4 msgs and no more.

  • Hi,

    Thank you for confirming that linux will be handling the CAN interfaces. I see that you are referencing the gpevm dts file but I do not see the TI GPEVM is being used here, could you also please confirm which board you are using?

    Also please show the commands you are using to initialize the CAN interfaces, how are the CAN interfaces attached or wired? Also please attach the commands being used to send and received data on the CAN interfaces. And please attach the results of this command after the CAN interfaces are initialized and data has been sent:

    ip -d -s link show can0

    Best Regards,

    Schuyler

  • TMDS64GPEVM

    ip -d -s link show can0
    4: 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.875
    tq 12 prop-seg 69 phase-seg1 70 phase-seg2 20 sjw 1
    m_can: tseg1 2..256 tseg2 2..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
    re-started bus-errors arbit-lost error-warn error-pass bus-off
    0 0 0 0 0 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
    RX: bytes packets errors dropped missed mcast
    0 0 0 0 0 0
    TX: bytes packets errors dropped carrier collsns
    0 0 0 0 0 0

    ip -d -s link show can0
    4: 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-PASSIVE (berr-counter tx 0 rx 127) restart-ms 0
    bitrate 500000 sample-point 0.875
    tq 12 prop-seg 69 phase-seg1 70 phase-seg2 20 sjw 1
    m_can: tseg1 2..256 tseg2 2..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
    re-started bus-errors arbit-lost error-warn error-pass bus-off
    0 0 0 1 1 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
    RX: bytes packets errors dropped missed mcast
    16 2 0 2 0 0
    TX: bytes packets errors dropped carrier collsns
    0 0 0 0 0 0
    root@am64xx-evm:~#

  • Hi,

    I am able to test send several CAN and CAN-FD between the CAN0 and the CAN1 interfaces on the AM64GPEVM.

    I am not seeing any bus errors. This is how I set up the interface:

    ip link set can0 type can bitrate 1000000 dbitrate 4000000 fd on
    usleep 500
    ip link set can1 type can bitrate 1000000 dbitrate 4000000 fd on
    usleep 500
    ip link set can0 up
    usleep 500
    ip link set can1 up

    I put can1 into received mode with this command:

    candump can1 &

    I then sent data with this command, the following line is what can1 received, the first sequence is classic CAN, the second is CAN-FD

    root@am64xx-evm:~# cansend can0 143#FEEDBEEF
    can1 143 [4] FE ED BE EF
    root@am64xx-evm:~# cansend can0 143##0FEEDBEEF
    can1 143 [04] FE ED BE EF

    Would you be able to try to repeat this test?

    Best Regards,

    Schuyler

  • Hi ,

    Thanks for your reply!

    I repeat this test,and the result is ok.

  • Hi,

    Thank for performing the test. I will wait for your reply.

    Best Regards,

    Schuyler