AM625: AM625 CAN bus-off Issue

Part Number: AM625


e are using the AM625 and need to utilize three on-chip CAN interfaces.
 
Instead of using the k3-am62x-sk-mcan.dtso overlay, we integrated the device tree content directly into k3-am62x-sk-common.dtsi.

A. Device Tree Modifications:

  1. Added the following to the root node "/ {":
    transceiver1: can-phy0 {
        compatible = "ti,tcan1042";
        #phy-cells = <0>;
        max-bitrate = <5000000>;
    };
    
    transceiver2: can-phy1 {
        compatible = "ti,tcan1042";
        #phy-cells = <0>;
        max-bitrate = <5000000>;
    };
    
    transceiver3: can-phy2 {
        compatible = "ti,tcan1042";
        #phy-cells = <0>;
        max-bitrate = <5000000>;
    };

    2.Added to &main_pmx0:
    main_mcan0_pins_default: main-mcan0-pins-default {
        bootph-all;
        pinctrl-single,pins = <
            AM62X_IOPAD(0x01dc, PIN_INPUT, 0) /* (E15) MCAN0_RX */
            AM62X_IOPAD(0x01d8, PIN_OUTPUT, 0) /* (C15) MCAN0_TX */
        >;
    };
    
    3.Added to &mcu_pmx0:
    
    mcu_mcan0_pins_default: mcu-mcan0-pins-default {
        bootph-pre-ram;
        pinctrl-single,pins = <
            AM62X_MCU_IOPAD(0x0038, PIN_INPUT, 0) /* (B3) MCU_MCAN0_RX */
            AM62X_MCU_IOPAD(0x0034, PIN_OUTPUT, 0) /* (D6) MCU_MCAN0_TX */
        >;
    };
    
    mcu_mcan1_pins_default: mcu-mcan1-pins-default {
        bootph-pre-ram;
        pinctrl-single,pins = <
            AM62X_MCU_IOPAD(0x0040, PIN_INPUT, 0) /* (D4) MCU_MCAN1_RX */
            AM62X_MCU_IOPAD(0x003c, PIN_OUTPUT, 0) /* (E5) MCU_MCAN1_TX */
        >;
    };
    4.Added at the end:
    
    &main_mcan0 {
        status = "okay";
        /* RX pin 8 & TX pin 10 of J3 */
        pinctrl-names = "default";
        pinctrl-0 = <&main_mcan0_pins_default>;
        phys = <&transceiver1>;
    };
    
    &mcu_mcan0 {
        status = "okay";
        /* RX pin 22 & TX pin 16 of J10 */
        pinctrl-names = "default";
        pinctrl-0 = <&mcu_mcan0_pins_default>;
        phys = <&transceiver2>;
    };
    
    &mcu_mcan1 {
        status = "okay";
        /* RX pin 11 & TX pin 10 of J10 */
        pinctrl-names = "default";
        pinctrl-0 = <&mcu_mcan1_pins_default>;
        phys = <&transceiver3>;
    };

    B. Defconfig Configuration (Enabled Required Driver Settings)

    CONFIG_CAN_M_CAN=y
    CONFIG_CAN_M_CAN_PLATFORM=y
    CONFIG_PHY_CAN_TRANSCEIVER=y
    
    # Additional unrelated configurations:
    CONFIG_CAN_DEV=y
    CONFIG_CAN_MCP251XFD=y
    CONFIG_CAN_MCP251XFD_SANITY=y
    CONFIG_HAS_IOMEM=y
    CONFIG_GENERIC_PHY=y
    CONFIG_SPI_MASTER=y
    CONFIG_ARCH_OMAP2PLUS=y
    CONFIG_SG_SPLIT=y

    C. Symptom Description:

    1. CAN interfaces can be configured via ip commands (configuration works normally):
    ip link set can0 down
    ip link set can1 down
    ip link set can2 down
    set -x
    ip link set can0 type can bitrate 250000
    ip link set can1 type can bitrate 250000
    ip link set can2 type can bitrate 250000
    ip link set can0 up
    ip link set can1 up
    ip link set can2 up
    2.CAN initialization completes normally:
    
    [    0.215059] NET: Registered PF_CAN protocol family
    [    0.215067] can: raw protocol
    [    0.215082] can: broadcast manager protocol
    [    0.215094] can: netlink gateway - max_hops=1
    3.bus-off error occurs immediately after running cansend:
    
    m_can_platform 4e08000.can can0: bus-off
    We urgently need to resolve this bus-off issue. We want to confirm whether it is software-related or hardware-related. From the hardware side, only two wires are connected for each CAN interface, so there seems to be no obvious issue.