STM32F746G - Micropython lvgl compile issue

Unable to compile the LVGL source for STM32

make -C ports/stm32 BOARD=STM32F7DISC MICROPY_PY_LVGL=1
make: Entering directory ‘/home/sands/01_Projects/STM32/lv_micropython/ports/stm32’
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
LVGL-GEN build-STM32F7DISC/lvgl/lv_mpy.c
File “…/…/lib/lv_bindings/gen/”, line 1778
return (user_data if user_data_found else None), *get_user_data_accessors(containing_struct, containing_struct_name)
SyntaxError: invalid syntax
…/…/extmod/ recipe for target ‘build-STM32F7DISC/lvgl/lv_mpy.c’ failed
make: *** [build-STM32F7DISC/lvgl/lv_mpy.c] Error 1
make: *** Deleting file ‘build-STM32F7DISC/lvgl/lv_mpy.c’
make: Leaving directory ‘/home/sands/01_Projects/STM32/lv_micropython/ports/stm32’

Kindly suggest…

upgrade your python3 version. You need to be running 3.10+

Thanks for the reply, successfully compiled…

Ported into STM32F746DISC board, but display part not working…

import lvgl as lv

import lvstm32 as st

after importing lvstm32 getting error...

import lvstm32 as st
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: no module named 'lvstm32'

pls suggest...

I have no idea what lvstm32 is. I have never seen that before.


We are following this BLOG to evaluate the STM32F746DISC LCD functionality using micropython…

yeah that blog post is 4 years old. little bit dated and things have changed since then.

The only kind of display that is going to be supported is SPI. Currently DMA memory is not able to be taken advantage of so using double buffering is pointless to do. The biggest issue with STM32 is the lack of a clear defined API for display busses in their SDK. The other issue with STM32 are the ways it goes about handling the different display bus types and it changing to something completely different based on the MCU model being used. This adds a HUGE amount of code that needs to be written and coming up with a consistent API gets very hard. The idea is to keep the user entry point identical across the board for all MCUs and that becomes incredibly hard to do when you have 3 or 4 different ways of handling say an I8080 bus and those 3-4 different ways are only for STM32.

STM32 in MicroPython is doing to require to to write your own display driver. There are 2 ways that is able to be done. You can use SPI that is already apart of MicroPython or you can write a driver in C code that is accessible from Python.

Yes, that blog post is old, there were lot of changes since then.
I have found that file searching github repo, but it was removed in 2021:

It did not any special thing, and the new lv_utils event loop replaced it.

There are generic (purely MicroPython code) display drivers, please check those:

Thanks for the inputs, we will check on this and proceed…

Thanks for the details…