Double buffer LVGL port on ESP32 with RGB interface

Hi all,

First of all thanks to all who have made LVGL a reality, great piece of work.

I have managed to port LVGL 9.1 to the ESP32 running on the 7 inch Waveshare board (7 inch waveshare Esp32-S3 touch lcd). It uses a 16 bit RGB interface to communicate to the display controller (ST7262).

I am developing using the PlatformIO plugin in VSCode using the Esspresif platform and the Arduino framework. I have used the ESP32_Display_Panel library to port LVGL on top of this board.

The LVGL benchmark shows an average of 13 fps and I am looking for ways to speed this up. I already tried different buffer sizes, GCC optimization etc to get to this 13 fps.

Does anybody have tips or even code examples available implementing double buffering using DMA on this platform to get me started?

Many thanks in advance.

HELLO , Hi I need help, because I have a yaml ephome file or I have to put my lgvl config and my display but pine or info error I am hoping you can help me please I am French don’t speak English !!! THANKS
my yaml !!!

ubstitutions:
board_chip: “ESP32-S3”
board_name: “lcd-touch”

esp32:
board: esp32-s3-devkitc-1
variant: esp32s3
framework:
type: esp-idf

Uncomment and adjust these if needed:

sdkconfig_options:

CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: y

CONFIG_ESP32S3_DATA_CACHE_64KB: y

CONFIG_SPIRAM_FETCH_INSTRUCTIONS: y

CONFIG_SPIRAM_RODATA: y

esphome:
platformio_options:
board_build.flash_mode: dio
on_boot:
then:
- lambda: |-
id(my_display).enable();
id(my_display).transfer_byte(0x11);
id(my_display).disable();

psram:
mode: octal
speed: 80MHz

logger:
hardware_uart: USB_SERIAL_JTAG

external_components:

  • source: github://pr#6363
    refresh: 10min
    components:
    • lvgl
      uart:

UART 1

  • id: uart_esp_1
    tx_pin: 43
    rx_pin: 44
    baud_rate: 115200

canbus:

  • platform: esp32_can
    id: canbus_node1
    tx_pin: 20
    rx_pin: 19
    can_id: 1
    bit_rate: 500kbps

output:

  • platform: gpio
    pin: 4
    id: esp_led
    inverted: true

i2c:
sda: GPIO8
scl: GPIO9
scan: True
id: bus_a

light:

  • platform: binary
    output: esp_led
    id: esp_light
    name: “${name} On board light”
    internal: true

spi:
clk_pin: GPIO07
mosi_pin: GPIO11
miso_pin: GPIO12 # Ajoutez ce pin si nécessaire pour votre écran
id: spi_bus

display:

  • platform: rpi_dpi_rgb
    id: rpi_disp
    dimensions:
    width: 800
    height: 480
    de_pin: 40
    hsync_pin: 39
    vsync_pin: 41
    pclk_pin: 07

    data_pins:
    red:
    - GPIO1
    - GPIO2
    - GPIO42
    - GPIO41
    - GPIO40
    green:
    - GPIO39
    - GPIO0
    - GPIO45
    - GPIO48
    - GPIO47
    - GPIO21
    blue:
    - GPIO14
    - GPIO38
    - GPIO18
    - GPIO17
    - GPIO10

    Optionally, you can specify other parameters such as color_invert, brightness, etc.

    color_invert: false # Use if the colors are inverted on your display

    brightness: 1.0 # Adjust brightness if needed

Define LVGL integration

displays:

  • id: my_touch
    type: XPT2046
    cs_pin: GPIO4

    Optionally add other pins and settings

lvgl:
displays:
- id: rpi_disp

Hi I have been trying to get LVGL v9 working with this board. I assume that you have had to modify the lvgl_port_v8.cpp and lvgl_port_v8.h. Would you be so kind as to provide your solution. I am sure that there are many others that would like this as well.

Many thanks

Hi SJGC,

Sure, no problem.

I have extracted a “minimal” set of files that should get you going. The attached zip file contains a complete PlatformIO project that builds an image that you can download to the WaveShare board and demonstrates some capabilities of LVGL V9.x on this board.

Download this zipfile and extract it in your “platformio” folder where you keep all your projects. Then open this folder using Visual Studio Code and try to build it. It will fail, but it will install the required packages. Next you have to move 2 files after the packages like LVGL and ESP32_Display_Planel are installed. This is described in the readme.txt file that I copied in the root of the project as found in the zip file.

After moving these 2 configuration header files to the right location try to build the project again in Visual Studio Code. It should build fine after which you can upload the image to the WaveShare board and see the demo.

In the file: “DemoDisplay.cpp” you can select to run different demo’s. Make sure you read the LVGL documentation on how to enable the: “lv_demo_benchmark” if you want to.

Success,

John.
DisplayTest (shared).zip (767.2 KB)