New to LVGL with ESP32S3 Need Advice for Testing IDE

Greets All,

I am new to LVGL with ESP32S3 and need advice for a testing IDE environment.

My hardware (one piece anyway) is the MakerLabs ESP32S3 Parallel TFT 3.5" v1.0 using the ILI9488, but that test-base is expanding very soon. I like working with ESP32S3 devices, and I have a number of ESP32S3 boards, and after an exhaustive search, I cannot find the most ideal ESP32 device to use with LGVL but I do see a lot of peeps using it (the S3) with LVGL. My version 1 is N16R2 but I have some Espressif dev boards that are N8R8 and N32R8, WROOM 1 and 2.

I want to set up a testbed environment so I can work through all the features of LVGL and maybe fork off that for other platforms, like the RP2350, the STM32 line, and other flavors of ESP like the M5stamp Pico, etc.

So what have I tried so far? Arduino IDE 2.3.4 with the LVGL library 9.2.2 and lv_examples 8.1.0 installed. But I did not find any wealth of examples available so before I dig into that, I decided to see if other IDE environments are favorable to getting familiar with LVGL. Like maybe VSCode native, or VSCode with PlatformIO. I have not looked at using LVGL with the Espressif ESP-IDF yet.

So I thought I would ask if there was a preferred environment for getting to know LVGL. The makerlabs board with TFT is just one device I plan to use with LVGL. I have M5stamp Picos, RP3250s, Some round TFT displays, Espressif’s ESP32-S3-WROOM-2-N32R8V, ESP32-S3-WROOM-1-N8R8. Maybe even a PI5, or my CM4 and CM5.

All CPP, no interest in MicroPython for this. What is your preferred environment for learning and writing with this awesome library?

Thanks for your time!

Stay away from the Arduino IDE is you want to get the most from the ESP32. It doesn’t use the ESP-IDF as the SDK it has some chopped up limited version of it.

My suggestion to you is to use the ESP-IDF native build system that comes with the SDK. It will allows you to really make some in depth alterations to suit your specific need. There is a config system called menuconfig that is built into it that allows for you to make alterations to the IDF. There is a learning curve with it but once you get familiar with it it’s not a big deal to use. I recommend compiling using WSL running Ubuntu and not compiling in native Windows. It is a lot easier to get everything to work correctly running Linux. You can set up Visual Studio so it will execute the build commands for you in WSL so it will work as if it is running on native Windows when it really is not.

There is also an LVGL Visual Studio repo that allows you to compile LVGL to run onm Windows. This is handy to use to get the UI developed and tested and then you can move the code over to compiling for the ESP32.

1 Like

That’s great to know. I have it set up already for the PicoSDK so I imagine it is a matter of creating a new environment but I will read up on that.

I saw that while reading yesterday. That is very good to know.
OK, I have a path to follow, thank you sir for the clarification about Arduino IDE and the info. I appreciate it!

I have questions about going after this path of using ESP32-IDF in WSL2. I am not sure if you have done this, but you seem to know something about it, so if you do not mind, I have some questions.

  • Is there a guide you recommend to help me with this? I found one that I THOUGHT took me through it, from Expressif, but it just covered exposing a USB port in WSL2. It did not complete my goal, but it certainly helped. I now have my ESP32 device exposed and accessible within my WSL2 Ubuntu install. Something interesting to note… It also talked about using RC2217 (Telnet) to communicate with the device over my home network. Something I did not know was possible.
  • The guide I am looking for should also cover how to use remote access from VSCODE installed in Windows to access my ESP32-IDF environment.
    Sorry for the late 2nd reply, I want to get this right. THANKS!

If you go into Windows Explorer (File Explorer) and in the path bar near the top you enter \\wsl$ This will bring up your WSL installations. Right click omn the installation you want and then click on “Map Network Drive” Select a letter that is high up like X or Z. make sure the reconnect at sign-in is checked. Then click on “Finish”. Now your WSL installation drive will be accessible from any program that is able to run on Windows.

It is easier to create your project on the WSL drive and navigate to it than it is to create the project on Windows and have to navigate to it from WSL. The paths get really long and it could pose issues when compiling due to the large number of files that are used.

You are going to want to create a bash script that is going to have the commands that will execute the build commands. That shell script is what you are going to run from VS Code when you want to compile. You will have to manually add all of the include paths that point to the different esp-idf bits and pieces. It will take a little bit of time to do but once it is done you will not have to do it again if you create an empty project and only do the ESP-IDF stuff. Then you can use that as a template for new projects.

To get esp-idf installed and set up you need to run the following commands from a WSL prompt. I recommend getting an application called Windows Terminal. This single application has terminals available for CMD, WSL, PowerShell, etc… It works well and is easy to use.

I also recommend using an application called WSL USB Manager. This application makes it super easy to handle the USB to WSL bridge.

I personally do not use VS Code. I use Visual Studio or PyCharm (which has support for C code) So I am not able to help you with setting up an environment using VSCode. I can put one together for Visual Studio for ya.

1 Like

That is a very kind offer and I appreciate it! I don’t want you to go through all that trouble but if it is convenient, I’m sure many would find it useful.

I have 2022 (and 2019) installed and regularly updated. I guess it makes sense that VS2022 would be able to interface with WSL2 since VSC does that already. I hope it isn’t directly with the file system since the differences between Windows and Linux causes one’s access of the other to be very slow, not deep enough into it to know why. I am assuming VS2022 in Windows presents the IDE for editing code in WSL2, and can run bash scripts in Linux to handle the compiling, leaving VS2022 out of it. And maybe the flashing also? Can it handle debugging too?

Sorry for the vague questions, and yes this is exciting. I get VS2022, the actual ESP32-IDF in Linux on WSL2 and not something holding my hand as much, and LVGL which I cannot WAIT to get into. 8^D

I don’t know being able to directly access WSL. The way I would recommend you do it is “outside the box” so to speak. It is a very large amount of work to add all of the header files into a VS project so that intellisense and code completion would work. You wouldn’t be able to use debugging features or anything like that and when compiling it would simply execute a script to be able to do it and I am not even 100% sure if it would be able to execute a bash script properly.