Gc error and reboot with last version of lv_bindings

Hi,
I updated lv_micropython with the last version (micropython V1.13 and lvgl V7.5) and I have some reboot by using the gauge or button widgets (the others untested).

My config is ESP32 + ILI9341 LCD

The trace error is :

assertion "ATB_GET_KIND(block) == AT_HEAD" failed: file "../../py/gc.c", line 688, function: gc_realloc
abort() was called at PC 0x401c22eb on core 1 

I have only one screen with a gauge updated about every 100ms with the value of a potentiometer.
After 5 or 10 seconds, reboot happened.

With a similar screen but with only 4 buttons widget with value updated every 100ms, the reboot happens after about 60 seconds and error trace is

assertion "ATB_GET_KIND(block) == AT_HEAD" failed: file "../../py/gc.c", line 590, function: gc_free
abort() was called at PC 0x401c22eb on core 1

I did some tests

  • micropython V1.13 + lv_binding/lvgl V7.5 : reboot
  • micropython V1.12 + lv_binding/lvgl V7.5 : reboot
  • micropython v1.12 + lv_binding/lvgl V7.2 (release V7) => OK, no reboot.
  • micropython v1.13 + lv_binding/lvgl V7.2 (release V7) => OK, no reboot.

The problem seems to come from lvgl version 7.5
Do you have an idea about this problem or something that I can try to do?

Many thanks

Hi @Patoche5150 !

  • Did you run “make clean” before checking out a different LVGL release?
  • Does it also happen with LVGL head of “master” branch?
  • Please try running import gc; gc.collect()
    This would trigger the GC immediately, so you wouldn’t need to wait 60 seconds for the problem to reproduce, and it would be easier to pinpoint what triggers this problem.
  • Please create a minimal code example that produces this error and post it here.
    I would need it for recreating the problem on my side.
  • Does this happen on the “unix” port? Debugging on Linux would be much simpler and faster than debugging ESP32.

@kisvegabor / @embeddedt - A new GC problem on v7.5 hints that you added some global pointer but did not mark it as gc-root.
Any idea what was added between v7.2 and v7.5 that involves dynamic RAM allocations and global pointers?

I have same error :thinking: but I am use the lvgl v7.2.
lvgl binding commit: 3b657ece65cf22aa3899393e5cc3e3fb76b9b13f

Only Ctrl + D command will show this log:

@imliubo if this happens only after CTRL-D (soft reboot), then it’s not the same problem.
Please check if this happens without triggering soft reboot. You can try running import gc; gc.collect() to run gc.

This is OK no reboot.

Hi @amirgon,

Thank you for your fast answer.
Yes, I did a “make clean” on “mpy-cross/” and" ports/esp32/" builds.
The problem happens with “master” branch, it was my first test.
I will try your other recommendations and work on a minimal code with the problem.
I didn’t test the unix port.

To complete my initial post, the reboot happens after a hard reset and the screen script is build as a module with the micropython.

Looking through the changelog, I see that style caching was added in 7.4. It’s possible that the garbage collector is freeing some part of the cache.

@embeddedt, @kisvegabor - Quickly going over style caching commits, I didn’t find any new global that points to dynamically allocated RAM.
Did I miss anything?

It’s probably not the issue then. I was just scanning the changelog for anything obvious.

Hi all,

I have done more tests and created a minimal code to reproduce the reboot.
However, to be sure that the problem didn’t come from my lv_micropython source code, I cloned in a new clean directory the last master branch of lv_micropython.
Finally, it works with the master repository.

The only difference is that I had added a new font, it is the montserrat_14 but with “Latin-1 Supplement” characters for accents.
Then I updated the new master directory with my font.
I added the file lv_montserrat_medium_14.c in the \lib\lv_bindings\lvgl\src\lv_font directory. This file has been generated with the lvgl online font converter.
I added the following line in lv_conf.h

#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(lv_font_montserrat_medium_14)

