Skip to content

Update bindings to use LVGL as MicroPython user module #368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 15, 2025

Conversation

PGNetHun
Copy link
Collaborator

@PGNetHun PGNetHun commented Mar 15, 2025

Update bindings to use LVGL as MicroPython user module.

Based on PRs:

Kudos to @andrewleech and @Carglglz for their work on transforming LVGL-MicroPython binding into user module.

Remaining TODO:

  • Fix espidf.c compilation, and so ILI9xxx.py display driver
  • Fix Github CI workflows (actions)
  • Fix possible build issues of ports (test and help needed)

PGNetHun and others added 4 commits March 1, 2025 17:54

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
* gen: update to MicroPython v1.23.x

* lib: Allow using lv_utils in unix-macos port.

Fix to allow using lv_utils with asyncio in unix-macos.

* unix: Enable lv_binding_micropython as user C mod.

* esp32: Enable lv_binding_micropython as user C mod.

* feat(tests): Add tests for MicroPython test suite.

* fix(init/deinit): Properly init/deinit lvgl module.

Properly handle root pointers on lvgl init/deinit which fixes
init error after a soft reset (see #343).

* fix(gen_mpy.py): update lv_to_mp float conversion.

Upate for lvgl 9.2.x see diff in lvgl @ 84b28ff

* fix(esp32): lvgl component error in idf v5.2.x.

* fix(lv_conf): enable LV_USE_PRIVATE_API for v9.2.0

* fix(build): enable LV_CONF_PATH option

This allows to set custom `lv_conf.h` file per board
in `mpconfigboard.(h,cmake)`

* fix(tests): fix testdisplay, add hwdisplay example

* feat(lvgl): update to lvgl v9.2.2

* fix(makefile): use CLFAGS_USERMOD

* feat(lvgl): update to latest v9.3.0

* fix(tests): fix testdisplay and add calibrate tool

* fix(build): fix LV_CONF_PATH option for CMake

---------

Co-authored-by: Carlosgg <[email protected]>
@PGNetHun
Copy link
Collaborator Author

FYI:
I decided not to wait longer, so community can use LVGL-MicroPython binding with MicroPython v1.24.

Unix, ESP32 and ESP32-S3 builds are working.
All the remaining tasks, ports, and bugs can be fixed continuously after merge.

@Carglglz
Copy link
Contributor

Fix Github CI workflows (actions)

@PGNetHun in my case CI was failing because the lvgl submodule is currently checked out at
7738609d2f5c1148bedefeff7ba9fa318958afd3 lvgl (v9.2.0-431-g7738609d2) which points to my fork:branch (https://github.com/Carglglz/lvgl/tree/lvgl-dev-master), which contains a commit to fix #343, see:

commit 7738609d2f5c1148bedefeff7ba9fa318958afd3 (HEAD -> lvgl-dev-master, myfork/lvgl-dev-master)
Author: Carlosgg <[email protected]>
Date:   Mon Jun 24 02:17:43 2024 +0100

    fix(micropython) lvgl module deinit

    Properly deinit lvgl module so it can be initiated after a soft reset.

diff --git a/src/lv_init.c b/src/lv_init.c
index 18a2e0857..2d1479273 100644
--- a/src/lv_init.c
+++ b/src/lv_init.c
@@ -484,6 +484,14 @@ void lv_deinit(void)
     lv_log_register_print_cb(NULL);
 #endif

+
+#ifdef LV_GC_DEINIT
+    LV_GC_DEINIT();
+#endif
+
+
+    return;
+
 }

 /**********************

So now that these changes are merged, would be appropriate to open a PR in lvgl repo with this commit and then update lvgl submodule here. Then CI should work as expected. 👍🏼

@PGNetHun
Copy link
Collaborator Author

Hello!
I've seen the problems too, and have created (and merged) PRs:

I have also a separate PR for LVGL repo, that should fix the MicroPython CI build in LVGL repo:
lvgl/lvgl#7945

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants