sukesh-ak / LVGL8-WT32-SC01-IDF

ESP32 + WT32-SC01 + LOVYANGFX + LVGL8 using ESP-IDF (C++)
The Unlicense
50 stars 18 forks source link

ESP-IDF v5.x support #2

Closed dizcza closed 2 years ago

dizcza commented 2 years ago

First of all, thanks for making your work public. Seems like it's the only repo providing some support for the WT32-SC01 dev board family.

I cannot build it with the latest ESP-IDF v5.0 though. Don't know if LVGL has the same problem, but at least LGFX does have: https://github.com/lovyan03/LovyanGFX/issues/282

Could you work it out? I'm ready to test it from my side.

Also, have you tried poring the native esp_lcd component? It's worth a try, and I see other people have tried it as well: https://github.com/esphome/feature-requests/issues/1084#issuecomment-842239946. If it's similar to ST7789 (esp_lcd provides built-in support for ST7789), then it should be ported without problems, shouldn't it?

Also, is it possible not to use LGFX?

sukesh-ak commented 2 years ago

First of all, thanks for making your work public. Seems like it's the only repo providing some support for the WT32-SC01 dev board family.

I cannot build it with the latest ESP-IDF v5.0 though. Don't know if LVGL has the same problem, but at least LGFX does have: lovyan03/LovyanGFX#282

Could you work it out? I'm ready to test it from my side.

Also, have you tried poring the native esp_lcd component? It's worth a try, and I see other people have tried it as well: esphome/feature-requests#1084 (comment). If it's similar to ST7789 (esp_lcd provides built-in support for ST7789), then it should be ported without problems, shouldn't it?

Also, is it possible not to use LGFX?

Thank you for the appreciation.

The latest released version of ESP-IDF is v4.3.4 https://github.com/espressif/esp-idf/releases/tag/v4.3.4

If you use pre-release version there are chances of broken builds all the time. I used to take master branch and after wasting time earlier chasing the bugs, I decided to stick to released build.

I will update the sample once ESP-IDF v5 is released.

In the mean time, please use this updated sample for your work. Read the README.md for all the details. https://github.com/sukesh-ak/ESP32-LVGL8x-SDSPI

Espressif had several attempts to create display driver and all the previous efforts have been missing all the required drivers. Thus I decided to use LovyanGFX which is similar in architecture and has all the drivers already available. The other benefit is that, LovyanGFX drivers work with both Arduino & ESP-IDF which make life easier for quick testing with Arduino and then on to ESP-IDF.

Some reference from earlier. https://github.com/lvgl/lvgl_esp32_drivers/issues/176

dizcza commented 2 years ago

Thanks for the detailed feedback.

Unfortunately, I've already ported everything to the pre-release ESP-IDF v5.x. I often fire issues on their github and therefore require building their master branch to check if the problem is still there. I've tried making two copies of ESP-IDF on my machine, but it's a headache. Let me see if I can come up with a solution.

It seems you have multiple repositories with shared payloads, it's not easy to understand which one I need. Does SD SPI means it's been developed to support SD cards with SPI interface? WT32-SC01 does not have a slot for SD cards (extension boards do have, but I don't own one).

dizcza commented 2 years ago

Good news! Your project works with the latest LovyanGFX "develop" branch and ESP-IDF v5.1-dev-96-gafc6fba7f5-dirty. Both the screen drawings and the touches.

sukesh-ak commented 2 years ago

@dizcza Glad you got it working.

https://github.com/sukesh-ak/ESP32-LVGL8x-SDSPI This is an ESP-IDF sample you can use as a template for your UI projects using LVGL with ESP-IDF & ESP32 / ESP32-S3.

3 sample configuration included already with just a header file to show how its done easily.

  1. Unexpected Maker FeatherS3 (ESP32-S3) + Adafruit 2.4" TFT Featherwing
  2. Unexpected Maker TinyS3 (ESP32-S3) + 1.3" TFT - ST7789 240x240
  3. Wireless Tag WT32-SC01 (3.5" TFT Touch Display)

Some features included

ammaree commented 2 years ago

@sukesh-ak

This looks wonderful but I am missing support for 2 additional dev boards:

ESP-WROVER-KIT with 320x240 SPI without touch https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-wrover-kit.html

Makerfabs ESP32-S3 with 480x320 parallel 3.5" https://www.makerfabs.com/esp32-s3-parallel-tft-with-touch-ili9488.html

Any help to get the same demos working on these will be much appreciated.

sukesh-ak commented 2 years ago

@sukesh-ak

This looks wonderful but I am missing support for 2 additional dev boards:

ESP-WROVER-KIT with 320x240 SPI without touch https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-wrover-kit.html

Makerfabs ESP32-S3 with 480x320 parallel 3.5" https://www.makerfabs.com/esp32-s3-parallel-tft-with-touch-ili9488.html

Any help to get the same demos working on these will be much appreciated.

Please open an issue on this repo and I will check later today. https://github.com/sukesh-ak/ESP32-LVGL8x-SDSPI/

dizcza commented 1 year ago

@sukesh-ak Do you have by chance the correct pinout for WT32-SC01? Seems the datasheet has gotten it wrong... damn it. Blind engineering won't take me far.

That's me who got it wrong!

Anyway, I have another question. I'm using 2 ports of I2C in my project running in different threads. And it's shared with a touchscreen here. You mentioned that UI is thread-safe in your project above. But how to make it thread-safe with sensors periphery? Should the user provide another synchronization layer on top of LVGL and touchscreen API?

sukesh-ak commented 1 year ago

@dizcza This is the sample which is thread safe https://github.com/sukesh-ak/ESP32-TUX

Check the readme for details about lvgl_acquire/lvgl_release

sukesh-ak commented 1 year ago

@dizcza Hope to make a walkthrough video of the sample soon.