Raspberry Pi RP2040 + LVGL


I’m new to PlatformIO, so it’s possible I missed something silly and/or obvious.
I just created a blank project using the following platformio.ini:

platform = espressif32
board = esp32dev
framework = arduino
lib_deps =

It builds fine, no issues. I noticed I see the following in the dependencies list:

Scanning dependencies...
Dependency Graph
|-- lvgl @ 8.3.4

Now I want to switch my MCU to RP2040. I changed platformio.ini accordingly to look like this:

platform = raspberrypi
board = pico
framework = arduino
lib_deps =

Now it fails to build with error message:
fatal error: Portenta_Video.h: No such file or directory
I also noticed my dependencies list is slightly different:

Dependency Graph
|-- lvgl @ 8.3.4
|   |-- Portenta_lvgl @ 1.0

I would guess I got the error message due to added “Portenta_lvgl”.
I was trying to debug how PlatformIO builds its dependencies list and why it picked up Portenta when my MCU is RP2040.
Any ideas?

The ArduinoCore-mbed has this library. Can you add lib_ignore = Portenta_lvgl to the platformio.ini to nudge it into the right direction?

1 Like

Thanks a lot for the “lib_ignore” option. That helped. I appreciate your quick response.
I’ll try to debug why it’s being set as a dependency, but at least I got things working.

After some debugging of platformio code I found the issue. It appears that its Library Dependency Finder which is written pure Python is getting confused by include lv_conf.h and picks up Portenta_lvgl because of this.
If I set lib_ldf_mode=chain+ or lib_ldf_mode=deep+, it solves the issue as well because it will also evaluate the conditional preprocessor syntax and I specifically set not to include lv_conf.h.
However, lib_ignore excludes the incorrect library faster so I’ll stick with it. But those two options above may be helpful for someone else.

1 Like

Please note that, in c_cpp_properties.json, there are 2 include folders for “Portenta_Audio/src” and “Portenta_SDCARD/src”, but sometimes misisng include path “Portenta_Video/src”. That leads to the error.

Yeah, this is what I discovered too when I thought it should be easy to fix.
But using lib_ignore is the cleanest approach in this case.