Hello there
Description
I’m trying to understand which is the best configuration to open image file from FATFS on ESP32.
By best configuration I mean the fastest.
First question which type of file should I use ? :
*.bin ?
*.png ?
How to configure/calculate the right cache memory for :
- LV_MEM_SIZE
- LV_CACHE_DEF_SIZE
- LV_FS_FATFS_CACHE_SIZE
Furthermore, what is the limit for those cache memory, where are they store (In RAM I suppose) ?
What MCU/Processor/Board and compiler are you using?
Board : Custom ESP32-WROOM-32E-N16 board
IDE : platformIO
Screen : TFT ILI9341 320 x 240
What LVGL version are you using?
LVGL 9.1
What do you want to achieve?
Find the best way to load img from file (.bin, .png, jpeg)
What have you tried so far?
I’m able to load .bin image from fatfs using the bin decoder. But i’m limited to 2 or 3 images regarding their size.
I edited size of the memory (LV_MEM_SIZE) but not enought :
I edited LV_CACHE_DEF_SIZE but no enought :
Code to reproduce
LV_MEM_SIZE in lv_conf.h:
/*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/
#define LV_MEM_SIZE (96 * 1024U) /*[bytes]*/
LV_CACHE_DEF_SIZE in lv_conf.h:
/*Default cache size in bytes.
*Used by image decoders such as `lv_lodepng` to keep the decoded image in the memory.
*If size is not set to 0, the decoder will fail to decode when the cache is full.
*If size is 0, the cache function is not enabled and the decoded mem will be released immediately after use.*/
#define LV_CACHE_DEF_SIZE 0//262144
LV_FS_FATFS_CACHE_SIZE in lv_conf.h :
/*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/
#define LV_USE_FS_FATFS 1
#if LV_USE_FS_FATFS
#define LV_FS_FATFS_LETTER 'A' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_FATFS_CACHE_SIZE 1024 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
I’m looking forward to your suggestions.
Thnaks,
Thomas.