Sure. Also did some debugging/testing + enabling verbose LVGL logging.
First, I consolidated a bit of code from the ESP_Panel functionality → merging the “lv_timer_handler()” call into my own FreeRTOS task thread for handling the LVGL UI. Here’s my LVGL page handler routine (not including the ESP_Panel startup stuff):
// Set the "container" for all pages. NOTE: This can easily be set to a window object to
//"contain" the pages in a tabbed UI if desired.
mainContainer = lv_scr_act();
TickType_t xLastWakeTime = xTaskGetTickCount();
uint32_t task_delay_ms = LVGL_PORT_TASK_MAX_DELAY_MS;
unsigned long uiPollTimer = millis() + 100;
while (true) {
//NOTE: the "lvgl_port_v8" puts LVGL tasking in a separate RTOS thread. This means that we do
//not have to call the LVGL Timer functionality to keep the screen updated.
//We just have to keep track of our responsibilities here.
// -> 2024-07-12: absolutely no reason to have that split up. Merged task timer functionality
//with this loop here.
if (lvgl_port_lock(-1)) {
task_delay_ms = lv_timer_handler();
// Every 100mS (or so!) call UI update function...
if (millis() > uiPollTimer) {
uiPollTimer = millis() + 100;
// Call the "update" function on the currently active screen
//WILL CRASH if there is no valid screen loaded.
// Does the screen class need changed?
if (currentScreenId != ScreenId) {
// yes, the screen needs to be changed.
//Trigger the deconstructor in the screen class object. THIS calls "lv_obj_clean" on the container
delete currentScreen;
// Create a new screen class with the requested screen.
switch (currentScreenId = ScreenId) { // assign & check
case screen_Main: currentScreen = new HomeScreen_Main(mainContainer); break;
case screen_Cfg: currentScreen = new HomeScreen_Cfg(mainContainer); break;
//Add more screens here as necessary
}
} else {
// call the Update function on the screen class to handle the necessary functionality.
currentScreen->Update();
}
}
lvgl_port_unlock();
if (task_delay_ms > LVGL_PORT_TASK_MAX_DELAY_MS) {
task_delay_ms = LVGL_PORT_TASK_MAX_DELAY_MS;
} else if (task_delay_ms < LVGL_PORT_TASK_MIN_DELAY_MS) {
task_delay_ms = LVGL_PORT_TASK_MIN_DELAY_MS;
}
}
xTaskDelayUntil(&xLastWakeTime, pdMS_TO_TICKS(task_delay_ms)); // vTaskDelay(pdMS_TO_TICKS(task_delay_ms));
}
This is what doesn’t make sense to me: if I put the “lv_arc_set_value()” calls in the class constructor (as per my code example in a prior post), LVGL works fine with a 64KB buffer.
But when the “lv_arc_set_value()” calls are put in the “Update()” function (literally a few lines lower in the exact same context), it fails drawing the "lv_arc"s unless the LVGL buffer is 128KB in size! This simply doesn’t make sense to me.
I used the following for an output debug in “lv_malloc”. “esp_backtrace_print()” outputs a debug backtrace that can be decoded to the entire call stack without stopping execution. (NOTE: if the backtrace output is not complete all the way to the beginning, the PIO “filter_exception_decoder.py” regex will not catch the backtrace.)
if(size > 10000) {
printf("large alloc (%d bytes)\n", size); //Add a breakpoint here and see where it was allocated from
esp_backtrace_print(50);
sleep(1);
}
Here is the resulting log (removed a lot of the [Trace] lines due to the post being too long!) NOTE: All of the “20003 byte” allocations were successful; LVGL was drawing the “lv_scale” and background of the "lv_arc"s at that point. It’s when the allocations go up to 31363 bytes that LVGL starts drawing the foreground of the "lv_arc"s. After drawing the first block (= the partial render I showed in the GH issue), LVGL goes to a fast loop and just retries the failure over and over again.
[Trace] lv_malloc: allocating 20003 bytes
[Trace] lv_malloc: allocated at 0x3fc9c134
[Info] lv_draw_layer_alloc_buf: Layer memory used: 19 kB
[...]
Backtrace: 0x420138AD:0x3FCAF3C0 0x4200B6BD:0x3FCAF420 0x4200B8A0:0x3FCAF440 0x4200B628:0x3FCAF480 0x42022A2D:0x3FCAF4A0 0x4200B3D6:0x3FCAF4C0 0x4200B41C:0x3FCAF4F0 0x4200B477:0x3FCAF510 0x420224F5:0x3FCAF530 0x420170D6:0x3FCAF560 0x4208A182:0x3FCAF660420054D5:0x3FCAF680 0x4200555A:0x3FCAF6A0 0x42009A2A:0x3FCAF6E0 0x42009D09:0x3FCAF820 0x42009C3C:0x3FCAF900 0x42009D09:0x3FCAFA40 0x42009AE9:0x3FCAFB20 0x42009D09:0x3FCAFC60 0x4200A0B3:0x3FCAFD40 0x4200A213:0x3FCAFD70 0x4200AA31:0x3FCAFDB0 0x420124CC:0x3FCAFE40 0x420033A2:0x3FCAFE60 0x4037FA3E:0x3FCAFEA0
#0 0x4200555A in lv_obj_send_event at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_obj_event.c:64
#1 0x42009A2A in lv_obj_redraw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:110
#2 0x42009D09 in refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:892
(inlined by) refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:886
#3 0x42009C3C in lv_obj_redraw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:212 (discriminator 3)
#4 0x42009D09 in refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:892
(inlined by) refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:886
#5 0x42009AE9 in lv_obj_redraw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:161 (discriminator 3)
#6 0x42009D09 in refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:892
(inlined by) refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:886
#7 0x4200A0B3 in refr_obj_and_children at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:790
#8 0x4200A213 in refr_area_part at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:723
#9 0x4200AA31 in refr_area at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:650
(inlined by) refr_invalid_areas at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:566
(inlined by) _lv_display_refr_timer at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:374
#10 0x420124CC in lv_timer_exec at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/misc/lv_timer.c:300
(inlined by) lv_timer_handler at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/misc/lv_timer.c:105
(inlined by) lv_timer_handler at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/misc/lv_timer.c:63
#11 0x420033A2 in rtos_hid_tft(void*) at src/display.cpp:62
#12 0x4037FA3E in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162
[Trace] lv_malloc: allocating 31363 bytes
[Trace] lv_malloc: allocated at 0x3fc9ae94
[Info] lv_draw_layer_alloc_buf: Layer memory used: 30 kB
[...]
large alloc (31363 bytes)
Backtrace: 0x420138AD:0x3FCAF3C0 0x4200B6BD:0x3FCAF420 0x4200B8A0:0x3FCAF440 0x4200B628:0x3FCAF480 0x42022A2D:0x3FCAF4A0 0x4200B3D6:0x3FCAF4C0 0x4200B41C:0x3FCAF4F0 0x4200B477:0x3FCAF510 0x420224F5:0x3FCAF530 0x420170D6:0x3FCAF560 0x4208A182:0x3FCAF660 0x420054D5:0x3FCAF680 0x4200555A:0x3FCAF6A0 0x42009A2A:0x3FCAF6E0 0x42009D09:0x3FCAF820 0x42009C3C:0x3FCAF900 0x42009D09:0x3FCAFA40 0x42009AE9:0x3FCAFB20 0x42009D09:0x3FCAFC60 0x4200A0B3:0x3FCAFD40 0x4200A213:0x3FCAFD70 0x4200AA31:0x3FCAFDB0 0x420124CC:0x3FCAFE40 0x420033A2:0x3FCAFE60 0x4037FA3E:0x3FCAFEA0
#0 0x420138AD in lv_malloc at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/stdlib/lv_mem.c:67
#1 0x4200B6BD in buf_malloc at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw_buf.c:465
#2 0x4200B8A0 in draw_buf_malloc at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw_buf.c:495
(inlined by) lv_draw_buf_create at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw_buf.c:212
#3 0x4200B628 in lv_draw_layer_alloc_buf at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw.c:373
#4 0x42022A2D in dispatch at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/sw/lv_draw_sw.c:310
(inlined by) dispatch at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/sw/lv_draw_sw.c:292
#5 0x4200B3D6 in lv_draw_dispatch_layer at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw.c:255
#6 0x4200B41C in lv_draw_dispatch at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw.c:161
#7 0x4200B477 in lv_draw_finalize_task_creation at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw.c:138
#8 0x420224F5 in lv_draw_arc at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw_arc.c:69
#9 0x420170D6 in lv_arc_draw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/widgets/arc/lv_arc.c:700
(inlined by) lv_arc_event at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/widgets/arc/lv_arc.c:676
(inlined by) lv_arc_event at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/widgets/arc/lv_arc.c:436
#10 0x4208A182 in lv_obj_event_base at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_obj_event.c:86
#11 0x420054D5 in event_send_core at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_obj_event.c:359
#12 0x4200555A in lv_obj_send_event at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_obj_event.c:64
#13 0x42009A2A in lv_obj_redraw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:110
#14 0x42009D09 in refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:892
(inlined by) refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:886
#15 0x42009C3C in lv_obj_redraw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:212 (discriminator 3)
#16 0x42009D09 in refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:892
(inlined by) refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:886
#17 0x42009AE9 in lv_obj_redraw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:161 (discriminator 3)
#18 0x42009D09 in refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:892
(inlined by) refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:886
#19 0x4200A0B3 in refr_obj_and_children at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:790
#20 0x4200A213 in refr_area_part at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:723
#21 0x4200AA31 in refr_area at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:650
(inlined by) refr_invalid_areas at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:566
(inlined by) _lv_display_refr_timer at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:374
#22 0x420124CC in lv_timer_exec at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/misc/lv_timer.c:300
(inlined by) lv_timer_handler at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/misc/lv_timer.c:105
(inlined by) lv_timer_handler at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/misc/lv_timer.c:63
#23 0x420033A2 in rtos_hid_tft(void*) at src/display.cpp:62
#24 0x4037FA3E in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162
[Trace] lv_malloc: allocating 31363 bytes
[Info] lv_malloc: couldn't allocate memory (31363 bytes)
[Trace] lv_mem_monitor_core: begin
[Trace] lv_mem_monitor_core: finished
[Info] lv_malloc: used: 10120 ( 16 %), frag: 41 %, biggest free: 31724
[Warn] lv_draw_buf_create: No memory: 245x32, cf: 16, stride: 980, 31360Byte,
[Trace] lv_free: freeing 0x3fca3344
[Warn] lv_draw_layer_alloc_buf: Allocating layer buffer failed. Try later
[Trace] lv_malloc_zeroed: allocating 84 bytes
[Trace] lv_malloc_zeroed: allocated at 0x3fca2b9c
[Trace] lv_malloc: allocating 64 bytes
[Trace] lv_malloc: allocated at 0x3fca2cd0
[Trace] lv_malloc_zeroed: allocating 24 bytes
[Trace] lv_malloc_zeroed: allocated at 0x3fca3344
large alloc (31363 bytes)
Backtrace: 0x420138AD:0x3FCAF3C0 0x4200B6BD:0x3FCAF420 0x4200B8A0:0x3FCAF440 0x4200B628:0x3FCAF480 0x42022A2D:0x3FCAF4A0 0x4200B3D6:0x3FCAF4C0 0x4200B41C:0x3FCAF4F0 0x4200B477:0x3FCAF510 0x420224F5:0x3FCAF530 0x42017149:0x3FCAF560 0x4208A182:0x3FCAF660 0x420054D5:0x3FCAF680 0x4200555A:0x3FCAF6A0 0x42009A2A:0x3FCAF6E0 0x42009D09:0x3FCAF820 0x42009C3C:0x3FCAF900 0x42009D09:0x3FCAFA40 0x42009AE9:0x3FCAFB20 0x42009D09:0x3FCAFC60 0x4200A0B3:0x3FCAFD40 0x4200A213:0x3FCAFD70 0x4200AA31:0x3FCAFDB0 0x420124CC:0x3FCAFE40 0x420033A2:0x3FCAFE60 0x4037FA3E:0x3FCAFEA0
#0 0x420138AD in lv_malloc at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/stdlib/lv_mem.c:67
#1 0x4200B6BD in buf_malloc at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw_buf.c:465
#2 0x4200B8A0 in draw_buf_malloc at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw_buf.c:495
(inlined by) lv_draw_buf_create at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw_buf.c:212
#3 0x4200B628 in lv_draw_layer_alloc_buf at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw.c:373
#4 0x42022A2D in dispatch at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/sw/lv_draw_sw.c:310
(inlined by) dispatch at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/sw/lv_draw_sw.c:292
#5 0x4200B3D6 in lv_draw_dispatch_layer at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw.c:255
#6 0x4200B41C in lv_draw_dispatch at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw.c:161
#7 0x4200B477 in lv_draw_finalize_task_creation at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw.c:138
#8 0x420224F5 in lv_draw_arc at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw_arc.c:69
#9 0x42017149 in lv_arc_draw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/widgets/arc/lv_arc.c:719
(inlined by) lv_arc_event at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/widgets/arc/lv_arc.c:676
(inlined by) lv_arc_event at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/widgets/arc/lv_arc.c:436
#10 0x4208A182 in lv_obj_event_base at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_obj_event.c:86
#11 0x420054D5 in event_send_core at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_obj_event.c:359
#12 0x4200555A in lv_obj_send_event at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_obj_event.c:64
#13 0x42009A2A in lv_obj_redraw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:110
#14 0x42009D09 in refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:892
(inlined by) refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:886
#15 0x42009C3C in lv_obj_redraw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:212 (discriminator 3)
#16 0x42009D09 in refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:892
(inlined by) refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:886
#17 0x42009AE9 in lv_obj_redraw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:161 (discriminator 3)
#18 0x42009D09 in refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:892
(inlined by) refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:886
#19 0x4200A0B3 in refr_obj_and_children at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:790
#20 0x4200A213 in refr_area_part at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:723
#21 0x4200AA31 in refr_area at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:650
(inlined by) refr_invalid_areas at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:566
(inlined by) _lv_display_refr_timer at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:374
#22 0x420124CC in lv_timer_exec at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/misc/lv_timer.c:300
(inlined by) lv_timer_handler at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/misc/lv_timer.c:105
(inlined by) lv_timer_handler at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/misc/lv_timer.c:63
#23 0x420033A2 in rtos_hid_tft(void*) at src/display.cpp:62
#24 0x4037FA3E in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162
[Trace] lv_malloc: allocating 31363 bytes
[Info] lv_malloc: couldn't allocate memory (31363 bytes)
[Trace] lv_mem_monitor_core: begin
[Trace] lv_mem_monitor_core: finished
[Info] lv_malloc: used: 10268 ( 17 %), frag: 41 %, biggest free: 31724
[Warn] lv_draw_buf_create: No memory: 245x32, cf: 16, stride: 980, 31360Byte,
[Trace] lv_free: freeing 0x3fca3344
[Warn] lv_draw_layer_alloc_buf: Allocating layer buffer failed. Try later
[Trace] lv_malloc_zeroed: allocating 84 bytes
[Trace] lv_malloc_zeroed: allocated at 0x3fca2d14
[Trace] lv_malloc: allocating 64 bytes
[Trace] lv_malloc: allocated at 0x3fca2d6c
[Trace] lv_malloc_zeroed: allocating 24 bytes
[Trace] lv_malloc_zeroed: allocated at 0x3fca2db0
large alloc (31363 bytes)
Backtrace: 0x420138AD:0x3FCAF3C0 0x4200B6BD:0x3FCAF420 0x4200B8A0:0x3FCAF440 0x4200B628:0x3FCAF480 0x42022A2D:0x3FCAF4A0 0x4200B3D6:0x3FCAF4C0 0x4200B41C:0x3FCAF4F0 0x4200B477:0x3FCAF510 0x420224F5:0x3FCAF530 0x420170D6:0x3FCAF560 0x4208A182:0x3FCAF660 0x420054D5:0x3FCAF680 0x4200555A:0x3FCAF6A0 0x42009A2A:0x3FCAF6E0 0x42009D09:0x3FCAF820 0x42009C3C:0x3FCAF900 0x42009D09:0x3FCAFA40 0x42009AE9:0x3FCAFB20 0x42009D09:0x3FCAFC60 0x4200A0B3:0x3FCAFD40 0x4200A213:0x3FCAFD70 0x4200AA31:0x3FCAFDB0 0x420124CC:0x3FCAFE40 0x420033A2:0x3FCAFE60 0x4037FA3E:0x3FCAFEA0
#0 0x420138AD in lv_malloc at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/stdlib/lv_mem.c:67
#1 0x4200B6BD in buf_malloc at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw_buf.c:465
#2 0x4200B8A0 in draw_buf_malloc at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw_buf.c:495
(inlined by) lv_draw_buf_create at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw_buf.c:212
#3 0x4200B628 in lv_draw_layer_alloc_buf at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw.c:373
#4 0x42022A2D in dispatch at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/sw/lv_draw_sw.c:310
(inlined by) dispatch at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/sw/lv_draw_sw.c:292
#5 0x4200B3D6 in lv_draw_dispatch_layer at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw.c:255
#6 0x4200B41C in lv_draw_dispatch at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw.c:161
#7 0x4200B477 in lv_draw_finalize_task_creation at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw.c:138
#8 0x420224F5 in lv_draw_arc at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw_arc.c:69
#9 0x420170D6 in lv_arc_draw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/widgets/arc/lv_arc.c:700
(inlined by) lv_arc_event at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/widgets/arc/lv_arc.c:676
(inlined by) lv_arc_event at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/widgets/arc/lv_arc.c:436
#10 0x4208A182 in lv_obj_event_base at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_obj_event.c:86
#11 0x420054D5 in event_send_core at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_obj_event.c:359
#12 0x4200555A in lv_obj_send_event at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_obj_event.c:64
#13 0x42009A2A in lv_obj_redraw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:110
#14 0x42009D09 in refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:892
(inlined by) refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:886
#15 0x42009C3C in lv_obj_redraw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:212 (discriminator 3)
#16 0x42009D09 in refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:892
(inlined by) refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:886
#17 0x42009AE9 in lv_obj_redraw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:161 (discriminator 3)
#18 0x42009D09 in refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:892
(inlined by) refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:886
#19 0x4200A0B3 in refr_obj_and_children at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:790
#20 0x4200A213 in refr_area_part at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:723
#21 0x4200AA31 in refr_area at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:650
(inlined by) refr_invalid_areas at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:566
(inlined by) _lv_display_refr_timer at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:374
#22 0x420124CC in lv_timer_exec at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/misc/lv_timer.c:300
(inlined by) lv_timer_handler at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/misc/lv_timer.c:105
(inlined by) lv_timer_handler at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/misc/lv_timer.c:63
#23 0x420033A2 in rtos_hid_tft(void*) at src/display.cpp:62
#24 0x4037FA3E in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162
[Trace] lv_malloc: allocating 31363 bytes
[Info] lv_malloc: couldn't allocate memory (31363 bytes)
[Trace] lv_mem_monitor_core: begin
[Trace] lv_mem_monitor_core: finished
[Info] lv_malloc: used: 10424 ( 17 %), frag: 41 %, biggest free: 31724
[Warn] lv_draw_buf_create: No memory: 245x32, cf: 16, stride: 980, 31360Byte,
[Trace] lv_free: freeing 0x3fca2db0
[Warn] lv_draw_layer_alloc_buf: Allocating layer buffer failed. Try later
[Trace] lv_malloc_zeroed: allocating 84 bytes
[Trace] lv_malloc_zeroed: allocated at 0x3fca3670
[Trace] lv_malloc: allocating 64 bytes
[Trace] lv_malloc: allocated at 0x3fca36c8
[Trace] lv_malloc_zeroed: allocating 24 bytes
[Trace] lv_malloc_zeroed: allocated at 0x3fca2db0
large alloc (31363 bytes)
Backtrace: 0x420138AD:0x3FCAF3C0 0x4200B6BD:0x3FCAF420 0x4200B8A0:0x3FCAF440 0x4200B628:0x3FCAF480 0x42022A2D:0x3FCAF4A0 0x4200B3D6:0x3FCAF4C0 0x4200B41C:0x3FCAF4F0 0x4200B477:0x3FCAF510 0x420224F5:0x3FCAF530 0x42017149:0x3FCAF560 0x4208A182:0x3FCAF660 0x420054D5:0x3FCAF680 0x4200555A:0x3FCAF6A0 0x42009A2A:0x3FCAF6E0 0x42009D09:0x3FCAF820 0x42009C3C:0x3FCAF900 0x42009D09:0x3FCAFA40 0x42009AE9:0x3FCAFB20 0x42009D09:0x3FCAFC60 0x4200A0B3:0x3FCAFD40 0x4200A213:0x3FCAFD70 0x4200AA31:0x3FCAFDB0 0x420124CC:0x3FCAFE40 0x420033A2:0x3FCAFE60 0x4037FA3E:0x3FCAFEA0
#0 0x420138AD in lv_malloc at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/stdlib/lv_mem.c:67
#1 0x4200B6BD in buf_malloc at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw_buf.c:465
#2 0x4200B8A0 in draw_buf_malloc at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw_buf.c:495
(inlined by) lv_draw_buf_create at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw_buf.c:212
#3 0x4200B628 in lv_draw_layer_alloc_buf at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw.c:373
#4 0x42022A2D in dispatch at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/sw/lv_draw_sw.c:310
(inlined by) dispatch at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/sw/lv_draw_sw.c:292
#5 0x4200B3D6 in lv_draw_dispatch_layer at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw.c:255
#6 0x4200B41C in lv_draw_dispatch at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw.c:161
#7 0x4200B477 in lv_draw_finalize_task_creation at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw.c:138
#8 0x420224F5 in lv_draw_arc at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/draw/lv_draw_arc.c:69
#9 0x42017149 in lv_arc_draw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/widgets/arc/lv_arc.c:719
(inlined by) lv_arc_event at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/widgets/arc/lv_arc.c:676
(inlined by) lv_arc_event at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/widgets/arc/lv_arc.c:436
#10 0x4208A182 in lv_obj_event_base at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_obj_event.c:86
#11 0x420054D5 in event_send_core at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_obj_event.c:359
#12 0x4200555A in lv_obj_send_event at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_obj_event.c:64
#13 0x42009A2A in lv_obj_redraw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:110
#14 0x42009D09 in refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:892
(inlined by) refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:886
#15 0x42009C3C in lv_obj_redraw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:212 (discriminator 3)
#16 0x42009D09 in refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:892
(inlined by) refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:886
#17 0x42009AE9 in lv_obj_redraw at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:161 (discriminator 3)
#18 0x42009D09 in refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:892
(inlined by) refr_obj at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:886
#19 0x4200A0B3 in refr_obj_and_children at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:790
#20 0x4200A213 in refr_area_part at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:723
#21 0x4200AA31 in refr_area at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:650
(inlined by) refr_invalid_areas at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:566
(inlined by) _lv_display_refr_timer at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/core/lv_refr.c:374
#22 0x420124CC in lv_timer_exec at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/misc/lv_timer.c:300
(inlined by) lv_timer_handler at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/misc/lv_timer.c:105
(inlined by) lv_timer_handler at .pio/libdeps/esp32-s3-devkitm-1/lvgl/src/misc/lv_timer.c:63
#23 0x420033A2 in rtos_hid_tft(void*) at src/display.cpp:62
#24 0x4037FA3E in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162
One of the 31,363 byte requests succeeds–this is the “top block draw”:
What I’m noticing is that the failed allocation requests are 31,363 bytes, but “biggest free” is listed as 31,724 bytes. (This is with a [64 * 1024] LVGL buffer size.)