CAN on Colibri iMX8 DualX

Dear Community,

until now I have been working with a Colibri iMX6DL 512MB V1.1A, but given that the Colibri iMX8X might be a better option, I might change to it. But before any decision is made, I wanted to ask about the CAN usability. I looked at the documentation here, but there doesn’t seem to be any information about it. Same goes on the Device tree configuration and some other articles.

Is there more documentation regarding the Colibri iMX8X coming soon?

Thank you.

Kind regards.

Hi @cae30989

Thanks for writing to the Toradex Community!

We will update the Documentation for Colibri iMX8X. Meanwhile you can inspire for using Can Interface from other modules. There are three flexcan nodes in the devicetree which needs to be enabled. The Pins can be found in the Table 5-55CAN Signal Pins of the Datasheet of the module.

Please let us know if you have any question.

Best regards,
Jaski

Hello @jaski.tx,

we went ahead and got 3 Colibri iMX8X and two Viola Plus carrier boards. I was looking at the documentation where the device tree must be changed in order to enable the CAN, but I can’t find the dts file to the Viola Plus Carrier Board. Is there something I’m missing?

Thanks and best regards!

Hi @cae30989

There is no specific dts file for Viola Carrier Board. You can use the dts file for the Colibri Evaluation Board and modify for your use-case.

Best regards,
Jaski

Hi @jaski.tx,

thank you. I looked into the file where the device tree files are and I found the following files are available:

  • fsl-imx8qxp-colibri-eval-v3.dts (and many other that I don’t think are of use to us)
  • fsl-imx8qxp-colibri-eval-v3.dtsi
  • fsl-imx8qxp-colibri.dtsi

My question is: Which of the dtsi files do I have to modify?

Thanks and best regards.

Hi

It depends what you want to change.

So the nodes &flexcanX should be enabled in fsl-imx8qxp-colibri-eval-v3.dts and the pinmuxing in fsl-imx8qxp-colibri.dtsi.

Best regards,
Jaski

Hi @jaski.tx,

I actually just need to enable the CAN that corresponds to the pins 63/55. Enabling the &flexcanX is okay, but the changes of the pinmuxing in the dtsi-file is where I’m not sure, since the file is very different to the e.g. imx6qdl-colibri.dtsi (which I’ve modified before).

On the fsl-imx8qxp-colibri.dtsi the following is written to the flexcan:

/* Colibri optional CAN on UART_B RTS/CTS */
		pinctrl_flexcan1: flexcan0grp {
			fsl,pins = <
				SC_P_FLEXCAN0_TX_ADMA_FLEXCAN0_TX		0x21		/* SODIMM  32 */
				SC_P_FLEXCAN0_RX_ADMA_FLEXCAN0_RX		0x21		/* SODIMM  34 */
			>;
		};

		/* 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 */
			>;
		};

		/* Colibri optional CAN on UART_A TXD/RXD */
		pinctrl_flexcan3: flexcan2grp {
			fsl,pins = <
				SC_P_FLEXCAN2_TX_ADMA_FLEXCAN2_TX		0x21		/* SODIMM  35 */
				SC_P_FLEXCAN2_RX_ADMA_FLEXCAN2_RX		0x21		/* SODIMM  33 */
			>;
		};

Instead of the 0x21, what should be written there. Also, is there something that should be deleted or commented out?

Thank you. Best regards.

HI @cae30989

You need to do the following changes to enable flexcan1 and flexcan2. Enabling flexcan2 will need to disable UARTB since the Pins are shared with UARTB. Enabling flexcan3 will need to disable UARTA, which is used as default console output.

diff --git a/arch/arm64/boot/dts/freescale/fsl-imx8qxp-colibri-eval-v3.dtsi b/arch/arm64/boot/dts/freescale/fsl-imx8qxp-colibri-eval-v3.dtsi
index 8fe89b10aa6a..10267a48eae8 100644
--- a/arch/arm64/boot/dts/freescale/fsl-imx8qxp-colibri-eval-v3.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-imx8qxp-colibri-eval-v3.dtsi
@@ -141,7 +141,7 @@
 
 /* Colibri UART_B */
 &lpuart0 {
-       status = "okay";
+       status = "disabled";
 };
 
 /* Colibri UART_C */
@@ -206,3 +206,13 @@
 &vpu_encoder {
        status = "okay";
 };
+
+/* Colibri optional CAN on UART_B RTS/CTS */
+&flexcan1 {
+       status = "okay";
+};
+
+/* Colibri optional CAN on PS2 */
+&flexcan2 {
+       status = "okay";
+};

Best regards,
Jaski

Thank you very much! It work perfectly.

Perfect. Thanks for the feedback.