LVGL screenshot

lv_100ask_screenshot_demo

Video: https://youtu.be/zR_niKRp0sI

Introduction

lv_100ask_screenshot is a screenshot tool based on LVGL.

lv_100ask_screenshot features:

  • Save LVGL screen objects (full screen) as image files: lv_scr_act(),layer_sys(),layer_top()
  • Capture and save the specified LVGL object and its children as an image file
  • Supported save as: BMP, PNG, JPG
  • more todo…

lv_100ask_screenshot is very simple to use, and the subsequent custom expansion functions are also very convenient, so stay tuned for more functions.

Usage

Refer to the example in lv_lib_100ask/test/lv_100ask_screenshot_test.

Get lv_100ask_screenshot

Try lv_100ask_screenshot

You can try lv_100ask_screenshot functionality through these two files, please feel free to use them.

The path for saving images is “D:/” and cannot be modified:

2 Likes

Very nice! I’m sure it will be useful for many people!

Thank you! I hope so too!

Hey, this looks generally useful, but after quickly trying out I’d prefer to be able to get a single actual screenshot of full display output for an actual real screenshot, is there a simple way of doing this without hooking flush_cb? As snapshot only seems to be able to get a layer at a time, but I want all visible layers in capture.

Hi

lv_100ask_screenshot based on snapshot.

If you want to obtain all the screenshots, the best way I can think of at the moment is to process them in flush_cb.

I actually now made a small modified copy of snapshot functions that takes a display object and renders scr/top/sys layers to do the job for now, this appears at a quick test to get me the result I wanted whilst allowing rendering in RGB8888 despite using 16bit RGB output.

Sounds great! Looking forward to your sharing of code and upgrading snapshot.

Sure, it’s pretty much just a quick hack, and I didn’t check if the output size is necessarily correct, as it worked as expected in my situation:

lv_result_t lv_screenshot_take_to_draw_buf(lv_display_t * disp, lv_color_format_t cf, lv_draw_buf_t * draw_buf)
{
LV_ASSERT_NULL(disp);
LV_ASSERT_NULL(draw_buf);
lv_result_t res;

switch(cf) {
    case LV_COLOR_FORMAT_RGB565:
    case LV_COLOR_FORMAT_RGB888:
    case LV_COLOR_FORMAT_XRGB8888:
    case LV_COLOR_FORMAT_ARGB8888:
        break;
    default:
        LV_LOG_WARN("Not supported color format");
        return LV_RESULT_INVALID;
}

res = lv_snapshot_reshape_draw_buf(disp->act_scr, draw_buf);
if(res != LV_RESULT_OK) return res;

/* clear draw buffer*/
lv_draw_buf_clear(draw_buf, NULL);

lv_area_t snapshot_area;
int32_t w = draw_buf->header.w;
int32_t h = draw_buf->header.h;
int32_t ext_size = _lv_obj_get_ext_draw_size(disp->act_scr);
lv_obj_get_coords(disp->act_scr, &snapshot_area);
lv_area_increase(&snapshot_area, ext_size, ext_size);

lv_layer_t layer;
lv_memzero(&layer, sizeof(layer));

layer.draw_buf = draw_buf;
layer.buf_area.x1 = snapshot_area.x1;
layer.buf_area.y1 = snapshot_area.y1;
layer.buf_area.x2 = snapshot_area.x1 + w - 1;
layer.buf_area.y2 = snapshot_area.y1 + h - 1;
layer.color_format = cf;
layer._clip_area = snapshot_area;

lv_display_t * disp_old = _lv_refr_get_disp_refreshing();
lv_display_t * disp_new = disp;//lv_obj_get_display(obj);
lv_layer_t * layer_old = disp_new->layer_head;
disp_new->layer_head = &layer;

_lv_refr_set_disp_refreshing(disp_new);

lv_obj_redraw(&layer, disp_new->bottom_layer);
lv_obj_redraw(&layer, disp_new->act_scr);
lv_obj_redraw(&layer, disp_new->top_layer);
lv_obj_redraw(&layer, disp_new->sys_layer);

while(layer.draw_task_head) {
    lv_draw_dispatch_wait_for_request();
    lv_draw_dispatch_layer(NULL, &layer);
}

disp_new->layer_head = layer_old;
_lv_refr_set_disp_refreshing(disp_old);

return LV_RESULT_OK;

}

