Skip to content

lvgl/lv_port_toradex_verdin_imx8m_mini

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LVGL ported to verdin imx8mm

Overview

This guide provides steps to setup the Verdin imx8m Mini and run a cross-compiled LVGL application on the target.

This guide is done with Verdin imx8m Mini Quad 2GB IT on Yavia carrier board.

Buy

You can purchase the Verdin i.MX8 from Toradex website.

There are different Verdin AM62 available:

  • Verdin i.MX8M Mini DualLite 1GB
  • Verdin i.MX8M Mini DualLite 1GB WB IT
  • Verdin i.MX8M Mini Quad 2GB IT
  • Verdin i.MX8M Mini Quad 2GB WB IT (No CAN)
  • Verdin i.MX8M Mini Quad 2GB WB IT

You can find the differences between these SOMs on the Verdin i.MX8M Datasheet here (section 1.3).

This is a SoM (System on Module) that can be tested with a carrier board. Toradex recommends ordering one of the following carrier boards for your first-time order:

Benchmark

The default buffering is fbdev.

Frame buffer, 1 threads

Name Avg. CPU Avg. FPS Avg. time render time flush time
Empty screen 20.00% 26 7 2 5
Moving wallpaper 82.00% 19 43 38 5
Single rectangle 10.00% 29 0 0 0
Multiple rectangles 18.00% 28 5 4 1
Multiple RGB images 51.00% 27 19 14 5
Multiple ARGB images 42.00% 27 13 8 5
Rotated ARGB images 74.00% 27 26 21 5
Multiple labels 50.00% 28 15 10 5
Screen sized text 84.00% 26 31 26 5
Multiple arcs 53.00% 27 16 11 5
Containers 30.00% 27 8 8 0
Containers with overlay 82.00% 20 40 35 5
Containers with opa 59.00% 27 17 16 1
Containers with opa_layer 70.00% 24 28 26 2
Containers with scrolling 62.00% 27 21 16 5
Widgets demo 28.00% 27 9 8 1
All scenes avg. 50.00% 26 18 15 3

Frame buffer, 4 threads

Name Avg. CPU Avg. FPS Avg. time render time flush time
Empty screen 21.00% 25 7 2 5
Moving wallpaper 53.00% 27 20 15 5
Single rectangle 11.00% 28 1 1 0
Multiple rectangles 34.00% 27 11 9 2
Multiple RGB images 42.00% 27 13 8 5
Multiple ARGB images 38.00% 28 11 6 5
Rotated ARGB images 52.00% 28 17 12 5
Multiple labels 40.00% 28 11 6 5
Screen sized text 55.00% 28 18 13 5
Multiple arcs 38.00% 28 11 6 5
Containers 49.00% 27 16 15 1
Containers with overlay 80.00% 27 27 22 5
Containers with opa 72.00% 26 24 23 1
Containers with opa_layer 82.00% 24 31 29 2
Containers with scrolling 52.00% 28 16 11 5
Widgets demo 23.00% 27 9 8 1
All scenes avg. 46.00% 27 14 11 3

The other configurations that can be used are:

  • DRM
  • Wayland
  • SDL

Any of these buffering strategies can be used with multiple threads to render the frames.

Check out Verdin i.MX8M Mini in action, running LVGL's benchmark demo:

image

Specification

CPU and memory

  • MCU: Verdin i.MX8M Mini Quad 2GB IT (datasheet)

    • 4 64-bit Arm® Cortex®-A53 @1.6GHz
    • Arm® Cortex®-M4F MCU @400MHz
  • RAM: 2GB LPDDR4 RAM

    • 32-Bit data bus with inline ECC

    • Supports speeds up to 1500 MT/s

  • Flash: 16GB eMMC Flash

  • GPU:

    • Vivante GCNanoUltra GPU Units
    • Vivante GC 320 CPC Units

Carrier board - Yavia

The guide was done on Yavia. You can find the datasheet of the carrier board here.

Getting started

Hardware setup

If it is the first time you are booting the SoM, it comes with Toradex Easy Installer by default, so you can skip the next section

(Optional) Flash Toradex Easy Installer (Tezi)

As mentioned, this is required if you want to flash again the SoM to start with a clean setup, or because you want to change the OS version.

The following steps come from Tezi documentation. For this guide, we will use the USB OTG approach.

  • Download Tezi here. Download the lastest release, version 6 for Verdin iMX8M Mini.

  • Then put the SoM in recovery mode:

    • Plug a USB Type-C to Type-A cable into the DRP connector (J7)
    • Connect the USB cable to your PC (host)
    • Press and hold the Recovery button (B3) while plugging the power supply cable into the J1 connector. You can also press the recovery button and press the reset button next to it.
    • Keep the B3 button pressed for 6 seconds and release it.

    If something goes wrong, there is a video showing how to enter the board in recovery mode in Tezi documentation (section "Put your SoM in recovery mode").

  • Load Tezi through the USB OTG interface. To do so, go to the directory you downloaded Tezi and unzip it. Then to load Tezi:

    cd <unzipped_directory>
    ./recovery-linux.sh
  • Then wait for Tezi installer to display the flash options on the screen.

