• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Erase an ESP32 and EEprom

Q&A Forum › Category: ESP32 › Erase an ESP32 and EEprom
0 Vote Up Vote Down
Ion asked 4 years ago

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.
 
 

Question Tags: eeprom, erase, ESP32
1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

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
 

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.