External FLASH and SDRAM Cortex-M

Hi,

I’m starting with LVGL and I read part of documentation on site web but I’ve some question about use of external FLASH and SDRAM.
I’m using a STM32 kit STM32F769I-Discovery, it has one FLAH of 512Mbit and SDRAM of 128Mbit. My questions are:

  1. When we create a new display is necessary to store it on buffer and in general if we use a buffer the same size screen resolution whit a good color depth (e.i 32 bits) we need to use SDRAM external on Cortex-M so is there any chance to tell LVGL that create screen on external RAM.

  2. If we create new object it will be storage on microcontroller internal RAM I suppose, so Is there a possibility to allocated the pointer object on SDRAM external.

  3. if we need add image to our protect I think that best way is using external FLASH of board, where can we configure this option on LVGL to it’s looking for to FLASH.

Sorry if I worng in some concept of LVGL.

  1. Yes; you can just declare the display buffer array with a section attribute (synax depends on compiler).
  2. https://github.com/lvgl/lvgl/blob/eaacde672263f3e4285625c158e943a7f9465b62/lv_conf_template.h#L90
  3. If you open the generated C file you can see it has an array definition at the top. By adding a section attribute to this you can put the image data in external flash.

hi @embeddedt ,when loading image,will the whole image data loaded to ram then to frame buffer?

For a converted image in C format, the image is loaded directly from flash to the display buffer configured using lv_disp_buf_init.

Hi @embeddedt I think understand the points 1and 2 of your answer but the last one I’m a little confused,what attribute you tell my, the only attribute that I saw in the example was a #define tag but it doesn’t target of FLASH address memory . Sorry if I didn’t understand you.

You can add more attributes beyond what is already listed there. For example, if you use GCC, it should be possible to put the image in a custom section like this:

const __attribute__((section(".extflash"))) LV_ATTRIBUTE_MEM_ALIGN uint8_t img_lv_demo_music_btn_pause_map[] = {