Micropython with lvgl on the 7 inch viewe UEDX80480070E module #19385
predgington
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Moved this here from questions as decided this is probably a better place for it.
The UEDX80480070E is a 7 inch touch screen display with a 800x480 resolution and an esp32-S3. Its sort of a supersized CYD. It has 2 usb C ports labelled usb and uart.
Getting lvgl_micropython running on this and working with UI files created in Squareline Studio has been a multiday adventure to the point where I thought I should post this to help anyone considering doing the same. I should say that most of this has been done via the assistance of google gemini so though things appear to work I am in no way an expert in why they work!
Because the touch screen uses the same IO pins as the usb port you need to do some tweaking to disable the USB port (the UART one work fine). Also some of this may be overkill/redundant given gemini's suggestions to try multiple different things in a row as various problems arose.
I checked out from https://github.com/lvgl-micropython/lvgl_micropython. As I needed to edit details in the micropython submodule I went overkill and cloned everything.
git clone --recurse-submodules https://github.com/lvgl-micropython/lvgl_micropython.git
I then made the following edits as suggested by gemini.
Edited lib/micropython/ports/esp32/boards/ESP32_GENERIC_S3/sdkconfig.board and added this:
Edited lib/micropython/ports/esp32/boards/ESP32_GENERIC_S3/mpconfigboard.h
Added:
Even after these it appeared the firmware included some USB initialisation so I also had to edit lib/micropython/ports/esp32/main.c and comment out the following usb initialisation lines in mp_task:
Note you should only do this is you are using a copy of the archive only for producing firmware for this given board as it will probably mess up firmware for other boards.
After doing that compile using the following command and upload the firmware to the board:
python3 make.py esp32 BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=SPIRAM_OCT DISPLAY=rgb_display INDEV=gt911 --flash-size=16In Squareline studio create a project. Select Micropython for Unix and other platforms. At the current time the latest, and most compatible, version of lvgl to use is 9.22.
As lvgl_micropython, at the current time, supports 9.4 and the nonstandard way squarespace studio does things there are some tweaks that need to be done. I was hoping not to have to edit the ui files created by squareline studios but that appears to not be feasible.
Firstly you need to create a file called lvgl_patched.py containing the following:
This is mainly to reduce the editing of the ui files to a minimum.
In the ui.py file created in squareline studio you need to change the initial lvgl import so:
import lvgl as lvbecomesimport lvgl_patched as lvThen in any call back you have created from button etc you need to change:
event = event_struct.codetoevent = event_struct.get_code()Finally you need a main.py. This example included one example of defining a callback for a button press.
I have only just reached this point and I am sure that more issues will raise their heads but hopefully this helps someone.
Beta Was this translation helpful? Give feedback.
All reactions