When I enable LV_VDB_DOUBLE, and malloc vdb to two external RAM (PSRAM) , only a half screen displayed

when I use the helloworld demo, and enable VDB malloc in psram, don’t know what happened. no clues.

    /*===================
   Graphical settings
 *===================*/

/* Horizontal and vertical resolution of the library.*/
#define LV_HOR_RES          (320)
#define LV_VER_RES          (240)
#define LV_DPI              100

/* Size of VDB (Virtual Display Buffer: the internal graphics buffer).
 * Required for buffered drawing, opacity and anti-aliasing
 * VDB makes the double buffering, you don't need to deal with it!
 * Typical size: ~1/10 screen */
#define LV_VDB_SIZE         (60 * LV_HOR_RES)  /*Size of VDB in pixel count (1/10 screen size is good for first)*/
#define LV_VDB_ADR          0X3FBFB500                  /*Place VDB to a specific address (e.g. in external RAM) (0: allocate automatically into RAM)*/

/* Use two Virtual Display buffers (VDB) parallelize rendering and flushing (optional)
 * The flushing should use DMA to write the frame buffer in the background*/
#define LV_VDB_DOUBLE       1       /*1: Enable the use of 2 VDBs*/
#define LV_VDB2_ADR         0X3FBF6A00       /*Place VDB2 to a specific address (e.g. in external RAM) (0: allocate automatically into RAM)*/

/* Enable anti-aliasing (lines, and radiuses will be smoothed) */
#define LV_ANTIALIAS        1       /*1: Enable anti-aliasing*/

/*Screen refresh settings*/
#define LV_REFR_PERIOD      50    /*Screen refresh period in milliseconds*/
#define LV_INV_FIFO_SIZE    32    /*The average count of objects on a screen */


===========  main task =================

void *vbf1 = NULL;
void *vbf2 = NULL;
vbf1 = EspAudioAlloc(1,LV_VDB_SIZE_IN_BYTES);
vbf2 = EspAudioAlloc(1,LV_VDB_SIZE_IN_BYTES);
if((NULL == vbf1) | (NULL == vbf2)){
    ESP_LOGE("ili9431_lvgl_Task", "vbf alloc failed...\r\n");
    abort();
}else{
    lv_vdb_set_adr(vbf1,vbf2);
}

lv_init();
disp_spi_init();
ili9431_init();

lv_disp_drv_t disp;
lv_disp_drv_init(&disp);
disp.disp_flush = ili9431_flush;
disp.disp_fill = ili9431_fill;
lv_disp_drv_register(&disp);

esp_register_freertos_tick_hook(lv_tick_task);

lv_obj_t * label1 =  lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(label1, "Hello world!");
lv_obj_align(label1, NULL, LV_ALIGN_CENTER, 0, 0);


while (1) 
{
	vTaskDelay(10);
    	lv_task_handler();

}

Hi,

We will release v6.0 soon where display driver part is updated. If you are still at the beginning of your project I suggest tying with the dev-6.0 branch.

You can use the PC simulator as reference about initialization:

And here is more detailed description about porting:

What I wanted to do is move vdb buffer and some dram.bss to exram to save internal ram. any suggestion please.

Does dev 6.0 has good support for using external RAM ? I dont know why the demo [esp32_ili9341] can’t use external RAM. when put vdb buffer to external ram lvgl task will stuck at somewhere.

The use of external RAM has nothing to do with LittlevGL itself. It’s platform specific. Can you debug and see where it gets stuck?

You can see here how it works in dev6-0: Porting example

I suggest making it work with “VDB in bss” to reduce the possible issues.