Hi maxgerhardt,
Thank you for the quick response. It’s much appreciated.
The reason I use a custom overlay is because the ST7789 Waveshare 240x240 display that I have doesn’t have the standard Arduino connector pins. It’s a standalone display that is hooked up to a Particle Xenon board, using the SPI MOSI/SCK & GPIOs for CS/DC.
The Generic ST7789 display shield can only be used with a board that provides a configuration for Arduino connectors and defines node aliases for SPI and GPIO interfaces, as per Generic ST7789V Display Shield — Zephyr Project Documentation
If I build the lvgl sample for nrf52840dk_nrf52840, which has an Arduino connector, the generated devicetree has entries for the ST7789V device.
west build -b nrf52840dk_nrf52840 . -- -DSHIELD=st7789v_waveshare_240x240
I tried using
- zephyr/samples/display/lvgl/prj.conf
- build_flags = -DSHIELD=st7789v_waveshare_240x240
- zephyr/samples/display/lvgl/src/main.c
- with and without particle_xenon.overlay
Results
Without the particle_xenon.overlay
Under debug, the call in main.c to device_get_binding(CONFIG_LVGL_DISPLAY_DEV_NAME) has CONFIG_LVGL_DISPLAY_DEV_NAME = “DISPLAY”
The devicetree (devicetree_unfixed.h) shows
- No entries for ST7789v
- SPI_0, SPI_1 and SPI_3 have status = “disabled”
- SPI_2 has status = “okay”, details below.
- LVGL_DISPLAY_DEV_NAME set to “DISPLAY”
- SSPI MOSI/SCK, etc set to Arduino Connector Pins (expected default for the Generic ST7789V shield)
/* Generic property macros: /
#define DT_N_S_soc_S_spi_40023000_P_miso_pull_up 0
#define DT_N_S_soc_S_spi_40023000_P_miso_pull_up_EXISTS 1
#define DT_N_S_soc_S_spi_40023000_P_miso_pull_down 0
#define DT_N_S_soc_S_spi_40023000_P_miso_pull_down_EXISTS 1
#define DT_N_S_soc_S_spi_40023000_P_reg {1073885184 / 0x40023000 /, 4096 / 0x1000 /}
#define DT_N_S_soc_S_spi_40023000_P_reg_IDX_0 1073885184
#define DT_N_S_soc_S_spi_40023000_P_reg_IDX_1 4096
#define DT_N_S_soc_S_spi_40023000_P_reg_EXISTS 1
#define DT_N_S_soc_S_spi_40023000_P_interrupts {35 / 0x23 /, 1 / 0x1 */}
#define DT_N_S_soc_S_spi_40023000_P_interrupts_IDX_0 35
#define DT_N_S_soc_S_spi_40023000_P_interrupts_IDX_1 1
#define DT_N_S_soc_S_spi_40023000_P_interrupts_EXISTS 1
#define DT_N_S_soc_S_spi_40023000_P_sck_pin 19
#define DT_N_S_soc_S_spi_40023000_P_sck_pin_EXISTS 1
#define DT_N_S_soc_S_spi_40023000_P_mosi_pin 20
#define DT_N_S_soc_S_spi_40023000_P_mosi_pin_EXISTS 1
#define DT_N_S_soc_S_spi_40023000_P_miso_pin 21
#define DT_N_S_soc_S_spi_40023000_P_miso_pin_EXISTS 1
#define DT_N_S_soc_S_spi_40023000_P_label “SPI_2”
#define DT_N_S_soc_S_spi_40023000_P_label_EXISTS 1
#define DT_N_S_soc_S_spi_40023000_P_cs_gpios_IDX_0_PH
#define DT_N_S_soc_S_spi_40023000_P_cs_gpios_IDX_0_VAL_pin 17
#define DT_N_S_soc_S_spi_40023000_P_cs_gpios_IDX_0_VAL_pin_EXISTS 1
#define DT_N_S_soc_S_spi_40023000_P_cs_gpios_IDX_0_VAL_flags 1
#define DT_N_S_soc_S_spi_40023000_P_cs_gpios_IDX_0_VAL_flags_EXISTS 1
#define DT_N_S_soc_S_spi_40023000_P_cs_gpios_LEN 1
#define DT_N_S_soc_S_spi_40023000_P_cs_gpios_EXISTS 1
#define DT_N_S_soc_S_spi_40023000_P_status “okay”
#define DT_N_S_soc_S_spi_40023000_P_status_ENUM_IDX 1
#define DT_N_S_soc_S_spi_40023000_P_status_EXISTS 1
Serial UART0 Output:
17:07:59.067 -> *** Booting Zephyr OS build zephyr-v20400 ***
17:07:59.067 -> [00:00:00.254,760] e[1;31m<err> lvgl: Display device not found.e[0m
17:07:59.067 -> [00:00:00.254,791] e[1;31m<err> app: Device DISPLAY not found. Aborting test.e[0m
With the particle_xenon.overlay
The devicetree (devicetree_unfixed.h) shows
-
SPI_2 has status = “okay”
-
Correct GPIO entries for the Xenon SPI MOSI, SPI SCK, and CS
-
Correct entries for ST7789v, including DC & RST match the overlay values
-
According to the zephyr/boards/shields/st7789v_generic/Kconfig.defconfig,
if (DISPLAY && LVGL && SHIELD_ST7789V_WAVESHARE_240X240) CONFIG_LVGL_DISPLAY_DEV_NAME = “ST7789V” -
However, find that CONFIG_LVGL_DISPLAY_DEV_NAME = “DISPLAY”
-
Call to device_get_binding(CONFIG_LVGL_DISPLAY_DEV_NAME) return a NULL pointer.
-
Call to device_get_binding(DT_LABEL(DT_INST(0, sitronix_st7789v)) gets the ST7789V device but the call to device_get_binding() still returns a NULL pointer.
21:02:52.168 → *** Booting Zephyr OS build zephyr-v20400 ***
21:02:52.168 → [00:00:00.254,760] e[1;31m lvgl: Display device not found.e[0m
21:02:52.168 → [00:00:00.254,791] e[1;31m app: Device ST7789V not found. Aborting test.e[0m
It seems that something is still not quite right with the configuration.
Anything else I should try, before I reach out to the Zephyr folks?