1. Home
  2. Boards
  3. How do I erase the flash on my board?

How do I erase the flash on my board?

Often you’ll want to erase the flash of your board to get it back to a clean state. This is important to do if you are switching between different development environments, or if you’ve accidentally flashed some firmware into your board using an incorrect flash partition scheme.

Factory Reset

There’s actually no such thing as a factory reset on an ESP32 board. ESP32 ICs & Modules ship with no firmware on them at all, but all UM board ship with either MicroPython or CircuitPython flashed on to them.

So to get a board into what you might call a Factory Reset State on other electronics devices, what you are really wanting to do is just erase the flash.

To erase your flash, you’ll need to have esptool installed, and then issue the command below on your respective operating system, remembering to switch out the esp32s3 with whatever ESP32 chip version you are using, e.g. esp32s3, esp32s2 & esp32.

Linux

esptool.py --chip esp32s3 --port /dev/ttyACM0 erase_flash

Mac

Please do a ls /dev/cu.usbm* to determine the port your board has enumerated as.

esptool.py --chip esp32s3 --port /dev/cu.usbmodem01 erase_flash

Windows

Change (X) to whatever COM port is being used by the board

esptool.exe --chip esp32s3 --port COM(X) erase_flash

Arduino IDE

If you are using the Arduino IDE, you also have the option of having the firmware upload process also erase the flash on your board before uploading.

Keep in mind that if you store required files, or user data in the flash using SPIFFS or FATFS, that will also get removed when the erase process happens.

erase flash, erase_flash, clear flash, wipe flash, factory reset

Updated on February 3, 2024

Related Articles