Im trying to use lvgl with ST7789v display and nRF52832, in nRF Connect.
My .overlay:
#include <zephyr/dt-bindings/display/panel.h>
/ {
chosen {
zephyr,display = &st7789v;
};
};
&pinctrl {
spi0_default: spi0_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 27)>,
<NRF_PSEL(SPIM_MOSI, 0, 26)>,
<NRF_PSEL(SPIM_MISO, 0, 29)>;
};
};
spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 27)>,
<NRF_PSEL(SPIM_MOSI, 0, 26)>,
<NRF_PSEL(SPIM_MISO, 0, 29)>;
low-power-enable;
};
};
&spi0 {
compatible = "nordic,nrf-spim";
status = "okay";
pinctrl-0 = <&spi0_default>;
pinctrl-1 = <&spi0_sleep>;
cs-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
pinctrl-names = "default", "sleep";
st7789v: st7789v@0 {
compatible = "sitronix,st7789v";
label = "ST7789V";
spi-max-frequency = <20000000>;
reg = <0>;
cmd-data-gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
reset-gpios = <&gpio0 30 GPIO_ACTIVE_LOW>;
width = <240>;
height = <240>;
x-offset = <0>;
y-offset = <0>;
vcom = <0x19>;
gctrl = <0x35>;
vrhs = <0x12>;
vdvs = <0x20>;
mdac = <0x00>;
lcm = <0x2c>;
colmod = <0x05>;
gamma = <0x01>;
porch-param = [0c 0c 00 33 33];
cmd2en-param = [5a 69 02 01];
pwctrl1-param = [a4 a1];
pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23];
nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23];
ram-param = [00 F0];
rgb-param = [CD 08 14];
};
};
};
My prj.conf:
# Enable logging and RTT DEBUG output CONFIG_LOG=y CONFIG_LOG_MODE_IMMEDIATE=y CONFIG_USE_SEGGER_RTT=y CONFIG_LOG_BACKEND_RTT=y CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD=1 CONFIG_LOG_PRINTK=y CONFIG_LOG_MODE_DEFERRED=n # LVGL CONFIG_LV_Z_MEM_POOL_SIZE=16384 CONFIG_LV_Z_SHELL=y CONFIG_MAIN_STACK_SIZE=2048 CONFIG_DISPLAY=y CONFIG_DISPLAY_LOG_LEVEL_ERR=y CONFIG_SHELL=y CONFIG_LVGL=y CONFIG_LV_MEM_CUSTOM=y CONFIG_LV_USE_LOG=y CONFIG_LV_USE_LABEL=y CONFIG_LV_USE_BTN=y CONFIG_LV_USE_ARC=y CONFIG_LV_USE_IMG=y CONFIG_LV_USE_MONKEY=y CONFIG_LV_FONT_MONTSERRAT_14=y
When I enable LVGL and build, i got the error:
In file included from /home/santos/ncs/v2.9.0/zephyr/include/zephyr/arch/arm/arch.h:20,
from /home/santos/ncs/v2.9.0/zephyr/include/zephyr/arch/cpu.h:19,
from /home/santos/ncs/v2.9.0/zephyr/include/zephyr/kernel_includes.h:36,
from /home/santos/ncs/v2.9.0/zephyr/include/zephyr/kernel.h:17,
from /home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c:8:
/home/santos/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:2729:32: error: 'DT_CHOSEN_zephyr_display_P_width' undeclared here (not in a function); did you mean 'DT_CHOSEN_zephyr_sram_EXISTS'?
2729 | #define DT_CHOSEN(prop) DT_CAT(DT_CHOSEN_, prop)
| ^~~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:4879:29: note: in definition of macro 'DT_CAT3'
4879 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
| ^~
/home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c:35:24: note: in expansion of macro 'DT_PROP'
35 | #define DISPLAY_WIDTH DT_PROP(DISPLAY_NODE, width)
| ^~~~~~~
/home/santos/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:2729:25: note: in expansion of macro 'DT_CAT'
2729 | #define DT_CHOSEN(prop) DT_CAT(DT_CHOSEN_, prop)
| ^~~~~~
/home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c:29:22: note: in expansion of macro 'DT_CHOSEN'
29 | #define DISPLAY_NODE DT_CHOSEN(zephyr_display)
| ^~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c:35:32: note: in expansion of macro 'DISPLAY_NODE'
35 | #define DISPLAY_WIDTH DT_PROP(DISPLAY_NODE, width)
| ^~~~~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c:40:35: note: in expansion of macro 'DISPLAY_WIDTH'
40 | ((CONFIG_LV_Z_VDB_SIZE * DISPLAY_WIDTH * DISPLAY_HEIGHT) / 100) / 8)
| ^~~~~~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c:48:21: note: in expansion of macro 'BUFFER_SIZE'
48 | static uint8_t buf0[BUFFER_SIZE]
| ^~~~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:2729:32: error: 'DT_CHOSEN_zephyr_display_P_height' undeclared here (not in a function)
2729 | #define DT_CHOSEN(prop) DT_CAT(DT_CHOSEN_, prop)
| ^~~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:4879:29: note: in definition of macro 'DT_CAT3'
4879 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
| ^~
/home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c:36:24: note: in expansion of macro 'DT_PROP'
36 | #define DISPLAY_HEIGHT DT_PROP(DISPLAY_NODE, height)
| ^~~~~~~
/home/santos/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:2729:25: note: in expansion of macro 'DT_CAT'
2729 | #define DT_CHOSEN(prop) DT_CAT(DT_CHOSEN_, prop)
| ^~~~~~
/home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c:29:22: note: in expansion of macro 'DT_CHOSEN'
29 | #define DISPLAY_NODE DT_CHOSEN(zephyr_display)
| ^~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c:36:32: note: in expansion of macro 'DISPLAY_NODE'
36 | #define DISPLAY_HEIGHT DT_PROP(DISPLAY_NODE, height)
| ^~~~~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c:40:51: note: in expansion of macro 'DISPLAY_HEIGHT'
40 | ((CONFIG_LV_Z_VDB_SIZE * DISPLAY_WIDTH * DISPLAY_HEIGHT) / 100) / 8)
| ^~~~~~~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c:48:21: note: in expansion of macro 'BUFFER_SIZE'
48 | static uint8_t buf0[BUFFER_SIZE]
| ^~~~~~~~~~~
In file included from /home/santos/ncs/v2.9.0/zephyr/include/zephyr/toolchain/gcc.h:98,
from /home/santos/ncs/v2.9.0/zephyr/include/zephyr/toolchain.h:50,
from /home/santos/ncs/v2.9.0/zephyr/include/zephyr/sys/util.h:18,
from /home/santos/ncs/v2.9.0/zephyr/include/zephyr/init.h:13,
from /home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c:7:
/home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c: In function 'lvgl_init':
/home/santos/ncs/v2.9.0/zephyr/include/zephyr/device.h:92:41: error: '__device_dts_ord_DT_CHOSEN_zephyr_display_ORD' undeclared (first use in this function)
92 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
137 | #define _DO_CONCAT(x, y) x ## y
| ^
/home/santos/ncs/v2.9.0/zephyr/include/zephyr/device.h:92:33: note: in expansion of macro '_CONCAT'
92 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~
/home/santos/ncs/v2.9.0/zephyr/include/zephyr/device.h:229:37: note: in expansion of macro 'DEVICE_NAME_GET'
229 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
| ^~~~~~~~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/include/zephyr/device.h:246:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
246 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
| ^~~~~~~~~~~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c:200:44: note: in expansion of macro 'DEVICE_DT_GET'
200 | const struct device *display_dev = DEVICE_DT_GET(DISPLAY_NODE);
| ^~~~~~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/include/zephyr/device.h:92:41: note: each undeclared identifier is reported only once for each function it appears in
92 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
137 | #define _DO_CONCAT(x, y) x ## y
| ^
/home/santos/ncs/v2.9.0/zephyr/include/zephyr/device.h:92:33: note: in expansion of macro '_CONCAT'
92 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~
/home/santos/ncs/v2.9.0/zephyr/include/zephyr/device.h:229:37: note: in expansion of macro 'DEVICE_NAME_GET'
229 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
| ^~~~~~~~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/include/zephyr/device.h:246:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
246 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
| ^~~~~~~~~~~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c:200:44: note: in expansion of macro 'DEVICE_DT_GET'
200 | const struct device *display_dev = DEVICE_DT_GET(DISPLAY_NODE);
| ^~~~~~~~~~~~~
/home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c: At top level:
/home/santos/ncs/v2.9.0/zephyr/modules/lvgl/lvgl.c:48:16: warning: 'buf0' defined but not used [-Wunused-variable]
48 | static uint8_t buf0[BUFFER_SIZE]
| ^~~~
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /home/santos/ncs/toolchains/b77d8c1312/usr/local/bin/cmake --build /home/santos/Documents/auraZephyr/aura/build/aura
Could you please help me resolve this issue?