Build error after adding lvgl component

Here’s what I did:

  • Import espidf-blink example project, build and debugging → OK
  • Adding LVGL component and configuration with menuconfig → OK
  • Rebuild → Failed

The addition of LVGL proceeded as follows;

git clone --recursive
cd lv_port_esp32
pio init -b esp32dev -O "framework=espidf"
echo [platformio] >> platformio.ini
echo src_dir = main >> platformio.ini
pio run -t menuconfig

When I run the above code, platformio.ini is also created in the LVGL directory, is this right?

; project platformio.ini 

platform = espressif32
framework = espidf
board = esp-wrover-kit
monitor_speed = 115200
build_flags =
; LVGL platformio.ini
src_dir = main

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

build failed after adding LVGL component

I installed the LVGL library using pio pkg in the espidf project. The build is successful and menuconfig is also executed, but the LVGL configuration items are not displayed. Shouldn’t it be installed as a library in espidf?

pio pkg install --library "lvgl/lvgl@^8.3.2"
platform = espressif32
framework = espidf
monitor_speed = 115200

board = esp-wrover-kit
lib_deps = lvgl/lvgl@^8.3.2
build_flags = 

Installing it via lib_deps will not make it show up in the menuconfig. That has been a long unresolved issue: Readout KConfig from ESP-IDF libraries added via lib_deps, too · Issue #453 · platformio/platform-espressif32 · GitHub

That’s weird, when I do those steps it builds normally.

C:\Users\Max\temp\lv_port_esp32>pio run
Processing esp32dev (platform: espressif32; board: esp32dev; framework: espidf)
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: Espressif 32 (5.2.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
 - framework-espidf @ 3.40402.0 (4.4.2)
 - tool-cmake @ 3.16.4
 - tool-esptoolpy @ 1.40201.0 (4.2.1)
 - tool-idf @ 1.0.1
 - tool-mconf @ 1.4060000.20190628 (406.0.0)
 - tool-ninja @ 1.9.0
 - toolchain-esp32ulp @ 1.22851.191205 (2.28.51)
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
Reading CMake configuration...
Linking .pio\build\esp32dev\firmware.elf
Retrieving maximum program size .pio\build\esp32dev\firmware.elf
Checking size .pio\build\esp32dev\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  14.4% (used 47048 bytes from 327680 bytes)
Flash: [====      ]  40.1% (used 420577 bytes from 1048576 bytes)
Building .pio\build\esp32dev\firmware.bin v4.2.1
Creating esp32 image...
Merged 2 ELF sections
Successfully created esp32 image.
======================[SUCCESS] Took 81.44 seconds ======================

Make sure no antivirus is interfering with execution, that the project is not in some cloud folder (OneDrive, Dropbox, …) and that your core and platform are up-to-date. (CLIpio upgrade --dev and pio pkg update -g- p espressif32).

Do a clean rebuild as needed by deleting the .pio folder of the project and building again.

  1. Yes, the build was successful after clean. However, after adding the lvgl project as a submodule of the espidf project, I did pio init, and it became a strange program in which two platformio.ini were created.
  2. So I proceeded by adding it as a component. I cloned the lvgl and lvgl_esp32_drivers repository inside the components directory with
    git submodule add components/lvgl
    git submodule add components/lvgl_esp32_drivers
    When I run menu config, it works normally.
1 Like