How to run LGVL on iMX using framebuffer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to run LGVL on iMX using framebuffer

How to run LGVL on iMX using framebuffer

What is LGVL?

LVGL is a graphics library to run on devices with limited resources.

LVGL is fully open-source and has no external dependencies, works with any modern MCU or MPU, and can be used with any (RT)OS or bare metal setup.

https://lvgl.io/

 

What is Framebuffer?

The Linux framebuffer (fbdev) is a Linux subsystem used to show graphics on a display, typically manipulated on the system console

 

How to write on the frame buffer?

The device is listed on de device list typically "fb0" on iMX.

Chavira_0-1713985008756.png

 

1. Stop the window manager (Weston in our BSP)

$ systemctl stop weston

 

2. Write random data on the frame buffer with the next command:

$ cat /dev/urandom > /dev/fb0 

 

You should see colored pixels on the screen


Chavira_0-1714056022934.jpeg
 

3. Restart the window manager.

$ systemctl start weston

 

Chavira_1-1713985008756.png

 

Cross-compiling the application

 

1. On the host computer we will clone the LGVL repo:

$ git clone https://github.com/lvgl/lv_port_linux_frame_buffer.git -b release/v8.2

$ cd lv_port_linux_frame_buffer

$ git submodule update --init --recursive 

2. Configure the screen resolution, rotation, and the touch input.

 

    2.1 The resolution is configured in lines 33 and 34 of the main.c

disp_drv.hor_res = 1080;

disp_drv.ver_res = 1920;

    

     2.2 Rotation configured is on lines 32 and 57 of main.c.

disp_drv.sw_rotate = 3;

lv_disp_set_rotation(NULL, LV_DISP_ROT_270);    

    2.3 The touch input is configured on line 450 of lv_drv_conf.h

# define EVDEV_NAME "/dev/input/event2" 

 

Note: In my case is on /dev/input/event2 to check the inputs use the command "evtest"


Chavira_2-1713985008757.png
 

3. Compile the application using the command "make"

 

Note: To compile the application on your host computer you have to set the environment.

 

4. Share the file called "demo" with your board and execute it on the board with the command

$ ./demo 

 

Note: You have to stop the weston service to run the application.


Chavira_1-1714056439321.jpegChavira_2-1714056464298.jpeg

 

Chavira_3-1714056470761.jpegChavira_4-1714056477679.jpegChavira_0-1714147274371.jpeg

 

Notes:

Tested on iMX8MN EVK with BSP 6.1.36

Works on Multimedia and Full image.

Attachments
No ratings
Version history
Last update:
‎04-26-2024 09:01 AM
Updated by: