lvgl / lv_port_esp32

LVGL ported to ESP32 including various display and touchpad drivers
MIT License
1.03k stars 436 forks source link

ESP IDF v5 support #314

Open ammaree opened 2 years ago

ammaree commented 2 years ago

We use GitHub issues for development related discussions. Please use the forum to ask questions.

Describe the issue Fail to rebuild app after IDF upgrade

Code to reproduce the issue Nothing changed from previous working code other than IDF upgrade

Expected Results Working, error free compile

Actual Results Various error messages

ESP32 Chip version ESP32 WROVER

ESP-IDF version v5 (Master)

Development kit used ESP-WROVER-DEVKIT v4.1

Development machine OS MacOS

Compilation warnings/errors (if available) ` /Users/andremaree/Dropbox/devs/ws/z-repo/lvgl_esp32/lvgl_esp32_drivers/lvgl_tft/esp_lcd_backlight.c:10:10: fatal error: driver/ledc.h: No such file or directory 10 | #include "driver/ledc.h"

/Users/andremaree/Dropbox/devs/ws/z-repo/lvgl_esp32/lvgl_esp32_drivers/lvgl_tft/disp_spi.c:10:10: fatal error: driver/gpio.h: No such file or directory 10 | #include "driver/gpio.h"

/Users/andremaree/Dropbox/devs/ws/z-repo/lvgl_esp32/lvgl_esp32_drivers/lvgl_tft/disp_spi.h:18:10: fatal error: driver/spi_master.h: No such file or directory 18 | #include <driver/spi_master.h> `

If possible, copy the compilation log into a file and attach it here

ammaree commented 2 years ago

Any feedback appreciated. I have had a look and it appears that the PWM backlight support might need to be updated.

sukesh-ak commented 2 years ago

@ammaree You should check Migration guide since there are some breaking changes

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/migration-guides/peripherals.html#lcd

ammaree commented 2 years ago

All the required changes have been made. If I remove the display/GUI component of the project it builds, links and runs reliably.

The changes required I believe, are in the lvgl component.

On 2022/07/02, 14:52, "Sukesh Ashok Kumar" @.**@.>> wrote:

@ammareehttps://github.com/ammaree You should check Migration guide since there are some breaking changes

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/migration-guides/build-system.html

— Reply to this email directly, view it on GitHubhttps://github.com/lvgl/lv_port_esp32/issues/314#issuecomment-1172893667, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAYT7GDVJKI6B6G2WHECXPTVSA3SFANCNFSM5Y2UU3RA. You are receiving this because you were mentioned.Message ID: @.***>

sukesh-ak commented 2 years ago

@ammaree The initial errors you reported says those files/folders are not found. So i am guessing the location of files have changed.

ammaree commented 1 year ago

@kisvegabor It seems that the ESP32 port for LVGL (this repo) is still fixed to a 2 year old version of LVGL. In order for us to make some decisions, and hopefully move forward, answers to a couple of questions will be highly appreciated.

  1. What are the plans, if any, for updating this repo to support ESP IDF v5.x?
  2. What are the plans, if any, for updating this repo to support LVGL v8.x?
  3. If no plans for the above, any pointers to an example we can use to try and get the above working?

Thanks in anticipation...

sukesh-ak commented 1 year ago

ESP-IDF 5.x is going with a direction using the concept of BSP. You can see some of the implementations here. https://github.com/espressif/esp-bsp

There is also a new driver architecture being discussed for lvgl next version here

kisvegabor commented 1 year ago

Thank for tagging me.

I think the best would be to

  1. update this repo for LVGL v8 and ESP-IDF 4
  2. make LVGL v9 (under development) support ESP-IDF v5.

LVGL v9 will include all the layers to connect LVGL and ESP-IDF by enabling a config in lv_conf.h.

What do you think about it?

sukesh-ak commented 1 year ago

Thank for tagging me.

I think the best would be to

  1. update this repo for LVGL v8 and ESP-IDF 4
  2. make LVGL v9 (under development) support ESP-IDF v5.

LVGL v9 will include all the layers to connect LVGL and ESP-IDF by enabling a config in lv_conf.h.

What do you think about it?

LVGL 8.x is working fine with LovyanGFX driver, so I am fine for now. Hope Espressif populates all the display drivers in their bsp repo.

nicklasb commented 1 year ago

Hi, having the same problem, not sure how to interpret the discussion, is there any solution to this issue?

sukesh-ak commented 1 year ago

Hi, having the same problem, not sure how to interpret the discussion, is there any solution to this issue?

What display and controller?

sukesh-ak commented 1 year ago

Hi, having the same problem, not sure how to interpret the discussion, is there any solution to this issue?

Here is the IDF 5.0 project working with LovyanGFX as the driver for LVGL 8.x

LovyanGFX driver details are in the config files under main/devices folder https://github.com/sukesh-ak/ESP32-TUX

nicklasb commented 1 year ago

Hi, having the same problem, not sure how to interpret the discussion, is there any solution to this issue?

Here is the IDF 5.0 project working with LovyanGFX as the driver for LVGL 8.x

LovyanGFX driver details are in the config files under main/devices folder https://github.com/sukesh-ak/ESP32-TUX

Hi, I use ILI9488 + XPT2046, so that should work, problem is I use PlatformIO which doesn't ship with the later ESP-IDF. So I will try that out with plain ESP-IDF at some later point in time, but thanks anyway, didn't know about that driver.

Kind regards, Nicklas

sukesh-ak commented 1 year ago

@nicklasb When ESP32-S3 came out, PlatformIO took a while to update. That's when I completely shifted to using ESP-IDF.

PlatformIO had a benefit for library integration using the config file. But now with IDF 5.0 onwards, IDF is moving in that direction with https://components.espressif.com/

In the context of LVGL, IDF 5.0 is moving to have BSP (Board Support Package) for devices on the components website. It's still new effort so only Espressif devices are available for now here https://github.com/espressif/esp-bsp

sukesh-ak commented 1 year ago

@nicklasb Your lcd + touch is already available as components.

ILI9488 => https://components.espressif.com/components/atanisoft/esp_lcd_ili9488 XPT2046 => https://components.espressif.com/components/atanisoft/esp_lcd_touch_xpt2046

nicklasb commented 1 year ago

@nicklasb When ESP32-S3 came out, PlatformIO took a while to update. That's when I completely shifted to using ESP-IDF.

PlatformIO had a benefit for library integration using the config file. But now with IDF 5.0 onwards, IDF is moving in that direction with https://components.espressif.com/

In the context of LVGL, IDF 5.0 is moving to have BSP (Board Support Package) for devices on the components website. It's still new effort so only Espressif devices are available for now here https://github.com/espressif/esp-bsp

It is also about the IDE integration and so on, but thanks for the info on the components!

sukesh-ak commented 1 year ago

@nicklasb When ESP32-S3 came out, PlatformIO took a while to update. That's when I completely shifted to using ESP-IDF. PlatformIO had a benefit for library integration using the config file. But now with IDF 5.0 onwards, IDF is moving in that direction with https://components.espressif.com/ In the context of LVGL, IDF 5.0 is moving to have BSP (Board Support Package) for devices on the components website. It's still new effort so only Espressif devices are available for now here https://github.com/espressif/esp-bsp

It is also about the IDE integration and so on, but thanks for the info on the components!

Espressif VS Code extension is really good now. Including installing ESP-IDF through the IDE.

nicklasb commented 1 year ago

@nicklasb When ESP32-S3 came out, PlatformIO took a while to update. That's when I completely shifted to using ESP-IDF. PlatformIO had a benefit for library integration using the config file. But now with IDF 5.0 onwards, IDF is moving in that direction with https://components.espressif.com/ In the context of LVGL, IDF 5.0 is moving to have BSP (Board Support Package) for devices on the components website. It's still new effort so only Espressif devices are available for now here https://github.com/espressif/esp-bsp

It is also about the IDE integration and so on, but thanks for the info on the components!

Espressif VS Code extension is really good now. Including installing ESP-IDF through the IDE.