lv_draw_buf_t * lv_screenshot_take(lv_display_t * disp, lv_color_format_t cf)
{
LV_ASSERT_NULL(disp);
lv_draw_buf_t * draw_buf = lv_snapshot_create_draw_buf(disp->act_scr, cf);
if(draw_buf == NULL) return NULL;

if(lv_screenshot_take_to_draw_buf(disp, cf, draw_buf) != LV_RESULT_OK) {
    lv_draw_buf_destroy(draw_buf);
    return NULL;
}

return draw_buf;

}

1 Like

Can be ported to embedded systems?
I have STM32H757 that supports LvGL and SD-Card.

Embedded RAM scarce systems will definitely be a challenge due to it allocating a full frame buffer to capture into, I think they such would have to be captured via a flush_cb hook with a hook to write out partial frame writes out to sd card.

My board has enough ram to store the entire buffer (externally).

Hi,

I am quite new to lvgl. I’ve setup the lv_platformio sample project with latest lvgl 9.1 and running it in the simulator. This is working fine …

Now, I would like to add the possibility to save screenshots of the shown UI to my local file system.
I came across this thread and it’s not quite clear to me how to integrate it.

I’ve added a new screenshot.h file and put the code from @MacDragon into it.

#ifndef SCREENSHOT_H
#define SCREENSHOT_H

#include "lvgl.h"
#include "../.pio/libdeps/emulator_64bits/lvgl/src/display/lv_display_private.h"

lv_result_t lv_screenshot_take_to_draw_buf(lv_display_t *disp, lv_color_format_t cf, lv_draw_buf_t *draw_buf)
{
    LV_ASSERT_NULL(disp);
    LV_ASSERT_NULL(draw_buf);
    lv_result_t res;

    switch (cf)
    {
    case LV_COLOR_FORMAT_RGB565:
    case LV_COLOR_FORMAT_RGB888:
    case LV_COLOR_FORMAT_XRGB8888:
    case LV_COLOR_FORMAT_ARGB8888:
        break;
    default:
        LV_LOG_WARN("Not supported color format");
        return LV_RESULT_INVALID;
    }

    res = lv_snapshot_reshape_draw_buf(disp->act_scr, draw_buf);
    if (res != LV_RESULT_OK)
        return res;

    /* clear draw buffer*/
    lv_draw_buf_clear(draw_buf, NULL);

    lv_area_t snapshot_area;
    int32_t w = draw_buf->header.w;
    int32_t h = draw_buf->header.h;
    int32_t ext_size = _lv_obj_get_ext_draw_size(disp->act_scr);
    lv_obj_get_coords(disp->act_scr, &snapshot_area);
    lv_area_increase(&snapshot_area, ext_size, ext_size);

    lv_layer_t layer;
    lv_memzero(&layer, sizeof(layer));

    layer.draw_buf = draw_buf;
    layer.buf_area.x1 = snapshot_area.x1;
    layer.buf_area.y1 = snapshot_area.y1;
    layer.buf_area.x2 = snapshot_area.x1 + w - 1;
    layer.buf_area.y2 = snapshot_area.y1 + h - 1;
    layer.color_format = cf;
    layer._clip_area = snapshot_area;

    lv_display_t *disp_old = _lv_refr_get_disp_refreshing();
    lv_display_t *disp_new = disp; // lv_obj_get_display(obj);
    lv_layer_t *layer_old = disp_new->layer_head;
    disp_new->layer_head = &layer;

    _lv_refr_set_disp_refreshing(disp_new);

    lv_obj_redraw(&layer, disp_new->bottom_layer);
    lv_obj_redraw(&layer, disp_new->act_scr);
    lv_obj_redraw(&layer, disp_new->top_layer);
    lv_obj_redraw(&layer, disp_new->sys_layer);

    while (layer.draw_task_head)
    {
        lv_draw_dispatch_wait_for_request();
        lv_draw_dispatch_layer(NULL, &layer);
    }

    disp_new->layer_head = layer_old;
    _lv_refr_set_disp_refreshing(disp_old);

    return LV_RESULT_OK;
}

