Porting LVGL to STM32H743

I’m try to port LVGL to STM32H743 but having problem with display flush. The image on the screen is garbled.

 static void ex_disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p)
    int32_t x, y;
    for(y = area->y1; y <= area->y2; y++) {
        for(x = area->x1; x <= area->x2; x++) {

        	BSP_LCD_DrawPixel(x, y, (uint32_t *)color_p);




I know the display is working as I can draw solid bars like this:
for(y=50;y<200;y++) {
for(x = 0; x <1023; x++) {
BSP_LCD_DrawPixel(x, y, 0x001F);

Any ideas of how to fix this ? I’m using version 7.5.0 and RGB565 mode

did you try the code on simulator?

No, I couldn’t get the simulator to install on an iMac.

I’ve got LVGL working on the ESP32, Teensy 4 and STM32F discovery board.

I think there is a display buffer configuration issue.

I think you want BSP_LCD_DrawPixel(x, y, color_p->full);.

After I changed it to:

I get a white/grey screen but the ex_disp_flush doesn’t get called to draw the label/buttons.
I know the lv_tick_inc(1); is called as it stops if I put a breakpoint there.

The log shows:
Trace: indev read task finished .(lv_indev.c #129 _lv_indev_read_task())
Trace: lv_task_handler ready .(lv_task.c #192 lv_task_handler())
Trace: lv_task_handler started .(lv_task.c #74 lv_task_handler())
Trace: indev read task started .(lv_indev.c #77 _lv_indev_read_task())
Trace: idnev read started .(lv_hal_indev.c #153 _lv_indev_read())
Trace: idnev read finished .(lv_hal_indev.c #155 _lv_indev_read())
Trace: indev read task finished .(lv_indev.c #129 _lv_indev_read_task())
Trace: lv_task_handler ready .(lv_task.c #192 lv_task_handler())

but no screen update.

Got it to work now.

Now to add DMA.

1 Like

Just Use :

  uint16_t width = (area->x2 - area->x1 +1);
  uint16_t height = (area->y2 - area->y1+1);
  BSP_LCD_DrawRGB16Image( area->x1, area->y1, width , height, (uint16_t *)color_p);

Hello do you think I could see your code base possibly as I’m currently attempting to get LVGL working on a STMH7 as well but keep having it hang.

Its not in state I can release at the moment.

In your code try and turn off cache for now.
Comment out clearing of the cache is well. I had to do that as I could not get the cache to work.