Flush_cb function is not called at all

Hmm code hang …

    if(area->x2 < 0) return;
    if(area->y2 < 0) return;
    if(area->x1 > DISP_HOR_RES - 1) return;
    if(area->y1 > DISP_VER_RES - 1) return;

for example this in flushcb breaks work because return without flush ready call, but your code seems have some base loop issue.
Dont use empty loops try toggle gpio inside as minimum code.

are you calling lv_flush_ready in your flush function? You should be… Also you need to call lv_task_handler in looping code and you also need to call lv_tick_inc from the same loop…

void flush_cb(lv_display_t * disp, lv_area_t area, uint8_t* data)
{
    // flush code here
    // let lvgl know that the buffer has been flushed.
    lv_flush_ready(disp);
}



while 1 {
    delay(5);  // delay, sleep, whatever it is you want to use to stall the loop, doesn't matter
    lv_tick_inc(5);
    lv_task_handler();
}

1 Like

Maybe the issue is in lv_port_disp_init. Please show how you initialise and create an LVGL display.

Below is the function
void lv_port_disp_init()
{

static lv_disp_draw_buf_t buf;
memset(disp_buf1, 0, sizeof(disp_buf1));
//memset(disp_buf2, 0, sizeof(disp_buf2));

lv_disp_draw_buf_init(&buf, disp_buf1, NULL, DISP_HOR_RES * 10);

lv_disp_drv_init(&disp_drv);

disp_drv.draw_buf = &buf;
disp_drv.flush_cb = flush_cb;
disp_drv.hor_res = DISP_HOR_RES;
disp_drv.ver_res = DISP_VER_RES;
lv_disp_drv_register(&disp_drv);

static lv_indev_drv_t indev_drv;
 lv_indev_drv_init( &indev_drv );
	indev_drv.type = LV_INDEV_TYPE_POINTER;
	indev_drv.read_cb = my_touchpad_read;
	lv_indev_drv_register( &indev_drv );

}
I have already added all the files in my post 14

Is disp_buf1 declared as lv_color_t? In v8 it should be (in v9 it’s in bytes)

Yes it is lv_color_t and i am using V8.3.5

I am jd3096-mpy from github,how can I get your address?

Hi ,

Thank you all for looking into the issue.

I found the issue , It is becuase the stack size is not sufficient now i have increased the stack size and the issue is resolved.