lv_draw_buf_t *lv_screenshot_take(lv_display_t *disp, lv_color_format_t cf)
{
    LV_ASSERT_NULL(disp);
    lv_draw_buf_t *draw_buf = lv_snapshot_create_draw_buf(disp->act_scr, cf);
    if (draw_buf == NULL)
        return NULL;

    if (lv_screenshot_take_to_draw_buf(disp, cf, draw_buf) != LV_RESULT_OK)
    {
        lv_draw_buf_destroy(draw_buf);
        return NULL;
    }

    return draw_buf;
}

#endif

I’ve also added the save_as_bmp.c/h files from @100ask project.

For now, I just want to make it work and save the first rendered image.
So I modified the hal_loop, but the simulator crashes when the screenshot should be taken.
I do not See any error message …

static int i = 0;

void hal_loop(void)
{
    Uint32 lastTick = SDL_GetTicks();
    while(1) {
        SDL_Delay(5);
        Uint32 current = SDL_GetTicks();
        lv_tick_inc(current - lastTick); // Update the tick timer. Tick is new for LVGL 9
        lastTick = current;
        lv_timer_handler(); // Update the UI-

        if (i == 0)
        {
            LV_LOG_INFO("test");
            lv_draw_buf_t *buff = lv_screenshot_take(lv_disp_get_default(), LV_COLOR_FORMAT_RGB565);
            save_as_bmp_file(buff->data, buff->header.w, buff->header.h, 24, "/Users/ph/Downloads/test.png");
            i = 1;
        }
    }
}

Could someone please guide me through?
Thanks

After opening the log module, try again: https://github.com/lvgl/lvgl/blob/release/v9.1/lv_conf_template.h#L211

Thanks for your reply, @100ask :slight_smile:

I enabled logging, but not sure if we get some insights.

build_flags = 
	${env.build_flags}
	-D LV_USE_LOG=1
	-D LV_LOG_LEVEL=LV_LOG_LEVEL_TRACE
	-D LV_LOG_PRINTF=1

When LV_LOG_LEVEL_INFO is set, there are no logs.
The simulator crashes and that’s it.
Then I set log level trace and the following output is shown.

