I'm trying to use an ILI9341 display with nRF52840 in Zephyr (v4.1.99). The build fails with multiple errors about missing Devicetree properties when compiling display_ili9xxx.c:
error: 'DT_N_S_soc_S_spi_40003000_S_ili9341_0_P_gamset_LEN' undeclared error: 'DT_N_S_soc_S_spi_40003000_S_ili9341_0_P_ifctl' undeclared error: 'DT_N_S_soc_S_spi_40003000_S_ili9341_0_P_etmod' undeclared [20+ similar property errors...]
This is my overlay file:
&spi1 {
status = "okay";
cs-gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
ili9341: ili9341@0 {
compatible = "ilitek,ili9341";
reg = <0>;
spi-max-frequency = <8000000>;
// Add these required properties:
spi-cpol;
spi-cpha;
dc-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
reset-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
backlight-gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
// Add display inversion mode (try true or false)
display-inversion;
// or display-inversion = <1>;
// or display-inversion = <0>; if the first doesn't work
width = <240>;
height = <320>;
rotation = <0>;
// These might help if you still have issues:
pixel-format = "rgb565";
// cmd-data-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; // Alternative to dc-gpios
};
};
I tried fixing the issue by modifying the prj.conf file, but it's still not working. Here's my current prj.conf:
CONFIG_SPI=y CONFIG_GPIO=y CONFIG_DISPLAY=y CONFIG_DISPLAY_INIT_PRIORITY=90 CONFIG_ILI9341=y
This is part from zephyr.dts which include spi1:
spi1: spi@40004000 {
compatible = "nordic,nrf-spi";
#address-cells = < 0x1 >;
#size-cells = < 0x0 >;
reg = < 0x40004000 0x1000 >;
interrupts = < 0x4 0x1 >;
max-frequency = < 0x7a1200 >;
easydma-maxcnt-bits = < 0x10 >;
status = "okay";
pinctrl-0 = < &spi1_default >;
pinctrl-1 = < &spi1_sleep >;
pinctrl-names = "default", "sleep";
cs-gpios = < &gpio0 0xf 0x1 >;
ili9341: ili9341@0 {
compatible = "ilitek,ili9341";
reg = < 0x0 >;
spi-max-frequency = < 0x7a1200 >;
spi-cpol;
spi-cpha;
dc-gpios = < &gpio0 0xe 0x1 >;
reset-gpios = < &gpio0 0xd 0x1 >;
backlight-gpios = < &gpio0 0x10 0x0 >;
display-inversion;
width = < 0xf0 >;
height = < 0x140 >;
rotation = < 0x0 >;
pixel-format = "rgb565";
};
};