"Device ST7789V not found" with ST7789V Waveshare 240x240 display under Zephyr

Hi maxgerhardt,

I’ve resolved the issues with the ST7789V.

In a fresh review of the particle_xenon.overlay, I noticed a silly oversight on my part!

I forgot to include the vendor hardware property for the SPI node. It isn’t set in the nrf52840.dtsi but is a required property, and can be “nordic,nrf-spi”, or “nordic,nrf-spim”, or “nordic,nrf-spis”.

Here is the revised particle_xenon.overlay definition.

&spi0 {
	compatible = "nordic,nrf-spi";
	status = "okay";
	sck-pin =  <47>;
	mosi-pin = <45>;
	miso-pin = <46>;
	cs-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; /* D4 */ 

	st7789v@0 {
		compatible = "sitronix,st7789v";
		label = "ST7789V";
		spi-max-frequency = <20000000>;
		reg = <0>;
		cmd-data-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;  /* D5 */
		reset-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; /* RESET */
		width = <240>;
		height = <240>;
		x-offset = <0>;
		y-offset = <0>;
		vcom = <0x19>;
		gctrl = <0x35>;
		vrhs = <0x12>;
		vdvs = <0x20>;
		mdac = <0x00>;
		gamma = <0x01>;
		colmod = <0x05>;
		lcm = <0x2c>;
		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];
	};
};

and prj.conf

CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_MAIN_STACK_SIZE=2048

CONFIG_GPIO=y
CONFIG_SPI=y

CONFIG_DISPLAY=y
CONFIG_DISPLAY_LOG_LEVEL_ERR=y
CONFIG_ST7789V=y
CONFIG_ST7789V_RGB565=y

CONFIG_LVGL=y
CONFIG_LVGL_USE_LABEL=y
CONFIG_LVGL_DISPLAY_DEV_NAME="ST7789V"
CONFIG_LVGL_BITS_PER_PIXEL=16
CONFIG_LVGL_USE_CONT=y
CONFIG_LVGL_USE_BTN=y

CONFIG_LOG=y
CONFIG_PRINTK=y

and platformio.ini

[platformio]
default_envs = xenon

[env:xenon]
platform = nordicnrf52
framework = zephyr
board = particle_xenon
build_flags = -DSHIELD=st7789v_waveshare_240x240
upload_protocol = jlink
debug_tool = jlink
debug_init_break = tbreak main
monitor_speed = 115200

I have some reading to do on lvgl API, and also get the stt7789v display to run with stm32 (blackpill_f411ce).

Once again, thank you for the assistance. It’ much appreciated!

1 Like