Strange output on display

Dear

This is my first Lvgl (7.10.1) project with STM32F4xx controller. I use the ILI9341 (SPI) driver with a screen from 320x240 pixels. I think my logic glue driver is correct (I check this with a logic analyzer.) Only my screen displays something strange…

What I changed in de config:


**#define** **LV_HOR_RES_MAX** (320)
**#define** **LV_VER_RES_MAX** (240)
**#define** **LV_COLOR_DEPTH** 16
**#define** **LV_USE_GPU** 0

My init:

**static** lv_disp_buf_t disp_buf;
**static** lv_color_t buf_1[**LV_HOR_RES_MAX** * 10];
lv_disp_buf_init(&disp_buf, buf_1, **NULL** , **LV_HOR_RES_MAX** * 10);
lv_disp_drv_t disp_drv;
lv_disp_drv_init(&disp_drv);
disp_drv.buffer = &disp_buf;
disp_drv.flush_cb = ILI9341_flush;
lv_disp_drv_register(&disp_drv);
lv_obj_t * btn1 = lv_btn_create(lv_scr_act(), **NULL** );
lv_obj_align(btn1, **NULL** , *LV_ALIGN_CENTER* , 0, 0);

What do i wrong?
Thanks!
Nonkel DW

I checked your init code. It looks correct to me, but did you set hor_res and ver_res in the display_driver?

Thanks for the reply.
Yes, I did this.

It seems like a color depth mismatch issue.

Can you paint a rectangle on the display to red, blue or purple without LVGL?