Also, I am not only using ESP-IDF or only Espressif MCU:s for my projects, I am trying to avoid vendor lock-in in all my ventures, if there is a community-driven approach, I try to stay with that as long as possible.

nicklasb commented 1 year ago

TBH, Espressif could just as well have supported PlattformIO instead of creating a proprietary and competing platform.

sukesh-ak commented 1 year ago

TBH, Espressif could just as well have supported PlattformIO instead of creating a proprietary and competing platform.

Not sure which one that is (proprietary and competing platform). PlatformIO uses either ESP-IDF or ESP-ArduinoCore (built using ESP-IDF) behind the scene. Espressif supports VS Code and Eclipse option.

I think we are hijacking this issue now :)

nicklasb commented 1 year ago

Are you saying that PlatformIO support of all these platforms using ESP-IDF? https://docs.platformio.org/en/stable/platforms/

I guess we are, but it feels like I and many others have totally misunderstood something in that case.

sukesh-ak commented 1 year ago

They integrate a build system to compile using the supported proprietary framework. ESP-IDF/ESP-ArduinoCore in the case of Espressif controllers.

Following from the above link you shared.

Check your platformio.ini file which shows framework = espidf https://docs.platformio.org/en/latest/frameworks/espidf.html

nicklasb commented 1 year ago

Check your platformio.ini file which shows framework = espidf

Ok, but again, the code I am writing is not only going to run on Espressif MCU:s as I carefully avoid vendor lock-in. So sometimes, it will say framework=somethingelse.

PlatformIO provides me with a layer between me and the manufacturers, and that is very important to me, and obviously many other PlatformIO users.

sukesh-ak commented 1 year ago

Check your platformio.ini file which shows framework = espidf

Ok, but again, the code I am writing is not only going to run on Espressif MCU:s as I carefully avoid vendor lock-in. So sometimes, it will say framework=somethingelse.

PlatformIO provides me with a layer between me and the manufacturers, and that is very important to me, and obviously many other PlatformIO users.

Guess you are using Arduino then which provides this layer using Wire and other standards protocols. This is, if the said microcontroller supports these standard protocols (in short Arduino support).

One benefit of PlatformIO => silently downloads framework/sdks when you install a platform in it. Definitely provides convenience.

Feel free to open a discussion here, if you want to continue => https://github.com/sukesh-ak/ESP32-TUX/discussions I don't want this issue to be hijacked :)

nicklasb commented 1 year ago

Tech comes and goes, there are many exciting platforms besides Arduino and ESP32, and either way I would never write only for any singular tech. I am just saying the same thing again and again, basically, so let's end it here.

sukesh-ak commented 1 year ago

Tech comes and goes, there are many exciting platforms besides Arduino and ESP32, and either way I would never write only for any singular tech. I am just saying the same thing again and again, basically, so let's end it here.

Cool. In the PC world its possible but not that much in the MicroController world because hardware is proprietary.

Several of them support Wire protocol including Raspberry Pi (WiringPi) so some portion of code can be reused. Otherwise, if a controller runs FreeRTOS then a lot of things can be similar. For example, AzureRTOS (known as ThreadX RTOS earlier before MS purchased it) has a FreeRTOS layer which is useful for porting in the case of STM32 controllers, since they have moved to AzureRTOS.

Espressif uses FreeRTOS and now there is an Amazon version (after Amazon took over - FAQ).

nicklasb commented 1 year ago

If you wan't to end a conversation, you can't make broad comparisons with the "PC World" and tell me where things are at like that. :-)

I see no huge issues making MCU project pretty much hardware independent. The PC World is like it is that only because of the gigabytes of compatibility layer code that is everywhere. The hardware of that world with its huge amount of highly complex components (multiple MCUs) and motherboards is actually way more complex and diverse than the MCU world. Only web devs think that browsers float in mid air.

sukesh-ak commented 1 year ago

If you wan't to end a conversation, you can't make broad comparisons with the "PC World" and tell me where things are at like that. :-)

I see no huge issues making MCU project pretty much hardware independent.

It already exist called Arduino using Wire protocol (like I mentioned earlier). Runs on several controllers already.

