What is the oficial way for micropython in esp32 version

I see that the esp32 port is in an old esp-idf version, and in the last post related to esp32-s3 the solution was to use another repository. Is this the ‘official’ solution? will it be a new version of the port?
I want to upgrade the version of my programs and I want to go the most supported way.

That one is using IDF version 5.2.3, LVGL 9.2.2 and MicroPython 1.23

So this is the right way, doesn´t it?

There is no “official way”, at least not yet. The LVGL team support the MicroPython bindings but how they’re used is left up to the community.

@kdschlosser has provided one way to get a running MicroPython system with LVGL, the bindings and some drivers.

Thanks @matt.trentini

The binding that I have put together makes it easier for a user to get up and running. It also makes it a lot easier to stay up to date with new version releases of LVGL, MicroPython and also the ESP-IDF (restricted to highest version MicroPython is able to use). It also includes a bunch of driver for display, input devices, IO expanders and even an SPI3Wire driver for displays that have bridge IC’s. There is a driver framework that makes it really easy to add a driver if one is not provided.

I am used to the micropython code, and this way of doing things is not ease for me.
A python script to orchestrate how to compile code, with CMake and ninja running down … it too much for me.
I have developed a python module, and now I don´t know how to compile it in this new way of doing things.

I appreciate your help, but why not to integrate lv_binding (version 9 ) with micropython as we are used to?

I will look at lv_binding, so I hope I will find a way to integrate it with new esp-idf and lvgl versions.

thanks

It’s a single build command. It is by far a whole lot easier to compile that the official binding is.

if you are running on Ubuntu you would use the following command to install a couple of requirements

sudo apt-get install build-essential pkg-config cmake ninja-build

and as an example, if you are using an MCU that has these specs

  • esp32-s3
  • 32mb FLASH
  • 8mb PSRAM
  • FLASH is octal
  • PSRAM is octal
  • UART serial

and it is connected to this display

  • ST7796 display IC
  • GT911 Touch IC

Then the build command is…

make.py esp32 BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=OCT_SPIRAM --flash-size=32 --octal-flash --enable-uart-repl=y --enable-cdc-repl=n DISPLAY=st7796 INDEV=gt911

You don’t need to do anything else. the build script takes care of collecting MicroPython, ESP-IDF and any other build requirements.

When it is done compiling it packages the compiled binaries into a single binary to make it easier for you to flash to your device. The command to flash the binary and the location of the binary is provided at the end of the build.

1 Like

Yes, it is a straightforward method to get good firmware with lvgl, but I need to customice it (add a font and a module) and I am used to the old way.
How can I add this module and this font in your framework?
I may study this new way, but only if this is, more or less, the way to go. My project is a home project and I do not have much time for it. I want to get the new versions (esp-idf, micropython and lvgl) with it, but maybe it is time to migrate to C.

well this has the latest version of LVGL and MicroPython. due to MicroPython only supporting up to IDF 5.2.2 and that binding is using 5.2.3 I would say we are ahead of the curve.

If you need to add user_c_modules then you use the USER_C_MODULE=path/to/micropython.cmake build directive. You can upload fonts to the MCU as a file and use the builtin LVGL file system driver to read the font file.

it works, now I have modern lvgl and my module in the same modern micropython.

I will investigate more. I may need some assistance in the future.

Thank you

1 Like

I told ya it was a whole lot easier to get up and running. The code that I wrote for the build process does all of the work instead of having to key in everything from the command line yourself.It makes easier is all. A single command to build and then one to flash is all that is needed. I have provided frameworks for a user to easily add a custom display driver or a custom touch driver. If any of the behavior of a built in driver needs to be changed it is able to very easily be done in Python code.

Could you provide an example build command for the ESP32-S3 for the Waveshare device… https://www.waveshare.com/esp32-s3-touch-lcd-7.htm

python3 make.py esp32 BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=SPIRAM_OCT --flash-size=8 --octal-flash --enable-uart-repl=y --enable-cdc-repl=n DISPLAY=rgb_display INDEV=gt911
1 Like