I am trying to use LVGL to display text in application which run on Zephyr.
I found the driver available for display: zephyr/drivers/display/display_st7789v.c at main · zephyrproject-rtos/zephyr · GitHub
My application is compiled and running, however I cannot see any text display.
I tested display earlier without library and working fine.
Anything missing in prj.conf and DTS file (Refer below section for DTS node and prj.conf)?
Do I need to call any initialization function before calling example function?
What MCU/Processor/Board and compiler are you using?
MCU : STM32H5 series, Display: ST7789
What do you want to achieve?
I wanted to run LVGL in Zephyr application and display simple text.
Added Display node in SPI node as display is connected to MCU over SPI.
DTS node:
chosen {
zephyr,display = &display;
};
&spi5{
status = "okay";
pinctrl-names = "default";
display:st7789v@0{
compatible = "sitronix,st7789v";
reg = <0>;
spi-max-frequency = <5000000>;
width = <320>;
height = <240>;
.
.
.
All required properties here
};
};
3. compile and flash the application code.
Code to reproduce
/**
Basic example to create a “Hello world” label
*/
void lv_example_get_started_1(void)
{
/Change the active screen’s background color/
lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0x003a57), LV_PART_MAIN);
/Create a white label, set its text and align it to the center/
lv_obj_t * label = lv_label_create(lv_screen_active());
lv_label_set_text(label, “Hello world”);
lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0xffffff), LV_PART_MAIN);
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
}
## Screenshot and/or video
If possible, add screenshots and/or videos about the current state.
Hi @FW_developer,
recently I used st7789v and LVGL library under Zephyr and it works, so I can say that you have wrong device-tree definition.
st7789v uses mipi-dbi bus instead of SPI (in simple words mipi-dbi is SPI with additional pins).
In my case device-tree definition looks as follows:
@Rik Thanks for response and it worked on SPI as well with changes mdac = <0x60>; // rotates by 270 degrees.
Only issue I can see is my screen background is flickering which is easily noticeable.
What could be the reason? Is it something related to LVGL settings?
I checked refresh period ( LV_DEF_REFR_PERIOD ), and it is default and 30 msec.
@FW_developer - I’d suggest to fix your dts file. You should define st7789v under MIPI-DBI node as in my example. In your current implementation there is no definition for RESET and DC pin which may lead to unexpected behaviors (as flickering screen background).
@Rik Ok I will try this. Another question, I have started zephyr recently, where I need to refer node label “mipi_dbi1” in my DTS. I can create this node in DTS file but not getting how to utilize it so that MIPI-DBI will be used instead of SPI ?
@Rik what did your &sercom4 node look like. I have a st7789 display running in zephyr on nordic for a lower toolchain, but can’t get it running using mipi_dbi. I think all my st7789 settings should be correct (as they are working in the spi node).