Yocto build crashes when enabling CAN on Torizon 5.2 & 5.3

I’ve have built this many times before on both Torizon 4 & Torizon 5, but it results in a build error when building for 5.2 & 5.3. Everything works except when i try to enable any of the flexcan devices.
Is this a bug or have you changed anything related to enabling the can devices?

Kernel is the latest available you have provided
branch: toradex_5.4-2.3.x-imx
Kernel: 5.4.91
Latest commit may 4th

ERROR: Task (/home/developer/yocto-torizon-5/build/conf/…/…/layers/meta-toradex-nxp/recipes-kernel/linux/linux-toradex_5.4-2.3.x.bb:do_compile) failed with exit code ‘1’

Here is a snippet from my device tree patch containing all changes, which is disabled uart … this works fine … but if I enable anyone of the 3 flexcan the patching process crashes when building the project.

/* Colibri SPI */
&lpspi2 {
        mcp2515: can@0 {
                compatible = "microchip,mcp2515";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_can_int>;
                reg = <0>;
                clocks = <&clk16m>;
                interrupt-parent = <&lsio_gpio3>;
                interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
                spi-max-frequency = <10000000>;
                status = "okay";
        };
	/* To keep the CAN controller enabled by default,
	 * disable conflicting spidev. This spidev device
	 * enables with the devicetree overlay.
	 */
	spidev0: spidev@0 {
		status = "disabled";
	};
};

&flexcan1 {
	status = "okay";
}

&flexcan2 {
	status = "okay";
}

&flexcan3 {
	status = "okay";
}

/* Colibri UART_B */
&lpuart0 {
	status = "disabled";
};

/* Colibri UART_C */
&lpuart2 {
	status = "disabled";
};

/* Colibri UART_A */
&lpuart3 {
	status= "disabled";
};

//Best wishes Martin!

Greetings @Masj,

I just did a build and the following patch works fine for me:

diff --git a/arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtsi b/arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtsi
index 196e1d2fe357..27e07d32eade 100644
--- a/arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtsi
@@ -100,17 +100,17 @@

 /* Colibri UART_B */
 &lpuart0 {
-       status = "okay";
+       status = "disabled";
 };

 /* Colibri UART_C */
 &lpuart2 {
-       status = "okay";
+       status = "disabled";
 };

 /* Colibri UART_A */
 &lpuart3 {
-       status= "okay";
+       status = "disabled";
 };

 &lsio_gpio3 {
diff --git a/arch/arm64/boot/dts/freescale/imx8qxp-colibri.dtsi b/arch/arm64/boot/dts/freescale/imx8qxp-colibri.dtsi
index 45902f4cbe27..13196c498ac9 100644
--- a/arch/arm64/boot/dts/freescale/imx8qxp-colibri.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8qxp-colibri.dtsi
@@ -343,6 +343,7 @@
         pinctrl-names = "default";
         pinctrl-0 = <&pinctrl_flexcan1>;
         xceiver-supply = <&reg_module_3v3>;
+        status = "okay";
 };

 /* Colibri optional CAN on PS2 */
@@ -350,6 +351,7 @@
         pinctrl-names = "default";
         pinctrl-0 = <&pinctrl_flexcan2>;
         xceiver-supply = <&reg_module_3v3>;
+        status = "okay";
 };

 /* Colibri optional CAN on UART_A TXD/RXD */
@@ -357,6 +359,7 @@
         pinctrl-names = "default";
         pinctrl-0 = <&pinctrl_flexcan3>;
         xceiver-supply = <&reg_module_3v3>;
+        status = "okay";
 };

 &gpu_3d0 {

Can you check the actual Yocto logs for what the exact error that caused the task to fail. Also just to check I noticed in the snippet you provided you’re missing the semi-colon for the flexcan nodes. Is this the issue or is it just like that in the snippet you provided?

Best Regards,
Jeremias

Both solutions worked fine!

Thanks a lot Jeremias I must have spent to long staring at this to see the missing ;

//Best Regards Martin

Glad I could help!