If I declare this font, in lv_conf.h" as LV_THEME_DEFAULT_FONT or if I use it in my script with a set_style_local_text_font(), I reproduce the reboot, always with the last version of lv_binding only.

The minimal code is :

import lvgl as lv
import lvesp32
import time
import machine

class GaugePage:

    def __init__(self,scr):
        
        self.scr= scr
        self.value = 0
        self.gauge = lv.gauge(self.scr)
        self.gauge.set_size(210,210)
        self.gauge.set_range(0,4095)
        self.gauge.set_critical_value(2048)
        self.gauge.set_scale(270,35,7)
        self.gauge.set_angle_offset(45)
        self.gauge.align(lv.scr_act(), lv.ALIGN.CENTER, 0, 0)
        self.gauge.set_value(0,self.value)

    def set_value(self, value):
        self.value=value
        self.gauge.set_value(0,int(self.value))
        self.gauge.refresh_style(lv.gauge.PART.NEEDLE,1)

    def load_screen(self):
        lv.scr_load(self.scr)

class main_screen:
    def __init__(self):
        # from ili99341 import ili9341
        from ili9XXX import ili9341,COLOR_MODE_BGR,MADCTL_MV
        
        self.disp = ili9341(spihost=1, miso=19, mosi=23, clk=18, cs=5,
                               dc=17, rst=2, power=-1, backlight=4, backlight_on=1,
                               hybrid=True, mhz=40, factor=16, width=320, height=240,
                               colormode=COLOR_MODE_BGR,
                               rot=MADCTL_MV, invert=True, double_buffer=False)
                            #    colormode=ili9341.COLOR_MODE_BGR,
                            #    rot=ili9341.MADCTL_MV, invert=True, double_buffer=False)

        self.scr0 = lv.obj()
        self.page0= GaugePage(self.scr0)
        lv.scr_load(self.scr0)
        self.page0.gauge.set_style_local_text_font(lv.gauge.PART.MAIN,lv.STATE.DEFAULT,lv.font_montserrat_medium_14)

Potentiometer = machine.ADC(machine.Pin(33))
Potentiometer.atten(Potentiometer.ATTN_6DB)
lcd=main_screen()

while True :
    lcd.page0.set_value(Potentiometer.read())
    time.sleep_ms(100)

Now with this minimal script, it takes 20 seconds to have the reboot.
If I increase the time.sleep() in the loop, it increases the time delay of reboot.
If I delete the refresh_style in the set_value(), the reboot happens later (but the needle display is not fine).

By the end of my tests, I tried to not change lv_conf.h and I replaced the original lv_font_montserrat_14.c code by my own font code. Like this, it works, no reboot :roll_eyes:

My ESP32 board uses an ESP32_WROOM-32D.
I tried to run import gc; gc.collect() but it didn’t reproduce the problem.

Here is the font code if needed :

lv_font_montserrat_medium_14.c (83.0 KB)

Thank you for your great efforts.

I’ve tried to reproduce your problem on lv_micropython, with the lv_font_montserrat_medium_14 you sent. I’ve set LV_FONT_CUSTOM_DECLARE like you did.
I took your example script almost as it is, I only had to change the ili9341 pins and ADC pin.
I don’t have a potentiometer, but a floating wire reads great random values!

It seems to work fine on my board (ESP32 WROVER) for more than 20 minutes, I’ve also added gc.collect(). Unfortunately I was not able to reproduce the crash you are experiencing.

So - some ideas how to make progress:

  • Does the problem disappear if you remove the line that sets the font? (set_style_local_text_font)
  • If you are able to reproduce this on the unix port, there’s a very high chance I’ll be able to reproduce it too. It would be much easier to debug, so it’s worth a try.
  • Please try to parse the call-stack and send it to us.
    You should basically copy the list of hex numbers after the word “Backtrace:” in your crash log, and give it as a parameter to addr2line utility, something like this:
xtensa-esp32-elf-addr2line -aipfC -e ./ports/esp32/build-GENERIC_SPIRAM/application.elf 0x... ... ..