Flash a new image with Tezi

In this guide, we will use the default Toradex Embedded Linux Reference Multimedia Image.

You need a mouse plugged in the USB port to select and flash the image. Wait for the installation to be completed!

If you want to create your own system and flash it, here is a detailed guide to use Tezi.

Software setup

This guide was tested on Ubuntu 22.04 host.

Install docker

  • Follow this tutorial to install and setup docker on your system.

  • Support to run arm64 docker containers on the host:

    sudo apt-get install qemu-user-static
    docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

Install utilities

sudo apt install picocom nmap

Run the default project

Clone the repository:

git clone --recurse-submodules https://github.com/lvgl/lv_port_toradex_verdin_imx8m_mini.git

IMPORTANT:

  • default application from lv_port_linux runs the widget demo. To run the benchmark demo, modify lv_port_linux/main.c :

    /*Create a Demo*/
    // lv_demo_widgets();
    // lv_demo_widgets_start_slideshow();
    lv_demo_benchmark();
  • The default lv_conf.h might not be the best configuration for the board. Feel free to replace the default lv_conf.h with one of the provided configurations in lv_conf_example folder.

    cp lv_conf_example/lv_conf_fb_2_threads.h lv_port_linux/lv_conf.h

Build the docker image and the lvgl benchmark application:

cd lv_port_toradex_verdin_imx8m_mini
./scripts/docker_setup.sh --create-image
./scripts/docker_setup.sh --build-app

Run the executable on the target:

  • Get the IP of the target board:

    • Option 1: from the UART, on the board:

      sudo picocom -b 115200 /dev/ttyUSB0
      ## Then inside the console, log as "root", no password required 
      ## Then retrieve the ip of the board
      ip a
    • Option 2: Get the IP from your host with nmap

      ## Find the IP of the board. You need to know your ip (ifconfig or ip a)
      ## HOST_IP should be built like this :
      ## If the ip is 192.168.1.86, in the following command HOST_IP = 192.168.1.0/24
      nmap -sn <HOST_IP>/24 | grep verdin-imx8
  • Then transfer the executable on the board:

    scp lv_port_linux/bin/lvglsim root@<BOARD_IP>:/root
  • Start the application

    ssh root@<BOARD_IP>
    
    systemctl stop wayland-app-launch.service
    ######################################
    ## WARNING: do not stop these services if using wayland demo
    systemctl stop weston.socket 
    systemctl stop weston.service 
    ######################################
    
    ./lvglsim

Change configuration

Some configurations are provided in the folder lv_conf_example .

The default configuration used is lv_conf_fb_4_threads.h. To change the configuration, modify the lv_port_linux/lv_conf.h file with the desired configuration.

Start with your own application

The folder lv_port_linux is an example of an application using LVGL.

LVGL is integrated as a submodule in the folder. To change the version of the library:

cd lv_port_linux
git checkout <branch_name_or_commit_hash>

The file main.c is the default application provided and is configured to run the benchmark demo provided by LVGL library.

The main steps to create your own application are:

  • Modify main.c
  • Add any folders and files to extend the functionalities
  • Update Dockerfile to add any package
  • Modify CMakeLists.txt provided file to ensure all the required files are compiled and linked
  • Use the docker scripts provided to build the application for ARM64 architecture.

TroubleShooting

Output folder permissions

If there is any problem with the output folder generated permissions, modify the permissions:

sudo chown -R $(whoami):$(whoami) lv_port_linux/bin

Fbdev example runtime error

This error can be printed when running the application:

[Warn]	(1382.767, +37)	 lv_display_refr_timer: No draw buffer lv_refr.c:374
[Warn]	(1382.804, +37)	 lv_display_refr_timer: No draw buffer lv_refr.c:374
[Warn]	(1382.841, +37)	 lv_display_refr_timer: No draw buffer lv_refr.c:374
[Warn]	(1382.878, +37)	 lv_display_refr_timer: No draw buffer lv_refr.c:374

To fix the issue find the existing fbdev available:

ls /dev/fb*

Export the variable to match the fbdev name:

export LV_LINUX_FBDEV_DEVICE=/dev/fb0

Wayland example runtime error

While running the application, if there is an error about XDG_RUNTIME_DIR, add the following environment variable on the board.

export XDG_RUNTIME_DIR=/run/user/1000

Changing configuration causes errors building the application

CMake may have troubles with CMakeLists.txt changes with some variables setup. If there is any problem building, try to clean the build folder:

rm -rf lv_port_linux/build-arm64

Contribution and Support

If you find any issues with the development board feel free to open an Issue in this repository. For LVGL related issues (features, bugs, etc) please use the main lvgl repository.

If you found a bug and found a solution too please send a Pull request. If you are new to Pull requests refer to Our Guide to learn the basics.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages