lvgl / lv_binding_micropython

LVGL binding for MicroPython
MIT License
237 stars 156 forks source link

Try build for esp32_psram #283

Closed straga closed 1 year ago

straga commented 1 year ago
[100/100] cd /opt/upy/lv_micropython/ports/esp32/build-GENERIC_SPIRAM/bootloader/esp-idf/esptool_py && /root/.espressif/python_env/idf4.4_py3.6_env/bin/python /opt/upy/tools/esp-idf-v4.4.5/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 /opt/upy/lv_micropython/ports/esp32/build-GENERIC_SPIRAM/bootloader/bootloader.bin
Bootloader binary size 0x55f0 bytes. 0x1a10 bytes (23%) free.
[1075/1615] Generating ../../lv_mp.c
FAILED: lv_mp.c
cd /opt/upy/lv_micropython/ports/esp32/build-GENERIC_SPIRAM/esp-idf/main && /root/.espressif/python_env/idf4.4_py3.6_env/bin/python3.6 /opt/upy/lv_micropython/lib/lv_bindings/gen/gen_mpy.py -M lvgl -MP lv -MD /opt/upy/lv_micropython/ports/esp32/build-GENERIC_SPIRAM/lv_mp.c.json -E /opt/upy/lv_micropython/ports/esp32/build-GENERIC_SPIRAM/lv_mp.c.pp /opt/upy/lv_micropython/lib/lv_bindings/lvgl/lvgl.h > /opt/upy/lv_micropython/ports/esp32/build-GENERIC_SPIRAM/lv_mp.c || ( rm -f /opt/upy/lv_micropython/ports/esp32/build-GENERIC_SPIRAM/lv_mp.c && /bin/false )
  File "/opt/upy/lv_micropython/lib/lv_bindings/gen/gen_mpy.py", line 1769
    return (user_data if user_data_found else None), *get_user_data_accessors(containing_struct, containing_struct_name)
                                                     ^
SyntaxError: invalid syntax
[1089/1615] Generating /opt/upy/lv_micropython/mpy-cross/build/mpy-cross
make[1]: Entering directory '/opt/upy/lv_micropython/mpy-cross'
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
GEN build/genhdr/mpversion.h
CC ../py/modsys.c
CC main.c
LINK build/mpy-cross
   text    data     bss     dec     hex filename
 305494   13848     840  320182   4e2b6 build/mpy-cross
make[1]: Leaving directory '/opt/upy/lv_micropython/mpy-cross'
[1091/1615] Building C object esp-idf/libsodium/CMakeFiles/...m/crypto_generichash/blake2b/ref/blake2b-compress-ref.c.ob
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
make: *** [Makefile:67: deploy] Error 2
make: Leaving directory '/opt/upy/lv_micropython/ports/esp32'
amirgon commented 1 year ago

Please provide a complete description how to reproduce your problem:

straga commented 1 year ago
  1. python:3.6-buster - docker
  2. source /opt/upy/tools/esp-idf-v4.4.5/export.sh or esp-idf-v4.3.5
  3. https://github.com/lvgl/lv_micropython/commit/3f25a765dafd5742639b85e94e845e370f73057f
  4. make -C ports/esp32 LV_CFLAGS="-DLV_COLOR_DEPTH=16" BOARD=GENERIC_SPIRAM deploy
  5. just run command from readme from lv_micropython

look like need remove . `return (user_data if user_data_found else None), get_user_data_accessors(containing_struct, containing_struct_name) `

to

a1, a2 = get_user_data_accessors(containing_struct, containing_struct_name)
return (user_data if user_data_found else None), a1, a2

also

def get_arg_name(arg):
    if isinstance(arg, c_ast.PtrDecl) or isinstance(arg, c_ast.FuncDecl):
        return get_arg_name(arg.type)
    if hasattr(arg, 'declname'): return arg.declname
    if hasattr(arg, 'name'): return name 
    return 'unnamed_arg'

if hasattr(arg, 'name'): return name -> if hasattr(arg, 'name'): return arg.name

Now firmware build. Need check flash real device esp32+ili9341+xpt2046 = work, but render very slow.

amirgon commented 1 year ago

esp32+ili9341+xpt2046 = work, but render very slow.

Do you use the generic driver or the ESP32 driver?

straga commented 1 year ago

ESP32 driver

from ili9XXX import ili9341

amirgon commented 1 year ago

What is the frame rate you are seeing? (you can enable LV_USE_PERF_MONITOR to see frame rate) I've seen anything between 10FPS to 50FPS depending on the GUI complexity and the size of the area that is refreshed (LVGL tries to update only the areas that change between frames).
Also, you didn't specify what you tried to run. Does it happen with any LVGL example, or only with your code?

straga commented 1 year ago

Today rebuild all. Erase all. Also I am experement with gc.threshold(2000) that was problem. Now works right. Thanks a lot for Help.