Struggling to use LVGL with ESP-IDF and ST7789V3 (please help before I lose it, seriously i am going to cry)

Okay, so I’m working on a project where I’m using an ESP32-S3 with ESP-IDF. The display is a 280x240 SPI LCD with an ST7789V3 driver. My goal is simple (or at least I thought it was): display PNG images and animated GIFs from a flash partition at decent speed.

I picked LVGL to get this done but, it’s been a total nightmare.

Let me explain what I’ve tried so far:

  • First attempt: I used the official esp_lvgl_port But my MCU just kept getting stuck in bootloader (BOOTSEL) mode. No idea why and when i got the mcu to boot the lcd did not even initialized
  • Second attempt: I tried nopnop2002/st7789,the PNG decoder worked, and I was actually able to display an image. But it was super slow, exactly what I was trying to avoid. So I dropped it.
  • Third attempt: I went with the ESP-IDF’s built-in st7789 driver and manually wrote a basic driver. This time, the LCD initialized, but then when I tried to fill the screen with a red color, the screen just filled yellow ��. I checked the code like 10 times I still couldn’t get the right colors to display correctly.
  • I even tried following this article: https://pcbartists.com/firmware/notes-using-lvgl-with-esp32/ but once again, the LCD just wouldn’t initialize at all.

At this point, I’ve honestly lost count of how many hours I’ve wasted on this. I’m mentally done. Everything seems to be breaking in a different way no matter what I do.

I’m using:

  • ESP-IDF (latest version)
  • LVGL (latest version)
  • I’m totally open to sharing code snippets, logs, config files—whatever you need, just ask. :pray:

Please, if anyone has successfully gotten LVGL working with an ST7789V3 over SPI on ESP32-S3 (especially with PNG or GIF support), I would deeply appreciate your help. Thanks for even reading this far.

care to try having a go at it an easier way?

It’s as easy as

sudo apt-get install build-essential cmake ninja-build python libusb-1.0-0-dev git
git clone https://github.com/lvgl-micropython/lvgl_micropython
cd lvgl_micropython
python3 make.py esp32 BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=SPIRAM_OCT DISPLAY=st7789 INDEV=?? --flash-size=16 --enable-cdc-repl=n --enable-uart-repl=y 

then run the command that is output at the end to flash the compiled binary file.

If you provide me with some more details on the esp32-s3 you are using like the amount of flash memory it has and if the flash memory is octal SPI, the resolution of the display you are using and what the color depth is you are wanting to use. us UART is used to connect to the ESP32 or if the connection is USB -CDC. What pins the display is connected to on the ESP32. if there are any accessory devices like a touch screen and what the model number is of the controller for the touch screen what pins it is connected to on the ESP32. If you have an attached IMU (MEMS) sensor or an IO Expander.

Drivers for most of the common displays are already set up as well as touch drivers, mems sensors, io expanders… etc… All of it is able to be compiled by using a single setup toml file and once that is done all you need to do is write your GUI code to get the GUI up and running. you don’t have to mess around with dealing with the drivers or writing the flush function for the display it’s all handled internally.

You would write you gui code in python which makes things easier because you don’t need to worry about handling memory allocation or anything like that.