[Trace] (0.121, +0)      lv_free: freeing 0x104af5168 lv_mem.c:121
[Trace] (0.121, +0)      lv_malloc: allocating 6 bytes lv_mem.c:64
[Trace] (0.121, +0)      lv_malloc: allocated at 0x104af5168 lv_mem.c:88
[Trace] (0.121, +0)      lv_realloc: reallocating 0x104af5470 with 36 size lv_mem.c:130
[Trace] (0.121, +0)      lv_realloc: reallocated at 0x104af5470 lv_mem.c:146
[Trace] (0.121, +0)      event_send_core: Sending event 45 to 0x104af5338 with 0x0 param lv_obj_event.c:343
[Trace] (0.121, +0)      lv_realloc: reallocating 0x104af5470 with 45 size lv_mem.c:130
[Trace] (0.121, +0)      lv_realloc: reallocated at 0x104af5470 lv_mem.c:146
[Trace] (0.126, +5)      lv_timer_handler: begin lv_timer.c:65
[Trace] (0.126, +0)      lv_timer_exec: calling timer callback: 0x1049b3b40 lv_timer.c:298
[Trace] (0.126, +0)      _lv_display_refr_timer: begin lv_refr.c:327
[Trace] (0.126, +0)      lv_obj_update_layout: Layout update begin lv_obj_pos.c:301
[Trace] (0.126, +0)      event_send_core: Sending event 47 to 0x104af5338 with 0x16b466360 param lv_obj_event.c:343
[Trace] (0.126, +0)      event_send_core: Sending event 47 to 0x104af5338 with 0x16b466380 param lv_obj_event.c:343
[Trace] (0.126, +0)      event_send_core: Sending event 44 to 0x104af5338 with 0x16b466470 param lv_obj_event.c:343
[Trace] (0.126, +0)      event_send_core: Sending event 37 to 0x104af4fe0 with 0x104af5338 param lv_obj_event.c:343
[Trace] (0.126, +0)      event_send_core: Sending event 47 to 0x104af4fe0 with 0x16b466210 param lv_obj_event.c:343
[Trace] (0.126, +0)      event_send_core: Sending event 47 to 0x104af4fe0 with 0x16b466210 param lv_obj_event.c:343
[Trace] (0.126, +0)      event_send_core: Sending event 22 to 0x104af5338 with 0x16b4663f0 param lv_obj_event.c:343
[Trace] (0.126, +0)      event_send_core: Sending event 37 to 0x104af4fe0 with 0x104af5338 param lv_obj_event.c:343
[Trace] (0.126, +0)      event_send_core: Sending event 47 to 0x104af4fe0 with 0x16b4661e0 param lv_obj_event.c:343
[Trace] (0.126, +0)      event_send_core: Sending event 47 to 0x104af4fe0 with 0x16b4661e0 param lv_obj_event.c:343
[Trace] (0.126, +0)      event_send_core: Sending event 47 to 0x104af5338 with 0x16b466410 param lv_obj_event.c:343
[Trace] (0.126, +0)      event_send_core: Sending event 47 to 0x104af5338 with 0x16b466410 param lv_obj_event.c:343
[Trace] (0.126, +0)      lv_obj_update_layout: Layout update end lv_obj_pos.c:304
[Trace] (0.126, +0)      lv_obj_update_layout: Layout update begin lv_obj_pos.c:301
[Trace] (0.126, +0)      event_send_core: Sending event 47 to 0x104af5338 with 0x16b466360 param lv_obj_event.c:343
[Trace] (0.126, +0)      event_send_core: Sending event 47 to 0x104af5338 with 0x16b466380 param lv_obj_event.c:343
[Trace] (0.126, +0)      lv_obj_update_layout: Layout update end lv_obj_pos.c:304
[Trace] (0.126, +0)      lv_obj_update_layout: Layout update begin lv_obj_pos.c:301
[Trace] (0.126, +0)      lv_obj_update_layout: Layout update end lv_obj_pos.c:304
[Trace] (0.126, +0)      lv_obj_update_layout: Layout update begin lv_obj_pos.c:301
[Trace] (0.126, +0)      lv_obj_update_layout: Layout update end lv_obj_pos.c:304
[Trace] (0.126, +0)      lv_obj_update_layout: Layout update begin lv_obj_pos.c:301
[Trace] (0.126, +0)      lv_obj_update_layout: Layout update end lv_obj_pos.c:304
[Trace] (0.126, +0)      wait_for_flushing: begin lv_refr.c:1076
[Trace] (0.126, +0)      wait_for_flushing: end lv_refr.c:1090
[Trace] (0.126, +0)      event_send_core: Sending event 21 to 0x104af33e0 with 0x16b466490 param lv_obj_event.c:343
[Trace] (0.126, +0)      event_send_core: Sending event 23 to 0x104af33e0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.126, +0)      event_send_core: Sending event 24 to 0x104af33e0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.126, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.126, +0)      lv_malloc_zeroed: allocated at 0x104af54a8 lv_mem.c:115
[Trace] (0.126, +0)      lv_malloc: allocating 72 bytes lv_mem.c:64
[Trace] (0.126, +0)      lv_malloc: allocated at 0x104af5510 lv_mem.c:88
[Trace] (0.127, +1)      event_send_core: Sending event 25 to 0x104af33e0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 23 to 0x104af3bf8 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 24 to 0x104af3bf8 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 25 to 0x104af3bf8 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 23 to 0x104af42f0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 24 to 0x104af42f0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5560 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 72 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af55c8 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af5510 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af54a8 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 25 to 0x104af42f0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 26 to 0x104af42f0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 27 to 0x104af42f0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 47 to 0x104af42f0 with 0x16b4652e0 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 47 to 0x104af42f0 with 0x16b4652e0 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af54a8 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 72 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af5510 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af55c8 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af5560 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5560 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 72 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af55c8 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af5510 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af54a8 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af54a8 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 64 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af5510 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af55c8 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af5560 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 28 to 0x104af42f0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 23 to 0x104af4358 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 24 to 0x104af4358 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5560 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 72 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af55c8 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af5510 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af54a8 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 25 to 0x104af4358 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 26 to 0x104af4358 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 27 to 0x104af4358 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 47 to 0x104af4358 with 0x16b4652e0 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 47 to 0x104af4358 with 0x16b4652e0 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af54a8 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 72 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af5510 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af55c8 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af5560 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 28 to 0x104af4358 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 23 to 0x104af4448 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 24 to 0x104af4448 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5560 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 72 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af55c8 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af5510 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af54a8 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 25 to 0x104af4448 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 26 to 0x104af4448 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 27 to 0x104af4448 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 47 to 0x104af4448 with 0x16b4652e0 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 47 to 0x104af4448 with 0x16b4652e0 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af54a8 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 72 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af5510 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af55c8 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af5560 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5560 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 64 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af55c8 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af5510 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af54a8 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 28 to 0x104af4448 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 23 to 0x104af4538 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 24 to 0x104af4538 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af54a8 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 72 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af5510 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af55c8 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af5560 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 25 to 0x104af4538 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 26 to 0x104af4538 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 27 to 0x104af4538 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 47 to 0x104af4538 with 0x16b4652e0 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 47 to 0x104af4538 with 0x16b4652e0 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5560 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 72 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af55c8 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af5510 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af54a8 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af54a8 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 64 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af5510 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af55c8 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af5560 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 28 to 0x104af4538 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 23 to 0x104af4758 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 24 to 0x104af4758 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5560 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 72 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af55c8 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af5510 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af54a8 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc: allocating 16 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af54a8 lv_mem.c:88
[Trace] (0.127, +0)      lv_malloc: allocating 54 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af54c8 lv_mem.c:88
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 144 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5618 lv_mem.c:115
[Trace] (0.127, +0)      lv_free: freeing 0x104af5618 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af54a8 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 25 to 0x104af4758 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 26 to 0x104af4758 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 27 to 0x104af4758 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 28 to 0x104af4758 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 23 to 0x104af47d0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 24 to 0x104af47d0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5618 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 72 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af5508 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af55c8 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af5560 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc: allocating 16 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af54a8 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af54a8 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 25 to 0x104af47d0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 26 to 0x104af47d0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 27 to 0x104af47d0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 28 to 0x104af47d0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 23 to 0x104af4920 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 24 to 0x104af4920 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5560 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 72 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af55c8 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af5508 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af5618 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc: allocating 16 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af54a8 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af54a8 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 25 to 0x104af4920 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 26 to 0x104af4920 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 27 to 0x104af4920 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 28 to 0x104af4920 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 23 to 0x104af4a78 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 24 to 0x104af4a78 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5618 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 72 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af5508 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af55c8 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af5560 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc: allocating 16 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af54a8 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af54a8 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 25 to 0x104af4a78 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 26 to 0x104af4a78 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 27 to 0x104af4a78 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 28 to 0x104af4a78 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 23 to 0x104af4bd8 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 24 to 0x104af4bd8 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5560 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 72 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af55c8 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af5508 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af5618 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc: allocating 14 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af54a8 lv_mem.c:88
[Trace] (0.127, +0)      lv_malloc: allocating 48 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af5508 lv_mem.c:88
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 128 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5618 lv_mem.c:115
[Trace] (0.127, +0)      lv_free: freeing 0x104af5618 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af54a8 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 25 to 0x104af4bd8 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 26 to 0x104af4bd8 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 27 to 0x104af4bd8 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5618 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 64 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af5680 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af55c8 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af5560 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc: allocating 16 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af54a8 lv_mem.c:88
[Trace] (0.127, +0)      lv_malloc: allocating 42 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af5540 lv_mem.c:88
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 112 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5578 lv_mem.c:115
[Trace] (0.127, +0)      lv_free: freeing 0x104af5578 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af54a8 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 28 to 0x104af4bd8 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 23 to 0x104af4e10 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 24 to 0x104af4e10 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5578 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 120 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af56c8 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af5680 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af5618 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 32 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af55e0 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 211 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af5748 lv_mem.c:88
[Trace] (0.127, +0)      lv_draw_buf_reshape: Draw buf too small for new shape lv_draw_buf.c:262
[Trace] (0.127, +0)      lv_free: freeing 0x104af5748 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af55e0 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 32 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af55e0 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 227 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af5748 lv_mem.c:88
[Trace] (0.127, +0)      lv_draw_buf_reshape: Draw buf too small for new shape lv_draw_buf.c:262
[Trace] (0.127, +0)      lv_free: freeing 0x104af5748 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af55e0 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 32 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af55e0 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 243 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af5748 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af5748 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af55e0 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 25 to 0x104af4e10 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 26 to 0x104af4e10 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 27 to 0x104af4e10 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 47 to 0x104af4e10 with 0x16b465220 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 47 to 0x104af4e10 with 0x16b465220 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 28 to 0x104af4e10 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 26 to 0x104af3bf8 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 27 to 0x104af3bf8 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 28 to 0x104af3bf8 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 23 to 0x104af3d68 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 24 to 0x104af3d68 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 25 to 0x104af3d68 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 23 to 0x104af3fc0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 24 to 0x104af3fc0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af55e0 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 120 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af5648 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af56c8 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af5578 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 32 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5578 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 231 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af56c8 lv_mem.c:88
[Trace] (0.127, +0)      lv_draw_buf_reshape: Draw buf too small for new shape lv_draw_buf.c:262
[Trace] (0.127, +0)      lv_free: freeing 0x104af56c8 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af5578 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 32 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5578 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 243 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af56c8 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af56c8 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af5578 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 25 to 0x104af3fc0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 26 to 0x104af3fc0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 27 to 0x104af3fc0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 47 to 0x104af3fc0 with 0x16b465220 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 47 to 0x104af3fc0 with 0x16b465220 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 28 to 0x104af3fc0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 23 to 0x104af40d0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 24 to 0x104af40d0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5578 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 120 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af56c8 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af5648 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af55e0 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 32 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af55e0 lv_mem.c:115
[Trace] (0.127, +0)      lv_malloc: allocating 243 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af5748 lv_mem.c:88
[Trace] (0.127, +0)      lv_free: freeing 0x104af5748 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af55e0 lv_mem.c:121
[Trace] (0.127, +0)      event_send_core: Sending event 25 to 0x104af40d0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 26 to 0x104af40d0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 27 to 0x104af40d0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 47 to 0x104af40d0 with 0x16b465220 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 47 to 0x104af40d0 with 0x16b465220 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 28 to 0x104af40d0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 23 to 0x104af4fe0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 24 to 0x104af4fe0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 25 to 0x104af4fe0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 23 to 0x104af50a0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      event_send_core: Sending event 24 to 0x104af50a0 with 0x104af2008 param lv_obj_event.c:343
[Trace] (0.127, +0)      lv_malloc: allocating 136 bytes lv_mem.c:64
[Trace] (0.127, +0)      lv_malloc: allocated at 0x104af55e0 lv_mem.c:88
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 96 bytes lv_mem.c:94
[Trace] (0.127, +0)      lv_malloc_zeroed: allocated at 0x104af5748 lv_mem.c:115
[Trace] (0.127, +0)      lv_free: freeing 0x104af56c8 lv_mem.c:121
[Trace] (0.127, +0)      lv_free: freeing 0x104af5578 lv_mem.c:121
[Trace] (0.127, +0)      lv_malloc_zeroed: allocating 104 bytes lv_mem.c:94
*** [execute] Error -11
========================================================================================================= [FAILED] Took 4.30 seconds =========================================================================================================

