Description
I am using lvgl on a custom STM32H7 board with two frame buffers in SDRAM. I have it working but it is incredibly slow. Can anyone point me towards a repo or example utilizing direct double buffering with an ST chip? Everything displays fine in render mode full but when I switch to direct I have some artifacting. The widgets themselves kind of flicker when they are updated so I don’t think it has to with vsync and that I instead misconfigured it to render into my active buffer.
What MCU/Processor/Board and compiler are you using?
STM32H743
What do you want to achieve?
Double buffering from SDRAM
What have you tried so far?
See my swap function
Code to reproduce
My lvgl setup and flush functions
void LCD_init(void) {
lv_display_t * display0 = lv_display_create(WIDTH, HEIGHT);
//Set up lvgl for double buffering
lv_display_set_buffers(display0, framebuffer0, framebuffer1, (WIDTH * HEIGHT * 4), LV_DISPLAY_RENDER_MODE_DIRECT);
lv_display_set_flush_cb(display0, my_flush_cb);
}
//Buffer flush function for lvgl. Literally just calls swap and ready
static void my_flush_cb(lv_display_t * display, const lv_area_t * area, uint8_t * px_map) {
FB_Swap((uintptr_t) px_map);
lv_display_flush_ready(display);
}
My frame buffer swap function
void FB_Swap(uintptr_t written_buffer) {
HAL_LTDC_SetAddress(&hltdc, (uint32_t)written_buffer, LTDC_LAYER_1);
__HAL_LTDC_RELOAD_CONFIG(&hltdc);
}
Again I’m sure many have done this already I just have not found an example myself with double buffering yet.