Someone willing to hold my hand?

Despite HOURS of trying, I can’t get LVGL working at all. Can’t even get examples to compile.

I’ve found so much conflicting and outright wrong / outdated information my head is spinning.

I really could use some 1-on-1 help.

Working on a Win11 desktop, Arduino IDE, RP2040 target.

Anyone up for the challenge? I’m in New Jersey.

I think I could help you out.

I am not in New Jersey but I have been told I am very thorough with the direction I give in a forum post.

Lets start off with a few question so I am able to gauge you knowledge level better.

How much programming experience do you have?
What programming languages do you know?
What is your programing language of choice?
Are you familiar with Linux?
Do you have WSL set up on your computer?

Now some hardware related questions.

What MCU are you running? You have the RP2040, just wanted this here for completeness
What display are you wanting to run?
What is the connection or “bus” the display is using when connected to your MCU (SPI, I8080, RGB)?
What is the resolution of the display?
What is the dolor depth of the display?
Does the display have a touch panel?
If the display has a touch panel what is the brand and model?
If the display has a touch panel what is the connection method to the MCU (SPI, I2C, other)?

Here are a few questions to get a better feel for what you are wanting to accomplish.

What GUI elements are you wanting to use?
How many GUI elements is there going to be?
Is there any external inputs like sensors that will be used to supply data to the display?
Is there a specific reason for using the RP2040 MCU?
Is there a specific reason for using the Arduino IDE?

Please answer all of the question to the best of your ability. If you have no clue what I am asking then please say that. If there is something that you do not understand maybe due to the acronyms I will go in depth as to why I am looking to know.

I don’t know your level of knowledge so please do not be offended by my questions if they seem really newbie. Let me know that you have a more advanced knowledge and we can go from there. For the most part I will be able to answer most questions you will have, If I don’t know the answer I will pretend like I do and come up with something that sounds really good. LOL, Nah, I won’t do that. What I will do is I will go and get myself an education on what you are asking and come back with an answer once I have that knowledge.

This will be quite a bit of back and forth so be patient. I know it can be frustrating at times. To make things move along a little bit faster when we get past some of the preliminary stuff I will set up a virtual machine running Windows 11 and we can both connect to it so I can show you what to do instead of trying to type it all out. I can even make a screen recording of the steps and send you the video so you can play it back as much as you like. I can even set things up so you can plug the RP2040 into your computer and it will tunnel that connection over the internet so it would be like you are plugging it directly into the virtual computer. This will allow us to flash the software to the RP2040 so you can see it work right in front of you.

1 Like

Just to let you know I am located in Colorado so there is only a 2 hour time difference. That will make things a lot easier than if I was in say, Australia. The time difference is manageable.

Hi KD,

Thanks for your quick and thoughtful reply! I’ll try to answer as best I can below:

How much programming experience do you have?
Years. I’m mostly self-taught, but no stranger to applications level and UI programming for WinForms in VB and some c#. Also have done quite a bit of C embedded stuff for PIC and other CPUs. I’m an electronic designer. (www.steamsynth.com) I still have some fuzzy areas though. :-/
What programming languages do you know? C, VB, C#
What is your programing language of choice? Right now for this, embedded C.
Are you familiar with Linux? VERY little. Complete NOOB
Do you have WSL set up on your computer? WSL?

What MCU are you running? You have the RP2040, just wanted this here for completeness
What display are you wanting to run? Generic Chinese 2.4" TFT SPI 320x240. ILI9341.
What is the connection or “bus” the display is using when connected to your MCU (SPI, I8080, RGB)? SPI
What is the resolution of the display? 320x240
What is the dolor depth of the display? 16 bit (I think), but that’s really handled nicely with TFT_eSPI library.
Does the display have a touch panel? Yes. Works with other examples
If the display has a touch panel what is the brand and model? see above
If the display has a touch panel what is the connection method to the MCU (SPI, I2C, other)? SPI

What GUI elements are you wanting to use? Slider, button, radio button (is there one?), checkbox, popup windows
How many GUI elements is there going to be? 4 or 5 (at this time)
Is there any external inputs like sensors that will be used to supply data to the display? The data comes from the 4 ADC inputs, supplied by my custom PCB.
Is there a specific reason for using the RP2040 MCU? Actually the Seeed Xiao RP2040 - Size, cost, Speed, RAM size
Is there a specific reason for using the Arduino IDE? While I’m NOT a fan of the Argh-uino environment, it offers MANY free ready to use examples for a variety of platforms. Having worked professionally for years with MS Visual Studio, I’m most comfortable there.

FWIW - I have my custom design with the TFT and touch working nicely with the many TFT_eSPI examples, so hardware is NOT an issue here.

I understand we are getting to know each other, so I’m not offended at all. I’ve setup lots of projects and managed to work thru issues in the past, but this one has had me stumped every time I dive into it. I think must have tried getting LVGL working several times over the last few years, but always seem to get myself frustrated. Don’t know why this is so hard (for me?). I’m pretty sure it’s just some lame config file setting I’m missing. Grrrrrr.

Look forward to working with you - and THANKS!

Doug

Hi Doug,

I’m quite new to the field and was frustrated with the very same experience. None of the examples are running out of the box; not even compile. However some complicated factory programs do work in my case. Therefore I have roughly did something on my board but when i decided to learn the basics of LVGL by using the example code blocks, there are always strange errors.