Environment      Status    Duration
---------------  --------  ------------
emulator_64bits  FAILED    00:00:04.302
==================================================================================================== 1 failed, 0 succeeded in 00:00:04.302 ====================================================================================================

I was forced to reduce the log output, as the amount of chars are limited.

In either case, the simulator crashes and macOS brings up the unexpected error message.

It seems that the program did not run to this point, so there should be a problem with the simulator itself:

Can you run LVGL built-in examples normally?

I never tested the demo widgets, but built my custom UI.
I am pretty sure, that it is working. When I comment the screenshot part in the hal_loop the simulator is starting and the expected UI is rendering.
Only when the if is true and the code is executed, it crashes as shown.

Now, I just commented the save_as_bmp_file function and then it runs, too.
It seems that saving the buff is the problem.

The bmp code is copied from your project.
Could it be a problem with macOS and accessing the Downloads folder from a unknown app?

It should be a problem with the macOS system permissions. I usually do it in a Windows or Ubuntu environment.

I digged deeper and found out, that the lv_draw_buf_t *buff is NULL.
I commented the save_as_bmp_file as this will result in a segmentation fault and the logs are gone …

I found these log statements:

[Info]  (0.453, +338)    hal_loop: test app_hal.c:63
[Info]  (0.453, +0)      lv_malloc: couldn't allocate memory (153603 bytes) lv_mem.c:73
[Info]  (0.453, +0)      lv_malloc: used: 15776 ( 13 %), frag:   0 %, biggest free: 110896 lv_mem.c:79
[Warn]  (0.453, +0)      lv_draw_buf_create: No memory: 320x240, cf: 18, stride: 640, 153600Byte,  lv_draw_buf.c:216
[Info]  (0.453, +0)      hal_loop: NULL app_hal.c:66

