We are using LVGL with our ESP32-S3 (32MB flash memory). Since we have some large graphics and fonts (especially Chinese characters), we started storing the raw c-arrays of the images and fonts in fixed address spaces in the ESP32’s flash memory. Reason for not having the images/fonts compiled into the firmware is to keep the firmware.bin small to allow over-the-air updates and avoid storing those resources twice.
MCU: ESP32-S3-WROOM2-N32R8V (32MB flash memory)
LVGL Version: 8.3.6
Framework: Arduino (with TFT_eSPI)
Issue Description
When trying to access the image data at the respective memory address, the image area on the screen simply stays empty.
What did we try so far?
In the .c image file in /lib/ui/src/images we commented out the data array and saved this data in the EPS32’s memory address 0x1FD8000 instead.
The ui_img_myimage_160x160_png.data we replaced the reference to the data array into a pointer to the memory address (const uint8_t*)0x1FD8000.
How can we have LVGL load image data directly from a memory address?
We are not trying to have images stored as png or jpg files on SD-Cards (we saw a lot of documentation on this already). As we have the c-arrays stored in defined memory addresses, we would like to “simply” access them from there.
Thanks for your feedback! It brought us a step nearer, but seems to get more complex now.
Issue
The ESP32 crashes when trying to access the image data from flash. The image data is stored in memory address 0x016B6000 with a size of 76,800 bytes.
The log output of the ESP32 shows that the exception occurred when trying to access address 0x016B6002.
Guru Meditation Error: Core 1 panic’ed (LoadProhibited). Exception was unhandled.
What we try to achieve
We would like to have the ESP32 accessing the images raw data from flash memory.
Is there anything we oversee or need to tell LVGL to properly access flash memory to obtain the image data? Are there any configurations we missed?
Im not expert , but my tip you miss in idea your flash is memory mapped and accesible. In my idea bootloader ESP map only partitions in table and map it to code and data segments. Then for access any data outside this partitions your require add mappping. But this is non standart use.
Standart is partition flash and create filesystem for your data. Then simply use files in code …