Device tree overlay, Syntax Error

Hello all,

I am currently working on a device tree overlay to enable CAN on ecspi1 on a Verdin IMX8MM module. I have a custom carrier board which has a MCP25625 chip.

I am using a Toradex 6.2 as a base image, with the imx8mm-verdin-nonwifi-yavia device tree. Currently I am making a device tree overlay for our own board.

Below, the CAN section of the overlay is written down.

&ecspi1 {
	#address-cells = <1>;
	#size-cells = <0>;
	cs-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_ecspi1>;
	status = "okay";

	spidev@0 {
		/* Use compatible "rohm,dh2228fv" to bind spidev driver */
		compatible = "rohm,dh2228fv";
		reg = <0>;
		spi-max-frequency = <10000000>;

	can2: can@0 {
		compatible = "microchip,mcp25625";
		clocks = <&clk40m>;
		interrupt-parent = <&gpio1>;
		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
		// interrupts-extended = <&gpio1 0 IRQ_TYPE_LEVEL_LOW>;
		reg = <0>;
		spi-max-frequency = <8500000>;

The problem occurs in the line containing the interrupt pins. I can solve the syntax error by including the following file in the header: #include "imx8mm-pinfunc.h, but when I do this, the toradex module does not show any messages with regards to the SPI anymore. So this made me believe that this was not the good solution. However, I also do not know what I should do to avoid the syntax error.

Does anyone has an idea on how to solve this?

Kind regards,

Hello @xAnouk ,

Thanks for reaching out to us!
Could you please send the output of tdx-info : Getting Device Information with Tdx-Info | Toradex Developer Center
Also could you please post the error messages that you are receiving while building the device tree overlay and also the dmesg logs would be helpful.

Other than that, couldn’t help but notice a possible mistake in your device tree overlay. The spidev and can2 nodes use the same register addresses. Could you please try building it again by removing the whole block for spidev? Please let me know how that goes.

The problem with the syntax error was that I forgot to include one of the files.

I have removed the spidev, considering that I only need the can. Now the can code works.

Hello @xAnouk ,
Thanks for the update, and glad that the issue was finally solved :slight_smile:

Best regards,