Hobby projects with single source files have been easy to make it work on different controllers. If its otherwise, share a link of your project working on different micro-controllers so that I can educate myself.

nicklasb commented 1 year ago

Hobby projects with single source files have been easy to make it work on different controllers. If its otherwise, share a link of your project working on different micro-controllers so that I can educate myself.

Could we perhaps de-escalate a bit here? I am just stating my goals and ambitions, I am sorry if they offend you, but I am afraid I will keep them regardless. Also, please don't read any attitudes in what I am writing.

But I have been developing in anything from assembler to javascript for 35 years now, and code is code, and business is business. And I do know a bit of both. And because of that, perhaps I am ready to #if a bit more than most.

sukesh-ak commented 1 year ago

Chill. You didn't offend me :) Sounds like we started during similar timelines. I remember using inline assembly to move mouse cursor during MS-DOS/Win 3.x times. Also writing TSR programs in those days.

Good luck with your projects and I believe you can make it happen with enough #if like you mentioned.

ammaree commented 1 year ago

Thank for tagging me.

I think the best would be to

  1. update this repo for LVGL v8 and ESP-IDF 4
  2. make LVGL v9 (under development) support ESP-IDF v5.

LVGL v9 will include all the layers to connect LVGL and ESP-IDF by enabling a config in lv_conf.h.

What do you think about it?

@kisvegabor

I think that ESP-IDF V5.x support should be incorporated into LVGL v8.x ASAP.

The current lv_port_esp32 repo is already 2 years old and still tied to IDF V4 (and V3) as well as LVGL v7.9 (I think)

Considering the growing market share and acceptance of the ESP32 {S?/C?/H?] it will allow many developers to move to LVGL v8.x and IDF v5.x, possibly with optional v4.x support?

Personally, the sooner we can have IDF v5 with LVGL v8, the better

kisvegabor commented 1 year ago

I definitely agree on updating to LVGL v8 and IDF v5, however unfortunately I have no capacity to work on it now.

We have a sponsorship program and I'd be happy to give a few hunred USD if someone updates this repo (and maybe lvgl_esp32_drivers too?) to LVGL v8 and IDF v5.

Would you be interested in it?

zackees commented 1 year ago

FYI: They upgraded v5 but didn't release an arduino port. I'm trying to port it now and it's a mess.

sukesh-ak commented 1 year ago

FYI: They upgraded v5 but didn't release an arduino port. I'm trying to port it now and it's a mess.

Arduino versions are generated automatically when ESP-IDF is released https://github.com/espressif/arduino-esp32

zackees commented 1 year ago

So the mainline supports v5.X and the releases only go up to 4.3 is that correct?

zackees commented 1 year ago

The docs say it's only upto 4.3

Maldus512 commented 1 year ago

I think that ESP-IDF V5.x support should be incorporated into LVGL v8.x ASAP.

Are you talking about this specific example (lv_port_esp32) or the LVGL library itself? If the latter could you clarify what needs to be incorporated? I haven't used ESP-IDF v5.0 extensively but I can't think of anything that changed on the build system part - besides support for makefile being dropped.

ammaree commented 1 year ago

@Maldus512

Apologies, should have been more clear, lv_port_esp32 is (was?) the problem. We have in the mean time changed to use LVGL 8.x (master) with LGFX (master) and that seems to work well. Ultimately the ideal would be latest LVGL with drivers offering:

smallest memory (SRAM and flash) footprint highest refresh performance broadest MCU, display and touch controller support.

Most probably LGFX drivers with LVGL?

stale[bot] commented 1 year ago

This issue or pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

exislow commented 10 months ago

Would be great, if somebody could port it to esp-idf v5

ammaree commented 9 months ago

@kisvegabor

Another 10 months later, is there ANY working configuration of LVGL with ESP-IDF v5.1.x or later, preferably v5.2.x?

If not, any plans to ever support ESP-IDF version v5.x?

mhaberler commented 9 months ago

@ammaree take this as a starting point: https://github.com/mhaberler/ESP32-TUX/commits/additional-platforms/

