lv_binding_micropython icon indicating copy to clipboard operation
lv_binding_micropython copied to clipboard

lv_timer crashes when libc.so.6 is not present

Open basvd opened this issue 8 months ago • 0 comments

When libc.so.6 is not present on the system, lv_timer triggers an OSError exception or even a hard crash (segfault). This dependency is unnecessarily specific, because alternative implementations of libc (such as uClibc-ng) are also compatible.

micropython-lib/unix-ffi provides a nice way to load the library, but I am not sure if this module is always available to the bindings. In any case, the code (in driver\linux\lv_timer.py) would look like this:

import ffilib

# FFI libraries

libc = ffilib.libc()
try:
    librt = ffilib.open("librt")
except OSError as e:
    librt = libc

basvd avatar Apr 06 '25 13:04 basvd