HI there. I would like to write relatively large amounts of data(100kb) to the esp32 internal flash . I have successfully hardcoded this data using:
byte dat[] PROGMEM = {1,2,3,4};
But i now want to be able write to flash after compilation so i believe that I must use the EEPROM library. The problem im having is that i am unable to use the full amount of flash because it seems that the maximum EEPROM size is 512bytes. How can I utilise the full amount of flash without having to hardcode the data? many thanks!
gonadgranny:
Hi, ive looked into SPIFFS but its a lot more extensive than i need. i also want to be able to read in and out like an array.
While Flash memory allows random reads they do not allow random erase. This is necessary for writing to it more than once. Flash memories are arranged in blocks for erase, which means only whole blocks can be erased. The size depends on the physical implementation. For some it is the entire memory.
So, random writes to an array in flash is not as easy as one would assume.
You could look into external memories. There are many different technologies and sizes available.
Idahowalker:
An ESP32 Wrover with its PSRAM would suit the bill of being addressed like an array. Under the Arduino IDE 4MB of PSRAM is accessible.
Kind of curious, does Arduino enable the SPIRAM_2T_MODE on 8MB SPIRAM modules?
OP, depending on the nature of your data, you could possibly generate the large array with a python script and save that entire array into a .h file to include in your arduino IDE if you don't want to use the SPIFFS.