How do I set up lv_platformio with lv_port_esp32?

I am trying to create an lvgl application for my ESP32 using platformio. I decided to start by forking lv_platformio and then following the instructions at

You can find my fork on github at:

The result is just an angry watchdog:

␛[0;31mE (70457) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:␛[0m
␛[0;31mE (70457) task_wdt:  - IDLE0 (CPU 0)␛[0m
␛[0;31mE (70457) task_wdt: Tasks currently running:␛[0m
␛[0;31mE (70457) task_wdt: CPU 0: main␛[0m
␛[0;31mE (70457) task_wdt: CPU 1: IDLE1␛[0m
␛[0;31mE (70457) task_wdt: Print CPU 0 (current core) backtrace␛[0m

What am I missing?

In case it is important, I am trying to replicate the first image on the page of a common DOIT ESP32 board and a common ILI9488 display

I have that particular ESP32 board and that particular display.

So, I got this working, and I thought that I should share for the next person who comes through facing the same issue:

First, I cloned-and-owned the code from lv_port_esp32:

$ git clone --recurse-submodules
$ cd lv_port_esp32
$ source /home/peter/.platformio/penv/bin/activate
$ pio project init --board esp-wrover-kit
$ rm -rf src

Then, I opened the folder in VS Code, and updated the platform.ini to contain:

src_dir = main

platform = espressif32
board = esp-wrover-kit
framework = espidf

In the PlatformIO sidebar menu, I chose Project Tasks/Platform/Run Menuconfig and made the following changes using menuconfig:

Component config
  LVGL configuration
    (320) Maximal horizontal resolution to support by the library.
    (240) Maximal vertical resolution to support by the library.
    [*] Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI).
  LVGL TFT Display controller
    Display orientation (Landscape)
    TFT SPI Bus. (VSPI)
    Display Pin Assignments
      (23) GPIO for MOSI (Master Out Slave In)
      [ ] GPIO for MISO (Master In Slave Out)
      (18) GPIO for CLK (SCK / Serial Clock)
      [*] Use CS signal to control the display
      (5)     GPIO for CS (Slave Select)
      [*] Use DC signal to control the display
      (2)     GPIO for DC (Data / Command)
      (4) GPIO for Reset
      [ ] Enable control of the display backlight by using an GPIO.

I then wired the display to my ESP32 according to the pins listed above, and success!

If you have any questions, I am happy to answer them here.



Thanks a lot Peter, worked like a charm on M5Stack Core!

Any ideas updating that to lgvl8 while lv_port_esp32 is lagging behind ?

You can use this sample for LVGL 8.x
LovyanGFX (used for display & touch drivers) should auto detect M5Stack Core.



Ok, got it. The problem is with lvgl_esp_32 drivers, they are not fit for lvgl v8 yet.

Your second link worked directly after changing lovyanggfx defines to M5Stack. Perfect!
(lovyanggfx not popping up in esp-idf’s menuconfig is correct ?)

Thanks for that!

LVGL has a nice architecture and allows any display+touch driver to be integrated.
So in my sample, I used LovyanGFX since it has autodetect as well, which makes it easy to use unlike the manual driver config required for TFT_eSPI.

You can remove

#define LGFX_WT32_SC01

and enable the line for autodetecting M5Stack.


Source Code line here

Yes, Lovyan is not configured using menuconfig. I can create a kconfig file but there are hardly anything to be configured if you use autodetect.

Autodetect, even better! (beforehand I used #define LGFX_M5STACK)

1 Like