Description
What MCU/Processor/Board and compiler are you using?
ESP32-S3, Arduino IDE 2.3.5, esp32 3.2.0
What LVGL version are you using?
9.2.2
What do you want to achieve?
LVGL apps that run vitthout crashing.
What have you tried so far?
See below
Code to reproduce
Several full-size apps which all crash sooner (immediately) or later (after a few minutes or hours) with -
lv_inv_area: Asserted at expression: !disp->rendering_in_progress (Invalidate area is not allowed during rendering.) lv_refr.c:274
These same apps all used to work OK.
I have been unable to isolate any one thing that causes this error.
However, it is usually either a call to -
lv_label_set_text(label, txt);
or
lv_obj_set_style_bg_color(obj, lv_color_hex(col), LV_PART_MAIN);
Here’s my LVGL init -
static uint32_t tick_cb(void) {
return millis();
}
void ARDUINO_ISR_ATTR wait_cb(lv_disp_t* disp) {
lv_disp_flush_ready(disp);
}
void LVGLinit() {
sprintf(Lbuf, "LVGL init v %d.%d.%d", lv_version_major(), lv_version_minor(), lv_version_patch());
Log(Lbuf, INFO);
lv_init();
lv_tick_set_cb(tick_cb);
disp = lv_display_create(TFT_WIDTH, TFT_HEIGHT);
lv_display_set_flush_cb(disp, DisplayFlush);
lv_display_set_flush_wait_cb(disp, wait_cb);
int drawBufSize = TFT_WIDTH * TFT_HEIGHT * 2;
static void* buf0 = (lv_color_t*)heap_caps_malloc(drawBufSize, MALLOC_CAP_SPIRAM);
static void* buf1 = (lv_color_t*)heap_caps_malloc(drawBufSize, MALLOC_CAP_SPIRAM);
lv_display_set_buffers(disp, buf0, buf1, drawBufSize, LV_DISPLAY_RENDER_MODE_PARTIAL);
...
}
void DisplayFlush(lv_display_t* disp, const lv_area_t* area, unsigned char* data) {
uint32_t w = lv_area_get_width(area);
uint32_t h = lv_area_get_height(area);
lv_draw_sw_rgb565_swap(data, w * h);
gfx.pushImage(area->x1, area->y1, w, h, (uint16_t*)data);
// Not needed - handled instead by lv_display_set_flush_wait_cb()
// lv_disp_flush_ready(disp);
}