Why can't I display GIF's larger than 120px?

What MCU/Processor/Board and compiler are you using?

ESP32, Arduino IDE, 320x240px display.

What LVGL version are you using?

LVGL 8.3


I am trying to display a GIF, started out with the provide example from LVGL.
That works fine. Went on with my own, converted that with the GIF decoder from LVGL, didn’t work.
Tried the bulb.gif example (through the decoder) and that worked fine.
After many many hours of trying and using many different online gifs, I discovered that any gif larger than 120px height (and 160px width, not 100% sure about this) won’t be displayed.

It compiles without any errors, but the screen remains black.
Tried the GIF as background on a blank screen as well as within an Image object.

Any thoughts on the matter would be highly appreciated.
Thank you.

May it be the case that you don’t have enough RAM?

Thank you for your reply @robotanical, I was thinking in that direction as well.
But wouldn’t the compiler than throw an error and not compile?
According to the compiler I am only using 24% of the programming memory and 19% of the dynamic memory.

On esp32 you can check with esp_get_free_heap_size() how much memory you have left, not sure if compiler will tell you dynamically during runtime how much you have left?

1 Like

Thank you for your reply and help @robotanical.
It indeeds looks like a I am running out of RAM.
Will further look in to the matter.

@robotanical Any other suggestions or thoughts on the matter maybe?

Cause after testing multiple dimensions and different GIFs it doesn’t seem to be a RAM issue. Since I get similar values from esp_get_free_heap_size(), for displaying and non displaying GIF (dimensions). :thinking:

After starting over code wise with bare minimal code, without any other items/widgets/images, the problem persists.
Tried it in steps of 20px width, 320x240 (as needed), 300x225, 280x210, etc etc etc.
The GIF(s) only display from 180x135 and lower.

Even with GIFs that larger by size but smaller in memory than the example GIF (bulb) it doesn’t work.

Any tip towards what direction I should look for a solution would be appreciated.

Try enlarge memory assigned for lvgl in lvconf.h Default is 48k try 96 or 128

Thank you for your suggestion @Marian_M.

#define LV_MEM_CUSTOM 1
#if LV_MEM_CUSTOM == 0
/*Size of the memory available for lv_mem_alloc() in bytes (>= 2kB)*/
#define LV_MEM_SIZE (48U * 1024U) /*[bytes]*/

#define LV_MEM_CUSTOM 0
#if LV_MEM_CUSTOM == 0
/*Size of the memory available for lv_mem_alloc() in bytes (>= 2kB)*/
#define LV_MEM_SIZE (96U * 1024U) /*[bytes]*/

gives compiling errors, even with bare minimal code without GIF.

.dram0.bss' will not fit in region dram0_0_seg’
DRAM segment data does not fit.
DRAM segment data does not fit.
region `dram0_0_seg’ overflowed by 13776 bytes

Any suggestion what’s going wrong here, cause the code is basically empty.

Thank you in advance.

Put Arduino IDE to Trash and use more profi IDE and read docu lvgl gif page. Here is memory requirments defined.
And bare minimal code is irelevant, you can assign full RAM with one line code…