I’m using Colibri-IMX6DL CoM in Aster V1.1 carrier board and tryng to change some characteristics of SPI (I need to reduce SPI clock frequency and use CS1). When I try to aply a devicetree overlay using torizoncore-builder I have a syntax error, but I really don’t know whats wrong with my (.dts) file. This is my .dts overlay file:
/dts-v1/;
/plugin/;
/ {
compatible = "toradex,colibri_imx6dl";
};
&ecspi4 {
fsl,spi-num-chipselects = <2>;
cs-gpios = <
&gpio5 2 GPIO_ACTIVE_HIGH
&gpio5 4 GPIO_ACTIVE_HIGH
>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi4 &pinctrl_csi_gpio_2>;
status = "okay";
spidev1: spidev@1 {
compatible = "toradex,evalspi";
reg = <1>;
spi-max-frequency = <500000>; /*500kHz*/
status = "okay";
};
};
And this is the error message:
Error: device-trees/overlays/colibri-imx6-aster-spi.dts:11.12-13 syntax error
FATAL ERROR: Unable to parse input tree
error: cannot apply device-trees/overlays/colibri-imx6-aster-spi.dts.
Hi @LincolnWallace , please specify cs pins by the following format.
cs-gpios =
<&gpio5 2 GPIO_ACTIVE_HIGH>,
<&gpio5 4 GPIO_ACTIVE_HIGH>;
I try this change but the same error still happen! 
That’s the whole message:
Downloading image from: https://artifacts.toradex.com/artifactory/torizoncore-oe-prod-frankfurt/dunfell-5.x.y/release/10/colibri-imx6/torizon-upstream/torizon-core-docker/oedeploy/torizon-core-docker-colibri-imx6-Tezi_5.4.0+build.10.tar
The download may take some time. Please wait…
Download Complete!
Unpacking Toradex Easy Installer image.
Copying Toradex Easy Installer image.
Unpacking TorizonCore Toradex Easy Installer image.
Importing OSTree revision 9d212c8f6e70968e138f49f9903acc5507a547eb9acf4067f19492c51d5cdfd8 from local repository…
1090 metadata, 12740 content objects imported; 412.2 MB content written
Unpacked OSTree from Toradex Easy Installer image:
Commit checksum: 9d212c8f6e70968e138f49f9903acc5507a547eb9acf4067f19492c51d5cdfd8
TorizonCore Version: 5.4.0+build.10
‘device-trees’ directory already exists
warning: --force was used, bypassing checking overlays against the device tree.
Error: device-trees/overlays/colibri-imx6-aster-spi.dts:11.15-16 syntax error
FATAL ERROR: Unable to parse input tree
error: cannot apply device-trees/overlays/colibri-imx6-aster-spi.dts.
I already try yo write:
cs-gpios = <
&gpio5 2 GPIO_ACTIVE_HIGH,
&gpio5 4 GPIO_ACTIVE_HIGH
>;
But it didn’t work too.
I tooke this part of code and modify from the Toradex Device-tree repository of github in the file imx6dl-colibri-aster.dts
I see a couple of issues with your overlay as is now.
First of all you’re using the pre-defined macro GPIO_ACTIVE_HIGH
. However you are not including the header file which actually includes the definition. Which results in a syntax error on that line as specified by the error message. You want to include the header file gpio.h
similar to what is shown in this other overlay: colibri-imx6ull_atmel-mxt-adapter_overlay.dts « overlays - device-tree-overlays.git - Sources for Device Tree Overlays
If you use the torizoncore-builder dt checkout
command this will create a repository that includes all the relevant device tree files including headers.
The next issue I see is pinctrl_csi_gpio_2
. Where is this pinctrl group being defined? Because it’s not anywhere in the base device tree, as far as I can tell.
Best Regards,
Jeremias
Thanks @jeremias.tx! It helps me a lot to fix it!
I’ve changed my code to this:
/dts-v1/;
/plugin/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "toradex,colibri_imx6dl";
};
&ecspi4 {
cs-gpios = <&gpio5 4 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi4>;
status = "okay";
spidev0: spidev@0 {
compatible = "toradex,evalspi";
reg = <0>;
spi-max-frequency = <500000>; /*500kHz*/
status = "okay";
};
};
And now the correct CS is triggering and the frequency is correct too.
Glad I could be of assistance!
1 Like