Getting started with LVGL + Micropython + HDMI Screen + RPI4B

Description

What MCU/Processor/Board and compiler are you using?

Board: Raspberry Pi 4B - 8Gb
OS: Ubuntu 22.04 Server
Screen: Waveshare 5" Circular LCD Touchscreen using HDMI. Resolution: 1080x1080
Compiler: Installed build-essential, using the provide Makefile

What do you want to achieve?

Very much at the start of my lvgl journey.

  • Working version of lv_micropython
  • Working version of lv_port_linux_frame_buffer
  • Working keyboard
  • Working mouse
  • Working touchscreen
  • Working LVGL UI elements

Currently none of the above is operating correctly and I need to get the basics before I start using Squareline Studio for my UI development

What have you tried so far?

  • Installed the following in

    /boot/firmware/config.txt
    
    hdmi_group=2
    hdmi_mode=87
    hdmi_pixel_freq_limit=356000000
    hdmi_timings=1080 0 68 32 100 1080 0 12 4 16 0 0 0 60 0 85500000 0
    

    based on the waveshare wiki for this screen. This got the screen responding to the board.

  • Installed lv_micropython in ~ following the exact procedure as defined in the GitHub README

  • Installed lv_port_linux_frame_buffer in ~ following the exact procedure as defined in the GitHub README

  • Made no changes to the lv_conf.h as found in the root directory of the lv_port_linux_frame_buffer clone as the defaults seemed appropriate

  • Made these changes to the lv_drv_conf.h found at that location

    USE_EVDEV           1
    EVDEV_HOR_MAX      1080
    EVDEV_VER_MAX      1080
    
  • After compilation of the two resources I ran “demo” and was rewarded with the “Elana Smith” dialog in the top left of the screen. However as soon as it displays and error appears in the PuTTY window I’m using to access the rpi (see below). Additionally the screen and mouse were unresponsive and a blinking cursor created a small black blinking cursor block in the middle of the dialog. Using ‘enter’ on the keyboard overwrote the dialog with standard command line prompts.

    unable to open evdev interface:: No such file or directory
    
  • I successfully ran evtest for each device

    • /dev/input/event0 caused touch events to scroll on the screen
    • /dev/input/event1 captured and displayed the correct keys I was pressing on the keyboard
    • /dev/input/event4 showed the values of the mouse moves, clicks and wheel movements
  • On reading the forums there were hints that SDL could be used so I tried the following settings in the lv_drv_conf.h

    USE_EVDEV        0
    USE_SDL          1
    SDL_HOR_RES     1080
    SDL_HOR_RES     1080
    USE_FBDEV        1
    

    I also tried various include paths for SDL until I found it at

     SDL_INCLUDE_PATH    </usr/include/SDL2/SDL.h>
    

    The SDL version of the compilation did not go well with missing

    #define M_PI
    

    and a slew of errors due to the compiler being unable to find SDL.h and thus various SDL functions which were needed.

  • I also tried an installation of xorg

Conclusion

I feel like I’m close but am now stuck as I do not have the depth of knowledge that you all do to take me through to a solution.

Any thoughts and/or questions would be gratefully received
Regards
Ian Carson

hi Ian, how’s your exploration? did you figure it out in the end?