It seems, that it was not possible to allocate memory for the buffer.
I saw these two configurations in platform.io:

	-D LV_MEM_CUSTOM=1
	-D LV_MEM_SIZE="(128U * 1024U)"

I doubled the memory to 256U and at least it’s not crashing :wink:
Though, I am still unable to write the bmp to the file system.

[Warn]  (0.441, +1)      lv_fs_open: Can't open file (/Users/ph/Downloads/test.bmp): unknown driver letter lv_fs.c:75
[User]  (0.441, +0)      save_as_bmp_file: Can't create output file /Users/ph/Downloads/test.bmp save_as_bmp.c:86

I found out, that I need to enable FS

  -D LV_USE_FS_STDIO=1
  -D LV_FS_STDIO_LETTER=65 ;A <-- not sure how to define a char?

It’s better, but still not completely working.
The simulator comes up and shows the expected UI.

Though, the saved bmp is somehow damaged.
test

Seems to be a problem with the screenshot itself. Can you think of a reason, why this is happening?


EDIT:
Tried to save the screenshot as png. After increasing mem size heavily, I’ve got a similar result
test

:clap:Great!

Please check LV_COLOR_DEPTH.

I switched the LV_COLOR_FORMAT and it’s getting better :slight_smile:

lv_draw_buf_t *buff = lv_screenshot_take(lv_disp_get_default(), LV_COLOR_FORMAT_RGB888);

The saved png looks now like this
test

Funnily, the saved bmp is fine
test1

It seems to be a problem with the png encoding.

            lv_draw_buf_t *buff = lv_screenshot_take(lv_disp_get_default(), LV_COLOR_FORMAT_RGB888);
            save_as_bmp_file(buff->data, buff->header.w, buff->header.h, 24, "A:/Users/ph/Downloads/test.bmp");
            save_as_png_file(buff->data, buff->header.w, buff->header.h, 24, "A:/Users/ph/Downloads/test.png");

EDIT:
Saving the screenshot as jpg looks exactly like png