CAN on Colibri iMX8X on Aster Carrier Board

Dear Community,

I’m working with the Colibri iMX8X and an Aster Carrier Board to set the CAN. Since the documentation for this module isn’t ready, I’m using the available documentation here and here as a guide, but there are still some differences.

I opened the files fsl-imx8qxp-colibri-aster.dts and fsl-imx8qxp-colibri.dtsi from the linux-toradex git (Version: toradex_4.14-2.0.x-imx) and this the following changes:

ec@ec:~$ diff -u ~/fsl-imx8qxp-colibri-aster_original.dts ~/linux-toradex/arch/arm64/boot/dts/freescale/fsl-imx8qxp-colibri-aster.dts 
--- /home/ec/fsl-imx8qxp-colibri-aster_original.dts	2020-03-10 12:02:04.795095000 +0100
+++ /home/ec/linux-toradex/arch/arm64/boot/dts/freescale/fsl-imx8qxp-colibri-aster.dts	2020-03-11 08:45:32.634844761 +0100
@@ -102,6 +102,10 @@
 	status = "okay";
 };
 
+&can1 {
+	status = "okay";
+};
+
 /* Colibri SPI */
 &lpspi2 {
 	status = "okay";
ec@ec:~$ diff -u ~/fsl-imx8qxp-colibri_original.dtsi ~/linux-toradex/arch/arm64/boot/dts/freescale/fsl-imx8qxp-colibri.dtsi
--- /home/ec/fsl-imx8qxp-colibri_original.dtsi	2020-03-11 09:01:33.803521600 +0100
+++ /home/ec/linux-toradex/arch/arm64/boot/dts/freescale/fsl-imx8qxp-colibri.dtsi	2020-03-11 08:34:42.255913018 +0100
@@ -525,8 +525,8 @@
 		/* Colibri optional CAN on PS2 */
 		pinctrl_flexcan2: flexcan1grp {
 			fsl,pins = <
-				SC_P_FLEXCAN1_TX_ADMA_FLEXCAN1_TX		0x21		/* SODIMM  55 */
-				SC_P_FLEXCAN1_RX_ADMA_FLEXCAN1_RX		0x21		/* SODIMM  63 */
+				SC_P_FLEXCAN1_TX_ADMA_FLEXCAN1_TX		0x06000021		/* SODIMM  55 */
+				SC_P_FLEXCAN1_RX_ADMA_FLEXCAN1_RX		0x06000021		/* SODIMM  63 */
 			>;
 		};

At this point when I run the command make dtbs I get the following mistake:

ec@ec:~/linux-toradex$ make dtbs
  CHK     include/config/kernel.release
  UPD     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  CHK     include/generated/bounds.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CHK     scripts/mod/devicetable-offsets.h
  DTC     arch/arm64/boot/dts/freescale/fsl-imx8qxp-colibri-aster.dtb
Error: arch/arm64/boot/dts/freescale/fsl-imx8qxp-colibri-aster.dts:105.1-6 Label or path can1 not found
FATAL ERROR: Syntax error parsing input tree
scripts/Makefile.lib:317: recipe for target 'arch/arm64/boot/dts/freescale/fsl-imx8qxp-colibri-aster.dtb' failed
make[2]: *** [arch/arm64/boot/dts/freescale/fsl-imx8qxp-colibri-aster.dtb] Error 1
scripts/Makefile.build:585: recipe for target 'arch/arm64/boot/dts/freescale' failed
make[1]: *** [arch/arm64/boot/dts/freescale] Error 2
arch/arm64/Makefile:138: recipe for target 'dtbs' failed
make: *** [dtbs] Error 2

Thanks for the help. Kind regards.

In the meantime I found out that the in the fsl-imx8qxp-colibri-aster.dts it is not called &canX but &flexcanX. I’m still not sure about the changes that need to be done on the fsl-imx8qxp-colibri.dtsi

I tried adding this to my image to install it via Toradex Easy Installer, the image is shown, but it says that the image is not correct when I try to installed it.

Kind regards.

Hi @jaski.tx,
thank you for the information on the UMS. When making the changes over this method, can I just copy/paste the device-tree wanted or do I have to use sudo rights?

Here are the changes:

ec@ec:~$ diff -u ~/linux-toradex/arch/arm64/boot/dts/freescale/fsl-imx8qxp-colibri-aster.dts ~/fsl-imx8qxp-colibri-aster_original.dts 
--- /home/ec/linux-toradex/arch/arm64/boot/dts/freescale/fsl-imx8qxp-colibri-aster.dts	2020-03-11 10:58:03.846758221 +0100
+++ /home/ec/fsl-imx8qxp-colibri-aster_original.dts	2020-03-10 12:02:04.795095000 +0100
@@ -102,18 +102,6 @@
 	status = "okay";
 };
 
-&flexcan1 {
-	status = "okay";
-};
-
-&flexcan2 {
-	status = "okay";
-};
-
-&flexcan3 {
-	status = "okay";
-};
-
 /* Colibri SPI */
 &lpspi2 {
 	status = "okay";
ec@ec:~$ diff -u ~/linux-toradex/arch/arm64/boot/dts/freescale/fsl-imx8qxp-colibri.dtsi ~/fsl-imx8qxp-colibri_original.dtsi 
--- /home/ec/linux-toradex/arch/arm64/boot/dts/freescale/fsl-imx8qxp-colibri.dtsi	2020-03-11 08:34:42.255913018 +0100
+++ /home/ec/fsl-imx8qxp-colibri_original.dtsi	2020-03-11 09:01:33.803521600 +0100
@@ -525,8 +525,8 @@
 		/* Colibri optional CAN on PS2 */
 		pinctrl_flexcan2: flexcan1grp {
 			fsl,pins = <
-				SC_P_FLEXCAN1_TX_ADMA_FLEXCAN1_TX		0x06000021		/* SODIMM  55 */
-				SC_P_FLEXCAN1_RX_ADMA_FLEXCAN1_RX		0x06000021		/* SODIMM  63 */
+				SC_P_FLEXCAN1_TX_ADMA_FLEXCAN1_TX		0x21		/* SODIMM  55 */
+				SC_P_FLEXCAN1_RX_ADMA_FLEXCAN1_RX		0x21		/* SODIMM  63 */
 			>;
 		};

I’m not sure about the changes I’ve done, since the documentation to this colibri isn’t available.

Hi

You can just copy the compiled device-tree without devicetree.

Please have a look here too.

Best regards,
Jask

Hi @jaski.tx,

I’m sorry what do you mean with

You can just copy the compiled device-tree without devicetree.

Thanks, best regards.

hi @cae30989

Sorry I wanted to write: You can just copy the compiled device-tree without sudo rights.

Best regards,
Jaski

Thank you @jaski.tx. Everything is working perfectly!

Perfect. Thanks for your feedback.

Perfect that you made some progress.

What did you change exactly ( git diff )?

For flashing the custom device-tree, you can take a regular image and replace the device-tree file and flash the complete image using Toradex easy installer.
A simple and fast alternative is to mount the internal Flash of SoM as UMS on your host and copy the new devicetree in the boot partition.

Best regards,
Jaski