nicklasb commented 9 months ago

@ammaree take this as a starting point: https://github.com/mhaberler/ESP32-TUX/commits/additional-platforms/

@mhaberler I suppose that @ammaree asked not on how to create an Lvgl version for ESP-IDF 5 port himself. If not, my bad. However, that is my question, and if I understand @kisvegabor correctly, this is not in the works. (And nothing Squareline is considering either then, I suppose).

kisvegabor commented 9 months ago

I'm not planning to update this repository, however if someone is interested in working on it, let me know.

We will release LVGL v9 on January 15, and from v9 we will move all display driver to the LVGL repo directly and I'm more interested in working on that. If you would like to contribute to that, it would be more than welcome. If there are any special IDF v5 consideration, please let me know in an issue in the main LVGL repo.

nicklasb commented 9 months ago

If there are any special IDF v5 consideration, please let me know in an issue in the main LVGL repo.

I am not sure what you mean with IDF v5 considerations, are you saying that LVGL already supports ESP-IDF? If so, I have missed that information completely. I can see that there is an ESP-IDF component now..but does that mean ESP-IDF and not something else?

If not, the problem I think is that people doesn't know where to start. Perhaps if you could help jump starting this in some way by creating an issue where you list what needs to be done?

kisvegabor commented 9 months ago

Oh, maybe there is a fundamental misunderstanding here. So let's start from the beginning:

nicklasb commented 9 months ago

Wow, there certainly is a misunderstanding. And great news! That the PR won't come until January is hardly a problem, I have waited around here for a year now, have no issues with doing something else for a couple of more weeks. :-)

I think that some people end up here on the esp32 port and never leave, they aren't reached by any communication about mainline ESP-IDF support. And this thread might be a bit TLDR. I for example have chosen to work on other aspects of my stuff the last year, and this has been the only place I have seen updates. I guess I could have understand it from something above, however i don't seem to be alone in that.

Some proposals then:

  1. On packages, please change the mention of "ESP32 component" into "ESP-IDF (ESP32) component" or something that indicates not only ESP32 but specifically ESP-IDF support.
  2. Also try say ESP-IDF, not ESP or IDF. As they won't help with internet searches.
  3. On this repository, make a huge banner on the front pages that redirects users to the man LVGL with some of the above information.
  4. Agreed on the docs, it would be great if at least the basic info that have come up here goes in there.
kisvegabor commented 9 months ago

On packages, please change the mention of "ESP32 component" into "ESP-IDF (ESP32) component" or something that indicates not only ESP32 but specifically ESP-IDF support.

Which "packages" do you mean exactly? Could you send a link?

Also try say ESP-IDF, not ESP or IDF. As they won't help with internet searches.

Noted, thanks!

On this repository, make a huge banner on the front pages that redirects users to the man LVGL with some of the above information.

I agree, once we will have those 2 PR merged, I will add the banner.

Agreed on the docs, it would be great if at least the basic info that have come up here goes in there.

This is what I have in mind as a table of content. Please add anything that seems to be missing.

nicklasb commented 9 months ago

Great!

Which "packages" do you mean exactly?

On the main README on the repo: https://github.com/lvgl/lvgl Under "Packages" - "LVGL is available as:" - "ESP32 component". "ESP-IDF(ESP32) component" would have all the buzzwords and not mislead.

WRT headings, they look the part, just a small complaint would be about "Links the ESP docs", even though I hesitate, as extrasensory perception sure would be useful in programming some times. :-)

kisvegabor commented 9 months ago

Ahh, updated here :slightly_smiling_face:

WRT headings, they look the part, just a small complaint would be about "Links the ESP docs", even though I hesitate, as extrasensory perception sure would be useful in programming some times. :-)

Do you still mean in the README? If so, I think once we will have a better ESP-IDF docs on our website, we should link it from the README too.

nicklasb commented 9 months ago

LOOKING FOR ESP-IDF 5.x SUPPORT? DO NOT LOOK HERE BUT IN THE MAINLINE LVGL

(It has been in there since v8.3, don't be like me and mope around in this repo forever)

@ammaree , @mhaberler