LVGL on Linux mini review

I ran a few experiments with LVGL on Linux and documented here:

Looks promising!

2 Likes

Hi,

It’s great, thanks for sharing!

If I understood correctly your only issue was that it wasn’t obvious how to get started, right?

Correct. I come from a Linux background where we are used to command line flows, so was curious if I could build LVGL on Linux without an IDE. This is important when integrating into build systems like Yocto. Glad to see it is fairly easy to do. Not sure if it makes sense to add docs on this? I should probably try an IDE simulator flow to get a sense for how that works.

1 Like

Actually we have some related docs, like:

and you could see the we have some ready to use project but we should point the users more directly to the right direction, to easily see something using LVGL.

1 Like

I tried the fb port on a i.MX8 system, and am getting the following:

Any ideas why the image does not look scaled properly?

I think the LCD is 800x480:

[email protected]:~# fbset   
mode "800x480-0"         
# D: 0.000 MHz, H: 0.000 kHz, V: 0.000 Hz         
geometry 800 480 800 480 16         
timings 0 0 0 0 0 0 0         
accel true         
rgba 5/11,6/5,5/0,0/0 
endmode

I believe the app is configured for 800x480 by default:

    /*Initialize and register a display driver*/
    static lv_disp_drv_t disp_drv;
    lv_disp_drv_init(&disp_drv);
    disp_drv.draw_buf   = &disp_buf;
    disp_drv.flush_cb   = fbdev_flush;
    disp_drv.hor_res    = 800;
    disp_drv.ver_res    = 480;
    lv_disp_drv_register(&disp_drv);

Great job on your build setup – it compiled without a lot of trouble under Yocto:

Looks like a color format mismatch. Probably LVGL is configured to 32 bit (LV_COLOR_DEPTH 32 in lv_conf.h) but display has 16 bit color depth.

Yes, right on, the following change fixes it:

[[email protected] git]$ git diff
diff --git a/lv_conf.h b/lv_conf.h
index 6bfe50f..e83dc55 100644
--- a/lv_conf.h
+++ b/lv_conf.h
@@ -24,7 +24,7 @@
  *====================*/
 
 /*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/
-#define LV_COLOR_DEPTH 32
+#define LV_COLOR_DEPTH 16
 
 /*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/
 #define LV_COLOR_16_SWAP 0

Working on touchscreen next …

I did try the lvgl pc version on this device (the same code that runs on my Linux workstation just fine) running Weston/Wayland, and the app started up with no errors, but nothing displayed on the screen.

I suggest enabling Logging — LVGL documentation to see what might have happened.