Help needed - adding lvgl as component - compile error :(

guoxiaotian
Posts: 2
Joined: Mon Aug 29, 2022 10:47 pm

Help needed - adding lvgl as component - compile error :(

Postby guoxiaotian » Wed Aug 31, 2022 9:42 pm

Hello all,
I am very new to esp-idf and I am struggle to get a simple project to compile :(
My goal is to add lvgl and use it with my IL9488 based 3.9" TFT. I have tested wiring with Lovyangfx it it works fine.

so here is what I did

1. create project
$> idf.py create-project -p . lvgl_test

2. add component
$> idf.py add-dependency lvgl_esp32_drivers
This adds a dependency in idf_component.yml:

Code: Select all

espressif/lvgl_esp32_drivers: "*"
but seems idf's component manager are not able to resolve this dependency. I had to change it to

Code: Select all

lvgl/lvgl_esp32_drivers: "==0.0.3"
which fares better, meaning idf.py build command actually pull down the source and its own dependency : lvgl.

3. idf.py menuconfig
menuconfig now has 2 additional top level config entries

Code: Select all

 LVGL ESP Drivers  --->
 LVGL configuration  --->
so I went into the driver section and configured proper driver and pin settings.

Now when I try to build, I get

bunch of compilation errors, one if them is

struct "<unnamed>" has no field "bit_num"

it just seems like the version of lvgl pulled is not compatible with esp-idf as the struct is defined by esp-idf and it has not such field.

the whole component registry thing feels a little brittle, I first tried to use it from VS Code and the install button only works for some components.

I'd really appreciate it if someone could help me to unstuck. Thanks in advance!
Attachments
Screen Shot 2022-08-31 at 2.35.09 PM.png
Screen Shot 2022-08-31 at 2.35.09 PM.png (289.77 KiB) Viewed 2949 times

User avatar
gtjoseph
Posts: 92
Joined: Fri Oct 15, 2021 10:55 pm

Re: Help needed - adding lvgl as component - compile error :(

Postby gtjoseph » Thu Sep 01, 2022 12:45 pm

The versions of lvgl and lvgl_esp32_driver are indeed mismatched in the components manager. The best way to get started is to clone the lv_port_esp32 project which has synchronized lvgl and lvgl_esp32_driver components and will build without any fiddling.

Code: Select all

git clone --recursive https://github.com/lvgl/lv_port_esp32
In the lv_port_esp32/components directory, you'll find both lvgl and lvgl_esp32_driver components which you can copy or link to your own project's components directory. The lvgl version in this case is 7.10.1.

This will at least get you started. I don't think there's an lvgl_esp32_driver that works correctly with lvgl v8+ yet.

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: Help needed - adding lvgl as component - compile error :(

Postby chegewara » Thu Sep 01, 2022 2:31 pm

There is 2 lvgl components "supported" by espressif:
https://components.espressif.com/search/lvgl

and there is also third one in here:
https://github.com/espressif/esp-iot-so ... i/lvgl_gui

I have no idea why, also i cant tell which is the easiest to use.

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 137 guests