From f1882f565fb8fae0849cc4c31067b01b6e808a7f Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Wed, 4 Nov 2026 22:30:47 +1100 Subject: [PATCH 1/4] Fix STM32 LVGL config path in CI --- .github/workflows/micropython_lvgl_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/micropython_lvgl_ci.yml b/.github/workflows/micropython_lvgl_ci.yml index 5f7039345..34385165a 100644 --- a/.github/workflows/micropython_lvgl_ci.yml +++ b/.github/workflows/micropython_lvgl_ci.yml @@ -73,7 +73,7 @@ jobs: run: | source tools/ci.sh && ci_stm32_setup make -C ports/stm32 BOARD=PYBV11 submodules - make -j $(nproc) -C ports/stm32 BOARD=PYBV11 USER_C_MODULES=../../user_modules LV_CONF_PATH=../../user_modules/lv_binding_micropython/ports/stm32/lv_conf_stm32.h + make -j $(nproc) -C ports/stm32 BOARD=PYBV11 USER_C_MODULES=../../user_modules LV_CONF_PATH=$(pwd)/user_modules/lv_binding_micropython/ports/stm32/lv_conf_stm32.h # Raspberry Pi Pico port - name: Build rp2 port if: matrix.port == 'rp2' From d24a9ece796daf597097f6a0408ae7d467663282 Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Wed, 4 Nov 2026 22:46:58 +1100 Subject: [PATCH 2/4] Fix ESP32 user module CI path --- .github/workflows/micropython_lvgl_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/micropython_lvgl_ci.yml b/.github/workflows/micropython_lvgl_ci.yml index 34385165a..4eecfb87c 100644 --- a/.github/workflows/micropython_lvgl_ci.yml +++ b/.github/workflows/micropython_lvgl_ci.yml @@ -88,7 +88,7 @@ jobs: run: | source tools/ci.sh && ci_esp32_idf_setup source tools/ci.sh && ci_esp32_build_common - make -C ports/esp32 BOARD=ESP32_GENERIC_S3 USER_C_MODULES=../../user_modules/lv_binding_micropython/micropython.cmake + make -C ports/esp32 BOARD=ESP32_GENERIC_S3 # Unix port - name: Build unix port From d9fbc8c7f331dfd56549c5facde4b1b378726379 Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Thu, 5 Nov 2026 16:59:30 +1100 Subject: [PATCH 3/4] micropython.mk: Generate the binding from lvgl.h. The generator preprocessed lvgl_private.h, which does not include lv_init.h, so lv.init() and lv.is_initialized() were missing from the generated module and the API tests failed at import. lvgl.h includes lvgl_private.h when LV_USE_PRIVATE_API is set, so private symbols are still generated. --- micropython.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/micropython.mk b/micropython.mk index 6aa6c3df3..57dd60fdb 100644 --- a/micropython.mk +++ b/micropython.mk @@ -90,7 +90,7 @@ $(LVGL_MPY): $(ALL_LVGL_SRC) $(LVGL_BINDING_DIR)/gen/gen_mpy.py -I $(LVGL_BINDING_DIR)/pycparser/utils/fake_libc_include \ -I $(LVGL_BINDING_DIR)/stubs/include \ $(CFLAGS_USERMOD) \ - $(LVGL_DIR)/lvgl_private.h | $(LV_PP_FILTER) > $(LVGL_PP) + $(LVGL_DIR)/lvgl.h | $(LV_PP_FILTER) > $(LVGL_PP) $(Q)$(PYTHON) $(LVGL_BINDING_DIR)/gen/gen_mpy.py -M lvgl -MP lv -MD $(LVGL_MPY_METADATA) -E $(LVGL_PP) $(LVGL_DIR)/lvgl.h > $@ .PHONY: LVGL_MPY From 0178730bb30e04a34d97a532a6812e7903efbae5 Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Mon, 20 Jul 2026 12:35:53 +1000 Subject: [PATCH 4/4] fix(gen): support MicroPython's renamed mp_obj_int_to_bytes() API MicroPython commit e00daa3a ("py/binary,objint: Add overflow checks and int.to_bytes(signed=True)") renamed mp_obj_int_to_bytes_impl() to mp_obj_int_to_bytes() with a new signature (adding is_signed and overflow_check parameters), for the 1.29 release. The generated binding called the old name unconditionally in mp_obj_get_ull(), so building against 1.29 or later failed to link with an undefined reference to mp_obj_int_to_bytes_impl. Guard the call on MICROPY_VERSION so the binding builds against both APIs. --- gen/gen_mpy.py | 6 ++++++ gen/lv_mpy_example.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/gen/gen_mpy.py b/gen/gen_mpy.py index ee61a87be..6e8b7bc11 100644 --- a/gen/gen_mpy.py +++ b/gen/gen_mpy.py @@ -1832,7 +1832,13 @@ def register_int_ptr_type(convertor, *types): unsigned long long val = 0; bool big_endian = !(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__); + // mp_obj_int_to_bytes() replaced mp_obj_int_to_bytes_impl() in MicroPython + // 1.29 (commit e00daa3a), adding is_signed and overflow_check parameters. +#if MICROPY_VERSION >= MICROPY_MAKE_VERSION(1, 29, 0) + mp_obj_int_to_bytes(obj, sizeof(val), (byte*)&val, big_endian, false, false); +#else mp_obj_int_to_bytes_impl(obj, big_endian, sizeof(val), (byte*)&val); +#endif return val; } diff --git a/gen/lv_mpy_example.c b/gen/lv_mpy_example.c index b109545fe..3957671fd 100644 --- a/gen/lv_mpy_example.c +++ b/gen/lv_mpy_example.c @@ -778,7 +778,13 @@ STATIC unsigned long long mp_obj_get_ull(mp_obj_t obj) unsigned long long val = 0; bool big_endian = !(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__); + // mp_obj_int_to_bytes() replaced mp_obj_int_to_bytes_impl() in MicroPython + // 1.29 (commit e00daa3a), adding is_signed and overflow_check parameters. +#if MICROPY_VERSION >= MICROPY_MAKE_VERSION(1, 29, 0) + mp_obj_int_to_bytes(obj, sizeof(val), (byte*)&val, big_endian, false, false); +#else mp_obj_int_to_bytes_impl(obj, big_endian, sizeof(val), (byte*)&val); +#endif return val; }