Hello,
I try to develop a software for a keypad control.
My problem is that sometimes my software has so many bugs, that i want to erase the chip completely.
Even though i load a new version, data on the eeprom still stay there.
I am looking for a simple piece of code, that i can insert it as a file in the project, and when i press # and * the software will jump at that file, erase completely the whole eeprom and return.
From there, i will reload the software again and start a new version.
Just to load the EEprom.
On the h file a declared # as 200 and * as 201.
Please help.
Thank you very much in advance.
Hi.
To erase the ESP32, you can use esptool: see this post: https://rntlab.com/question/how-perform-reset-factory-esp32/
However, if you want a code to erase EEPROM, you can use the following:
for (int i = 0; i < 512; i++) {
EEPROM.write(i, 0);
}
EEPROM.commit();
delay(500);
It goes through all EEPROM positions and writes a zero in all of them.
I hope this helps.
Regards,
Sara