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.
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.
esptool.py --chip esp32s3 --port /dev/ttyACM0 erase_flash
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
Change (X) to whatever COM port is being used by the board
esptool.exe --chip esp32s3 --port COM(X) erase_flash
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