Recently, I have been trying to bind lvgl and Micropython (v1.23 esp-idf 5.0.4) together using lv-binding_macropython, but I have found that many interfaces are outdated.
Some C files still use # include “esp32/clk. h”, but in reality, the new version of the compilation environment requires # include “esp_clk. h”. Besides, there are still many areas that need to be modified
Is is possible to bind to latest Micropython v1.24 / v1.25?
There is an official branch that provides support for v1.24.
I think is now merged with master.
I meant the other one that @kdschlosser mentioned because that one supports my JC4827W543 display (LCD: NV3041A QSPI, TOUCH: GT911 I2C) as mentioned in JC4827W543 + Touch 911 · Issue #312 · lvgl-micropython/lvgl_micropython · GitHub
Or is it also possible with the official branch?
Im not sure. I also had a QSPI lcd and its hard caude micropytjon dosnt support QSPI so I meeded to create a custom QSPI module.
For me, work on the official port and the official micropython is cool, but requires work. If the lvgl_micropython offers a QSPI drivers I think the development will be easier.
Both Quad SPI and also Octal SPI works with a display in the MicroPython binding I wrote. As do displays that use low speed (< 10 mhz) 3 wire SPI to set up a bridge IC.
You are also able to to have a Touch IC, and/or an SDCard reader attached to the same SPI bus as the display with each of them supporting a different speed. It manages the CS line and there is no need to create and tear down the SPI bus over and over again like vanilla MicroPython has you do when you have more than a single device connected to an SPI Bus. Vanilla MicroPython also puts the managing the CS lines into the hands of the user. It doesn’t work this way in the binding I wrote. Everything is handled in the code I wrote making it easier for a user to get things working.
There are 34 supported display IC’s which some of them have different variations of them for different arrangements of panels connected to the IC. There are 14 touch IC’s that are supported and 5 different IO expanders as well.
You can also supply a TOML file to the build system that takes care of the build commands and it also writes the driver script and it bakes the driver script into the firmware. you can also bring in extension modules from outside sources to be compiled as well as components from the esp32 component registry.
It suppoorts these connection types to a display
SPI
SPI Quad
SPI Octal
I8080 8 lane
I8080 16 lane
I2C
RGB 8 lane
RGB 16 lane
LED light strips
DMA memory use is supported across almost all of the connection types. The LED light strip is the only one that doesn’t make use of DMA transfers.
The RGB driver is the fastest one that is made and it also handles rotation with almost zero impact on performance.
@kdschlosser thanks for your detailed answer! Can you please also answer my question above?
It would be very helpfull to use your binding with Micropython v1.24!
It already is…
MicroPython 1.24
ESP-IDF 5.2.3
LVGL 9.2.2
args… sorry - I meant v1.25 because the machine.USBDevice() feature was introducted in v1.24 (for RP2) and for ESP32 in v1.25
There is a lot of work that I am going to have to do to get it to work with 1.25. There were a lot of changes made and those changes are going to cause some issues that I will have to sort out. I want to give the release a few more weeks before I mess about with updating it because there are always a plethora of issues after each MicroPython release. I have already patched a lot of the bugs in 1.24 so I need to go through and see if those bugs have been fixed in 1.25 and if I am able to delete the patches I have made. or at least some of them.
thanks for the detailed info and your awesome work! Can’t wait for the new release
Hi @kdschlosser, I have tried to build the firmware for CYD ESP32 many times with a mod that adds additional 8MB SPIRAM memory (only 4MB is visible). I am switching to the update/micropython_v1.24.1 branch, because there is no lib/lv_bindings in master. Unfortunately, the firmware is still being built with Micropython version 1.20… without lvgl (but there is lv_utils, lv_color). For unix there’s lvgl included. What am I doing wrong? I am following the instructions on the project website and here on the forum. I am asking for detailed instructions on how to build this firmware. Which version of esd-idf should I use? I have not done this before and I am not sure if I am doing something wrong.
Additionally, I would like to include the ulab and espnow libraries, how do I do that?
I am not sure what you are doing because the binding that I have written doesn’t use MicroPython 1.20. Where are you getting the binding from?
@kdschlosser
#Below is the entire firmware building procedure that I perform in WSL (Ubuntu) on Windows:
#preparing esp-idf and idf.py
mkdir -p ~/esp
cd ~/esp
git clone -b v5.2.3 --recursive https://github.com/espressif/esp-idf.git # cloning idf repository
cd ~/esp/esp-idf
./install.sh all
#cloning lv_micropython and lv_bindings
git clone https://github.com/lvgl/lv_micropython.git lv_micropython
cd lv_micropython
git submodule update --init --recursive lib/lv_bindings
#calling above command returns the error: error: pathspec ‘lib/lv_bindings’ did not match any file(s) known to git
git checkout update/micropython_v1.24.1
#switching to branch ‘update/micropython_v1.24.1’
git submodule update --init --recursive lib/lv_bindings
now it works and clones
#building firmware
make -C mpy-cross
source ~/esp/esp-idf/export.sh
cd ports/esp32
make submodules BOARD=ESP32_GENERIC BOARD_VARIANT=SPIRAM
make LV_CFLAGS=“-DLV_COLOR_DEPTH=16” BOARD=ESP32_GENERIC BOARD_VARIANT=SPIRAM
Total size of firmware: 1567408
I upload the built firmware using Thonny to the modified CYD (ESP32 with SPIRAM), after reset I get the following result:
Lvgl is missing, MicroPython v1.20.0-2492.g48ea6e4cf, SPIRAM support implemented. What am I doing wrong???
How to add ulab library?
can you tell me how you are getting the folder “lib/lv_bindings”? In my case this folder is missed after cloning from
That is not the binding that I wrote. The one that I wrote is GitHub - lvgl-micropython/lvgl_micropython: LVGL module for MicroPython