Reduce size of LVGL example?

Hi,

I have been trying to modify the LVGL example to work with an 480x320 SPI TFT screen (adafruit's 480x360 TFT featherwing specifically). I have gotten working with 240×320 resolution to work with LVGL and I have gotten the intermediate dev academy exercise working on the full-screen. However whenever I try to use LVGL with the 480x320 resolution I massively exceed the 52480's RAM. I have tried a few things in the config like trying to manually reduce the size with CONFIG_MAIN_STACK_SIZE, CONFIG_HEAP_MEM_POOL_SIZE, CONFIG_LV_Z_BITS_PER_PIXEL, CONFIG_LV_COLOR_DEPTH_1 and CONFIG_LV_Z_MEM_POOL_NUMBER_BLOCKS but I haven't been able to get the program down to a size where it will run on the nrf52840. Also sometimes it seems to auto-config I2C to yes which breaks my code? I don't know why it does that. Anyway, if anyone is a aware of a good way to reduce the memory burden of LVGL or if you know an alternate library that will let me build little text displays I would appreciate it. All I really need is monochrome text and a couple of lines maybe.

Thanks,

  • u8glib should be much more lightweight, but for simple monochrome graphics I usually just write a custom library if I don’t need robust graphics. It’s been a couple years since the last time I worked directly with LVGL but there should be a handful of KConfig/lv_conf options that reduce RAM usage, LVGL’s defaults are pretty costly. Disable any features you aren’t using like animations, maybe adjust CONFIG_LVGL_VDB_SIZE, etc. If the LVGL memory monitor works with Zephyr, I would use that as well (and check your build’s map file) to see how close your limits are. LVGL forums were a huge help for me, there are many threads on RAM and flash footprint reduction techniques. 

Related