(assuming your board is GENERIC_SPIRAM)

  • You can try debugging it on the ESP32 with JTAG (like this for example), but it’s not going to be easy.
    The assert is on gc.c, so the problem could be corrupted RAM. The RAM corruption could have happened long before the system crashes, and locating RAM corruption error on embedded system is not a trivial task.
  • Perhaps LVGL maintainers @kisvegabor or @embeddedt would have some idea about how setting custom font could be related to gc problem.

Hi amirgon,

thank you for trying to reproduce the problem.
If I remove the line with set_style_local_text_font, yes the problem disappears.
I will test your other recommendations but I’m not able to debug with JTAG now. I will order a probe but it will take some time to receive this order.
My board is a Generic Board, ESP32-DevKitC without SPI RAM.

Thanks

I didn’t be able to set up a Unix development environment (I work with ubuntu under windows) even if build worked, I didn’t success to test my script :face_with_thermometer:

Here the parse of 2 types of call-stack with reboot :

assertion "ATB_GET_KIND(block) == AT_HEAD" failed: file "../../py/gc.c", line 688, function: gc_realloc
abort() was called at PC 0x401c22eb on core 1

0x4008ec80: invoke_abort at /home/patrice/esp/esp-idfV4-lvgl7/esp-idf/components/esp32/panic.c:721
0x4008f071: abort at /home/patrice/esp/esp-idfV4-lvgl7/esp-idf/components/esp32/panic.c:721
0x401c22eb: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)
0x400d3426: gc_realloc at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/gc.c:688 (discriminator 1)
0x400d2be0: m_realloc at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/malloc.c:141
0x4010d885: lv_mem_realloc at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_misc/lv_mem.c:343
0x4010a796: lv_font_get_bitmap_fmt_txt at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_font/lv_font_fmt_txt.c:113
0x402197a5: lv_font_get_glyph_bitmap at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_font/lv_font.c:50
0x401046b1: lv_draw_letter at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_draw/lv_draw_label.c:439
 (inlined by) lv_draw_label at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_draw/lv_draw_label.c:326
0x401221f4: lv_gauge_draw_labels at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_widgets/lv_gauge.c:560
 (inlined by) lv_gauge_design at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_widgets/lv_gauge.c:425
0x40100ace: lv_refr_obj at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_core/lv_refr.c:677
0x40100b39: lv_refr_obj at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_core/lv_refr.c:717
0x40100b74: lv_refr_obj_and_children at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_core/lv_refr.c:619
0x40100d53: lv_refr_area_part at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_core/lv_refr.c:550
0x40101174: lv_refr_area at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_core/lv_refr.c:460
 (inlined by) lv_refr_areas at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_core/lv_refr.c:382
 (inlined by) _lv_disp_refr_task at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_core/lv_refr.c:199
0x4010dbf3: lv_task_exec at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_misc/lv_task.c:409 (discriminator 1)
0x4010dcdc: lv_task_handler at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_misc/lv_task.c:142
0x4015888b: mp_lv_task_handler at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/driver/esp32/modlvesp32.c:33
0x400e367a: fun_builtin_1_call at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/objfun.c:71
0x400df699: mp_call_function_n_kw at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/runtime.c:650
0x400df781: mp_call_function_1 at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/runtime.c:628
0x400e03c0: mp_call_function_1_protected at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/runtime_utils.c:33
0x400e04a9: mp_handle_pending_tail at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/scheduler.c:92
0x400e0505: mp_handle_pending at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/scheduler.c:76
0x400f6044: mp_hal_delay_ms at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/mphalport.c:166
0x400f5a17: time_sleep_ms at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../extmod/utime_mphal.c:52
0x400e367a: fun_builtin_1_call at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/objfun.c:71
0x400df699: mp_call_function_n_kw at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/runtime.c:650
0x400df7c1: mp_call_method_n_kw at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/runtime.c:666
0x400ecec1: mp_execute_bytecode at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/vm.c:1085
0x400e3804: fun_bc_call at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/objfun.c:288
0x400df699: mp_call_function_n_kw at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/runtime.c:650
0x400df6c2: mp_call_function_0 at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/runtime.c:624
0x40158472: parse_compile_execute at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/utils/pyexec.c:108
0x40158595: pyexec_raw_repl at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/utils/pyexec.c:411
0x400f5c9b: mp_task at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/main.c:180
0x400999e5: vPortTaskWrapper at port.c:?