Computer: MacBook with Apple Silicon M1 Max
OS: OSX 12.6
Board: Wizee 2.8" - ESP32-Wroom-32
IDE: PlatformIO - VS Code
libraies
lvgl/lvgl@8.3.6
bodmer/TFT_eSPI@2.5.31

I’m not an experienced programmer however the errors i got are trivially from library dependencies or definition problems, so they’re not much related with programming experience i guess.

I found on Arduino forum a similar complaint.

I would love to get some basic help at this stage, or we can try doing some sort of pair programming? I’m located in Antalya, Turkiye. We’re 8 hrs ahead (GMT+3 zone) and I’m usually online on discord in weekdays…

The reason why people have a hard time is mostly because of using the Arduino IDE. I strongly suggest not using it. The reason why is because of all of the boiler plate code that gets used to map functions from the MCU’s SDK to the Arduino API. The Arduino IDE is made for Arduino’s and there is a lot of patchwork to use other MCU’s with it. It makes things a lot more confusing.

Unfortunately libraries TFT_eSPI are only made to work in the Arduino IDE.The display libraries that are made for the Arduino IDE are only partially MCU specific. So there are things that you will not have available like using DMA memory, without being able to use DMA memory you loose all benefits of running 2 frame buffers. There is a HUGE performance boost from using double buffering and DMA memory.

While I know that C is your strong language have you ever considered using something like MicroPython? IO ask this because it’s easy to compile and the majority of the complexity is already hammered out and brought into an easy to use API. You project is really simple and while Python is slower than C code MicroPython has worked around that by providing ways to get the code to compile as machine code to you get the speed that is seen in C code. This is best suited for math intensive operations.

I thought I would thrown that out there as a suggestion for ya.

We can go any route you want. You don’t have to use the Arduino IDE if you don’t want to, You would have to write your own code to use SPI, not that hard to do and you would need to write your own drivers for both the touch interface and also the display. This is a little bit more involved but not overly complex either.

You can stick with using The Arduino IDE if you would like as well. I can get you up and running with this fairly easily. The hand up that most people of is how to get the data from LVGL to TFT-eSPI so it renders. and how to read the touch input form TFT-eSPI.

Or using MicroPython.

The MicroPython route would get you up and running the fastest, Arduino is second and the “roll your own” would be the longest. You are familiar with object-orientation (C#) and that would make it leaps and bounds easier for you to understand Python. Someone coming from C would have a more difficult time.

WSL = Windows Subsystem for Linux.
WSL is the single best thing that Microsoft has done with Windows in the last 20 years. It allows you to run Linux applications on Windows. It does this in a manner that is not like using Vurtual Box or even Hyper-V. While it does use Hyper-V it is more integrated into the OS. You can add Linux applications to your Windows application list just like any other Windows application and when you run the application it works like any other Windows Application. Well the idea is it should, there can be some issues with it.

The reason why I brought up WSL is because the developers that wrote the majority of the code for the build systems did so on Linux. Things like the MCU SDK’s and the Arduino IDE are all designed to run on Linux and Windows is an after thought. It is easier to compile and flash running on Linux than it is on Windows. I use Windows and one of my things is creating build systems that will work on Windows properly. Not an easy task I will tell you that. Most people avoid it like the black plague. The first and top most priority is making sure the build system works on Linux so it is always going to be a smoother ride going that way. The build systems for Windows are hacked and patched together and are fraught with problems.

Do you have the datasheet for the display?

Here’s a data sheet for the ILI9341 display chip and a link to Amazon:
https://www.digikey.com/htmldatasheets/production/1640716/0/0/1/ili9341-datasheet.html

I hear what you are saying about not using certain dev tools and languages, but these are unfortunately not rabbit-holes I can afford to go down ATM. The product(s) I build simply don’t justify the efforts for the tiny quantities that I sell.

My realistic need is a simple pop-up window when you touch the main screen that contains a half dozen UI controls to adjust program parameters. Then another touch to hide the screen. This popup can be “static” (in memory) at all times and just shown / hidden, so I don’t think there would be issues with memory fragmenting, etc.

I’m probably stuck with the silly Arduino IDE due to items previously mentioned, so it would be great to simply get LVGL working with my setup, then I “should” be able to grok the rest. But maybe I’m attempting to oversimplify it due to my lack of knowledge. You don’t know what you don’t know - Ya know?

NO your not oversimplifying it. I was hoping to go the route that would give you the least amount of headaches in the future. Once you get used to the “Arduino” way of doing things it makes it harder to develop in any other way. That is because the Arduino IDE was purpose built for working with Arduino’s and the Arduino SDK so any libraries that get made to work in it will make things work using the Arduino API. It makes it hard to understand what really needs to be done because everything ends up getting hidden behind the SDK.

I figured out some ways to run LVGL example code using PlatformIO with Arduino Framwork.

I did this for both 2.8" and 7.0" Elecrow displays.

There are quite some library issues. I had no luck with Arduino IDE since the very beginning so PlatfromIO is quite a good alternative.

I’m not quite a forum guy so I don’t know how can I directly help but just let me know how I can help then I’ll try my best.

AYDIN