Lvgl stm32 ltdc

Hi i am using LTDC in stm32 to drive an RGB 24 bit display in RGB565 mode, so far i was able to get something like this
image
but there is an alignment issue , what would have caused it? lvgl driver and flush function is set like this

void init_lvgl(void)
{
lv_disp_draw_buf_init(&drawbuf, lvgl_buf,lvgl_buf, LCD_WIDTH * LVGL_BUF_SIZE);
/* Initialize display driver */
lv_disp_drv_init(&dispdrv);
dispdrv.hor_res = LCD_WIDTH;
dispdrv.ver_res = LCD_HEIGHT;
dispdrv.flush_cb = flush_cb;
dispdrv.draw_buf = &drawbuf;
dispdrv.full_refresh = 0 ;
dispdrv.direct_mode = 0 ;
lv_disp_drv_register(&dispdrv);
}

static void flush_cb(lv_disp_drv_t* disp, const lv_area_t* area, lv_color_t* px_map)
{
uint32_t w = (area->x2 - area->x1 + 1);
uint32_t h = (area->y2 - area->y1 + 1);
uint16_t *dst = framebuffer + area->y1 * disp->hor_res + area->x1;
uint16_t src = (uint16_t )px_map;
//HAL_DMA2D_Start(&hdma2d,
(src),
(dst),w,h);
for (uint32_t y = 0; y < h; y++) {
//HAL_DMA2D_Start();
memcpy(dst, src, w * sizeof(uint16_t));
dst += disp->hor_res;
src += w;
}
lv_disp_flush_ready(disp);
}
any help on this and can you give me some ways to improve the update speed of the UI elements , right now its way too slow , i need to increase the speed on this ,
?

Cc @liamHowatt

Hi @Blaze,

Are you getting a hardfault? If so, do you know which line it’s hardfaulting at?

How do you declare lvgl_buf?

You should not set the same buf twice in lv_disp_draw_buf_init. Pass NULL for the second buf parameter if you only use one.

Hi @Blaze

The variable uint16_t src isn’t a pointer. you are copying from a bogus memory location.

For speed have you considered using another buffer to make a smoother transition from one screen to another.

hi yeah i got that one fixed . i am using free RTOS so the main issue was the stack size, every time the stack get broken , so i increased the stack size now is running fine . so now i am getting proper output . but still i need to fix the update speed thats the main thing here . since i am in LVGL 8 and inside stm32 platform(i am new to this) i really need some help on this. thnak you
image

can you provide me some example code or any example project to help me get a refernace. and the stm32 has something called dma driver or something which is in lvgl v 9.0 . does that make any differance. if yes i can port to LVGL 9.0

how to fix that

STM32 F H U ??? Internal RAM ?? Read about direct rendering or use hw better optimized TouchGFX .