and

assertion "ATB_GET_KIND(block) == AT_HEAD" failed: file "../../py/gc.c", line 590, function: gc_free
abort() was called at PC 0x401c22eb on core 1

0x4008ec80: invoke_abort at /home/patrice/esp/esp-idfV4-lvgl7/esp-idf/components/esp32/panic.c:721
0x4008f071: abort at /home/patrice/esp/esp-idfV4-lvgl7/esp-idf/components/esp32/panic.c:721
0x401c22eb: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)
0x400d2d2a: gc_free at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/gc.c:590
0x400d3322: gc_free at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/gc.c:584
0x400d2c09: m_free at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/malloc.c:199
0x4010d877: lv_mem_free at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_misc/lv_mem.c:274
0x4010aa34: _lv_font_clean_up_fmt_txt at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_font/lv_font_fmt_txt.c:188
0x4010132b: _lv_disp_refr_task at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_core/lv_refr.c:274
0x4010dbf3: lv_task_exec at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_misc/lv_task.c:409 (discriminator 1)
0x4010dcdc: lv_task_handler at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/lvgl/src/lv_misc/lv_task.c:142
0x4015888b: mp_lv_task_handler at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/lv_bindings/driver/esp32/modlvesp32.c:33
0x400e367a: fun_builtin_1_call at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/objfun.c:71
0x400df699: mp_call_function_n_kw at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/runtime.c:650
0x400df781: mp_call_function_1 at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/runtime.c:628
0x400e03c0: mp_call_function_1_protected at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/runtime_utils.c:33
0x400e04a9: mp_handle_pending_tail at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/scheduler.c:92
0x400e0505: mp_handle_pending at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/scheduler.c:76
0x400f6044: mp_hal_delay_ms at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/mphalport.c:166
0x400f5a17: time_sleep_ms at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../extmod/utime_mphal.c:52
0x400e367a: fun_builtin_1_call at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/objfun.c:71
0x400df699: mp_call_function_n_kw at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/runtime.c:650
0x400df7c1: mp_call_method_n_kw at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/runtime.c:666
0x400ecec1: mp_execute_bytecode at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/vm.c:1085
0x400e3804: fun_bc_call at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/objfun.c:288
0x400df699: mp_call_function_n_kw at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/runtime.c:650
0x400df6c2: mp_call_function_0 at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../py/runtime.c:624
0x40158472: parse_compile_execute at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/utils/pyexec.c:108
0x40158595: pyexec_raw_repl at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/../../lib/utils/pyexec.c:411
0x400f5c9b: mp_task at /mnt/d/MicroPythonPSI/.virtualenvs/MicroPythonLittlevGL/lv_micropython_7_5master/lv_micropython/ports/esp32/main.c:180
0x400999e5: vPortTaskWrapper at port.c:?

I also tried to change the factor parameter, 16 changed by 4 and the problem occurs 60 sec after start display and not 20 sec.

I did another test. I generated again the same font but without Enable font compression checked in the online converter.
With this new version, the problem disappear!

I don’t know if this new information helps you, I hope.
Maybe I will continue my design with the uncompressed font since it works now and reports again with new information depending on whether or not I reproduce the problem with new pages or new configurations.

If you want or have some ideas of investigations, I can do new tests.

Thanks

Actually the first stack trace you sent is very interesting!

This realloc operation allocates RAM and sets decompr_buf , which is not declared as GC root.
So we may have found the bug in LVGL!

Opened LVGL issue:

Hi everyone,
I tested today the new master version with GC roots modification and now it’s perfect, with compressed fonts, no reboots !!
Good job.
Thanks

That’s great!
Thank you for the update.