I have sketch for the ESP32 which has the line #define EEPROM_SIZE 2 and later reads (or writes) one or two digit integers into EEPROM.read(0) - EEPROM.read(4). It seems to work fine. But if I change #define EEPROM_SIZE to, say 10, the sketch crashes after uploading. Two things are confusing me here:
If the #define EEPROM_SIZE 2 means 2 bytes, how come I can write 5 integers into the vitual EEPROM?
Why does the sketch only work with #define EEPROM_SIZE 2
There have been several changes to EEPROM.h to accomodate the move away from reserved memory space for eeprom emulation. What version of the Arduino core for the ESP32 are you using. What version of EEPROM.h is is using?
My guess is that for small values of size, the library may be assigning more space.
Post a minimal example of code which compiles and demonstrates what you see with EEPROM.h and your being able to write more than size.
Are you convinced that the values are indeed stored after a power cycle?
Thanks for taking the time with my problem. Unfortunately it would take me more time than I have at the moment to reduce the code as you requested. However I can say that the error I receive when the eeprom size is not 2 is "Guru Meditation Error: Core 1 panic'ed (LoadStoreError). Exception was unhandled."