I’ve got an SDL2 simulation working in VSCode on Windows, drawing a simple menu (vertical array of 6 labels). I’m attempting the next step which is to integrate it into my embedded hardware.
Smartfusion2 - Arm Cortex M3 on custom hardware.
The Cortex M3 has 264KB of Flash, 64KB RAM.
I’m running FreeRTOS and have allocated a task stack of 4 kB to the graphics task.
I have 264 MB of LPDDR RAM on board
Write a display driver for my device so I can establish the program and memory footprints of using the label function to draw a simple menu.
My device has video from a camera running through a framebuffer in the LPDDR.
I would like to use LVGL to draw the overlays in a separate area of the LPDDR, so I can alpha blend them later (FPGA task).
I’m stuck at the concept stage - I can’t get my head around how to point LVGL buffers to my LPDDR RAM (which I have a lot of), and not on my SDRAM (where I can only allocate 4-8 KB).I’m trying to adapt the code found here:
#define DISP_HOR_RES 920 #define DISP_VER_RES 736 /* Example for 3) also set disp_drv.full_refresh = 1 below*/ static lv_disp_draw_buf_t draw_buf_dsc_3; static lv_color32_t buf_3_1[DISP_HOR_RES * DISP_VER_RES]; /*A screen sized buffer*/ static lv_color32_t buf_3_2[DISP_HOR_RES * DISP_VER_RES]; /*Another screen sized buffer*/ lv_disp_draw_buf_init(&draw_buf_dsc_3, buf_3_1, buf_3_2, DISP_HOR_RES * DISP_VER_RES); /*Initialize the display buffer*/
But will this try to initialise a buffer in my SDRAM?
Is there a way I can point LVGL to a start address in the LPDDR RAM and write directly to the memory locations I give it there? Since I don’t need to drive a display as such - I only need to write pixel data to specific locations in memory and the FPGA will do the rest.
Thanks for your time.