How to enable flexcan1 and flexcan2 on colibri imx7?

I am trying to enable flexcan1 and flexcan2. I used the following patches.

for flexcan1:

diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi b/arch/arm/boot/dts/imx7-colibri.dtsi
index 4a1ef3f83faf..159aec421789 100644
--- a/arch/arm/boot/dts/imx7-colibri.dtsi
+++ b/arch/arm/boot/dts/imx7-colibri.dtsi
@@ -134,7 +134,7 @@
 &flexcan1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_flexcan1>;
-	status = "disabled";
+	status = "okay";
 };
 
 &flexcan2 {
@@ -458,8 +458,6 @@
 
 	pinctrl_gpio7: gpio7-grp { /* Alternatively CAN1 */
 		fsl,pins = <
-			MX7D_PAD_ENET1_RGMII_RD3__GPIO7_IO3	0x14 /* SODIMM 55 */
-			MX7D_PAD_ENET1_RGMII_RD2__GPIO7_IO2	0x14 /* SODIMM 63 */
 		>;
 	};
 
@@ -523,8 +521,8 @@
 
 	pinctrl_flexcan1: flexcan1-grp {
 		fsl,pins = <
-			MX7D_PAD_ENET1_RGMII_RD3__FLEXCAN1_TX	0x79 /* SODIMM 55 */
-			MX7D_PAD_ENET1_RGMII_RD2__FLEXCAN1_RX	0x79 /* SODIMM 63 */
+			MX7D_PAD_ENET1_RGMII_RD3__FLEXCAN1_TX	0x59 /* SODIMM 55 */
+			MX7D_PAD_ENET1_RGMII_RD2__FLEXCAN1_RX	0x59 /* SODIMM 63 */
 		>;
 	};
 
-- 

for flexcan2

diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi b/arch/arm/boot/dts/imx7-colibri.dtsi
index 159aec421789..4c6f5b6856c5 100644
--- a/arch/arm/boot/dts/imx7-colibri.dtsi
+++ b/arch/arm/boot/dts/imx7-colibri.dtsi
@@ -413,12 +413,10 @@
 			MX7D_PAD_SD1_CD_B__GPIO5_IO0		0x74 /* SODIMM 69 */
 			MX7D_PAD_I2C4_SDA__GPIO4_IO15		0x14 /* SODIMM 75 */
 			MX7D_PAD_ECSPI1_MISO__GPIO4_IO18	0x14 /* SODIMM 79 */
-			MX7D_PAD_I2C3_SCL__GPIO4_IO12		0x14 /* SODIMM 81 */
 			MX7D_PAD_ECSPI2_MISO__GPIO4_IO22	0x14 /* SODIMM 85 */
 			MX7D_PAD_ECSPI1_SS0__GPIO4_IO19		0x14 /* SODIMM 97 */
 			MX7D_PAD_ECSPI1_SCLK__GPIO4_IO16	0x14 /* SODIMM 101 */
 			MX7D_PAD_ECSPI1_MOSI__GPIO4_IO17	0x14 /* SODIMM 103 */
-			MX7D_PAD_I2C3_SDA__GPIO4_IO13		0x14 /* SODIMM 94 */
 			MX7D_PAD_I2C4_SCL__GPIO4_IO14		0x14 /* SODIMM 96 */
 			MX7D_PAD_SD2_RESET_B__GPIO5_IO11	0x14 /* SODIMM 98 */
 		>;
@@ -528,8 +526,8 @@
 
 	pinctrl_flexcan2: flexcan2-grp {
 		fsl,pins = <
-			MX7D_PAD_GPIO1_IO14__FLEXCAN2_RX	0x79 /* SODIMM 188 */
-			MX7D_PAD_GPIO1_IO15__FLEXCAN2_TX	0x79 /* SODIMM 178 */
+			MX7D_PAD_I2C3_SCL__FLEXCAN2_RX		0x59 /* SODIMM 81 */
+			MX7D_PAD_I2C3_SDA__FLEXCAN2_TX		0x59 /* SODIMM 94 */
 		>;
 	};
 
diff --git a/arch/arm/boot/dts/imx7d-colibri-emmc-eval-v3.dts b/arch/arm/boot/dts/imx7d-colibri-emmc-eval-v3.dts
index a2164e979606..d6d02525a1b1 100644
--- a/arch/arm/boot/dts/imx7d-colibri-emmc-eval-v3.dts
+++ b/arch/arm/boot/dts/imx7d-colibri-emmc-eval-v3.dts
@@ -21,3 +21,9 @@
 	vbus-supply = <&reg_usbh_vbus>;
 	status = "okay";
 };
+
+&flexcan2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_flexcan2>;
+	status = "okay";
+};
-- 

After boot and enabling both interfaces in dmesg is this output

[    6.255424] flexcan 30a00000.can: device registered (reg_base=f5a00000, irq=59)
[    6.325845] flexcan 30a10000.can: device registered (reg_base=f5a10000, irq=60)

I used cansend and candump to send and receive a message but nothing happened.

I use linux- toradex branch toradex_4.9-2.3.x-imx.
any advice which can help me?

Hello @nmarandi and Welcome to the Toradex Community!

Which carrier board are you using? Could you share the dmesg log in a file?

I used cansend and candump to send and receive a message but nothing happened.

Did you connect a CAN Transceiver to the CAN pins on the carrier board and the CAN Transceiver to a CAN Node (Device)? If not, then the communication won’t work.

Best regards,
Jaski

It’s custom board. I test this board with tx28 and worked perfectly.

It’s custom board. I test this board with tx28 and worked perfectly.

What do you mean with tx28?

sorry for late reply. I have other custom carrier board with ka-ro tx28. it’s work perfectly with a CAN Transceiver.

and, I add the full dmseg log to the attachment link text.

thank you for your reply, the problem was for my CAN Transceiver. I fix it by replacing it with another one.

Perfect, that it works. Thanks for the feedback.