Open fietser28 opened 11 months ago
I implemented support for uncompressed assets data.
Until now, so called assets data (pages, flows, global variables, ... definitions) was stored in compressed (LZ4) form in FLASH memory and decompression of that data was done during startup in RAM or SDRAM and after that used from there. This was done in that way because it was wanted to optimize the consumption of FLASH memory with the assumption that there is a large SDRAM memory. Since it is mainly read only data (i.e. only global variables are read write) it makes sense to keep it all the time in the FLASH memory if one wants to optimize RAM consumption. In order to achieve this, assets data must be written to flash in uncompressed form. To store assets data uncompressed inside FLASH memory following changes are required:
flow_def.h
replace line //${eez-studio GUI_ASSETS_DECL_COMPRESSED}
with //${eez-studio GUI_ASSETS_DECL}
flow_def.c
replace line //${eez-studio GUI_ASSETS_DEF_COMPRESSED}
with //${eez-studio GUI_ASSETS_DEF}
There is also some changes in eez-framework to support this, so pull the latest version.
Flow execution queue size can be adjusted also. By default, memory for 1000 entries is reserved. You can change this to some smaller value by putting the following line in eez-framework-conf.h
that you can place next to lv_conf.h
:
#define EEZ_FLOW_QUEUE_SIZE 250
But, you must determine value that works for you empirically. You can get the max. value used so far by calling eez::flow::getMaxQueueSize()
.
Current implementation creates all LVGL screens, widgets and corresponding flow states and variables at startup and keeps them active in memory. This requires a large LVGL memory pool if the amount of screens/widgets grows, even if the screen is only showed once or rarely. Even for simple screens the LVGL memory is considerable.
The same applies to the flow states, but I'm not sure if there is much to be gained here in effort vs. memory usage reduction.
Example use case: Raspberry Pi Pico with 264KBytes of RAM and 2MBytes of FLASH. The flow has 7 screens (of 320x240) with around 100 widgets, 50 native variables and 25 local variables in total. Static memory allocations are now:
I suspect this is a common issue with a lot of MCU's where RAM is limited.
Point of attention: Will the LVGL memory pool implementation keep the fragmentation low to keep functioning properly with a limited pool size?