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