Closed kisvegabor closed 1 year ago
I can look into this in a few days. Do you know if lv_micropython master
can compile and pass CI with the update? It's easier to debug that than the WASM port.
Thank you!
Right now we are using the
feat/multi-instance
branch of both lv_micropython
and lv_binding_mictopython
master
brach of lvgl
The CI is passing, but we have disabled some MicroPython examples because they weren't updated yet with the latest MicroPython changes.
cc @leidto
@kisvegabor I think I have found the issue after some debugging. The lv_initialized
variable was moved into the new globals structure, which is only initialized when lv_init
is called. However there are functions which call lv_is_initialized
before lv_init
(such as the constructor in display_driver_utils
), and at that time, LV_GLOBAL_DEFAULT()
is not initialized yet. This causes a segfault if debug is enabled, and weird behavior consistent with memory corruption otherwise.
To confirm this theory I replaced lv_initialized
with a static variable, after which the GUI appears to initialize and run without problems.
I'm also not sure why the CI does not pick up on this - perhaps it never makes any calls to lv_is_initialized
before LVGL has already been initialized.
Thank you! Could you try if modifying lv_is_initialized()
like this solves the issue?
bool lv_is_initialized(void)
{
#if LV_ENABLE_GLOBAL_CUSTOM
if(LV_GLOBAL_DEFAULT()) return lv_initialized;
else return false;
#else
return lv_initialized;
#endif
}
Yes, this works.
Great, I've just added the above changes.
@embeddedt Could you confirm if the JS port is working with the latest LVGL master and if so update it?
Typically @amirgon and I have had an unwritten convention where the main master
branch of lv_micropython is updated first and then I merge it to the JS branch. Just wanted to clarify that the multi-instance changes are special and I should update JS out-of-order?
Please update it out of order as we still don't how and when will we merge the feat/multi-instance
branch back to master
. Until that it would be great to make the latest LVGL master
available in the online simulator.
Updated and deployed. :+1:
Thank you :pray:
In the latest LVGL master the handling of GC roots was updated. @embeddedt, do you have some free time to update the webassembly port?
We have tried it, but it crashed with memory access error. Probably we are missing something, but we can't see what.