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.

AM62A7: PROCESSOR-SDK-AM62a7-k3-am62a7-sk.dts (main_mcan0)

Part Number: AM62A7


Tool/software:

Hello TI Community,

I am working on enabling CAN with the TCAN1042 transceiver on the AM62A7 processor. We have an onboard CAN transceiver, and I have made the following changes in my device tree:

transceiver0: can-phy0 {
compatible = "ti,tcan1042";
#phy-cells = <0>;
max-bitrate = <5000000>;
};

main_mcan0_pins_default: main_mcan0_pins_default {
pinctrl-single,pins = <
AM62AX_IOPAD(0x01dc, PIN_INPUT, 0) /* (C18) MCAN0_RX */
AM62AX_IOPAD(0x01d8, PIN_OUTPUT, 0) /* (B17) MCAN0_TX */
>;
};

&main_mcan0 {
pinctrl-names = "default";
pinctrl-0 = <&main_mcan0_pins_default>;
phys = <&transceiver0>;
status = "okay";
};

I successfully loaded the required kernel modules with the following commands:

modprobe can
modprobe can_dev
modprobe m_can
modprobe m_can_platform
modprobe can_j1939

After running ifconfig -a, the can0 interface is showing up:

can0: flags=128<NOARP> mtu 16
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 31

However, when I try to set the bitrate with the following command:

ip link set can0 type can bitrate 125000

I receive the error:

ip: either "dev" is duplicate, or "type" is garbage

# dmesg | grep can0
[ 319.120533] m_can_platform 20701000.can can0: bit-timing not yet defined
[ 319.127609] m_can_platform 20701000.can can0: failed to open can device

I would appreciate any guidance on resolving this issue.

Thank you for your support!

Best regards,

Laxman

  • Hello TI Community,

    I wanted to follow up on my previous query regarding enabling CAN with the TCAN1042 transceiver on the AM62A7 processor. I have not yet received a response, and I would appreciate any guidance on the issue I'm facing.

    In summary, I am seeing the can0 interface, but I encounter an error when trying to set the bitrate, as shown below:

    ip: either "dev" is duplicate, or "type" is garbage

    Additionally, the kernel logs show the following messages:

    [ 319.120533] m_can_platform 20701000.can can0: bit-timing not yet defined
    [ 319.127609] m_can_platform 20701000.can can0: failed to open can device

    Could you please suggest how to proceed with debugging this issue? Any help would be greatly appreciated.

    Thank you again for your time and support!

    Best regards,
    Laxman

  •  Hi Laxman,

    Is this problem solved?

    Best regards,
    dxw

  • Hi ,

    Following up on my previous query regarding enabling CAN with the TCAN1042 transceiver on the AM62A7 processor, I have encountered a new issue. After configuring the can0 interface and attempting to send a CAN frame, the interface enters a bus-off state.

    Below are the steps I followed:

    # ip link set can0 down
    # ip link set can0 type can bitrate 125000
    # ip link set can0 up
    [257388.986490] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready

    # cansend can0 123#DEADBEEF
    [257397.617902] m_can_platform 20701000.can can0: bus-off

    It seems that after sending a CAN message, the CAN interface is going into the bus-off state. I would appreciate any insights or recommendations on how to address this issue.

    Thank you for your continued support!

    Best regards,
    Laxman