I have tested SPIFFS to write the a char array[2048] to flash. If i am correct, i understand that the flash has 4096 byte sectors that must be written to. This means i will need to write +- 75 sectors to save my 5 large arrays.
The way i think i should do this is as follows:
// open file for writing
File f = SPIFFS.open("/f.txt", "w");
if (!f) {
Serial.println("file open failed");
}
Serial.println("====== Writing to SPIFFS file =========");
// write 10 strings to file
for (int i=1; i<=2048; i++){
f.println(sensor_byte);
}
My Question/Confusion
How do i write the large array to the file? Do I need to manage writing the data at 4096 byte chunks? Should I loop 75 times and append the file? I fail to write 4096 bytes as the esp wdt forces a reset. I am not sure if this is because of the serial display.