Description
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.
What have you tried so far?
I followed below steps for integration:
- Added below configuration in prj.conf:
CONFIG_DISPLAY=y
CONFIG_LVGL=y
CONFIG_LV_Z_MEM_POOL_SIZE=8192
CONFIG_LV_FONT_MONTESERRAT_12=y
- 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.