ESP32 is a microcontroller chip that has integrated Wi-Fi and Bluetooth functionality. If your ESP32 chip already has a program and you want to upload a new one, you need to erase its memory. This article shows how to erase Flash Memory on ESP32 Card on PC using Terminal or CMD.
How to erase Flash Memory on ESP32 Card on PC
To erase the Flash Memory on an ESP32 using a CMD or Terminal window, your system should have the latest version of Python. If Python is not installed on your system, install it and proceed with the following instructions. You can download Python from its official website or install it directly from Microsoft Store.
After installing Python, note down its version number. Now, follow the instructions provided below:
- Install the ESP tool
- Erase the ESP32 Flash Memory
Let’s start.
1] Install the ESP tool
To erase the ESP32 Flash Memory, you first need to install the ESP tool on your computer. Open the Windows Terminal or Command Prompt and type the following command. After that, hit Enter.
py -3.13 -m pip install esptool
In the above command, 3.13 indicates the version number of Python. Replace the Python version number accordingly.
Now, connect the ESP32 chip to your system, and press and hold the Boot button on the ESP32 chip. After that, copy the following command, paste it into the Command Prompt window, and press Enter.
py -3.13 -m esptool --chip ESP32 --<port number> erase_flash
In the above command, type the correct port number. You can view the port number in the Arduino app. Open the Arduino app and go to Tools > Port. Let’s say, the port is COM3, the command will be:
py -3.13 -m esptool --chip ESP32 --port COM3 erase_flash
The above command will take some time to erase the Flash Memory of the ESP32 chip. Do not release the Boot button on the ESP32 chip until the command executes successfully.
That’s it. I hope this helps.
How to erase a program from ESP32?
You can erase a program from ESP32 through the Command Prompt. First, install Python on your system and connect the ESP32 chip to your computer. Now, execute the required commands to erase the program from the ESP32 memory.
How many times can ESP32 be flashed?
There is no fixed data about the total number of erase cycles of the ESP32 chip. However, the typical number for this can be between 10000 to 100000 cycles. The write/erase cycles of the ESP32 chip also depend on several factors, such as temperature, usage conditions, etc.
Read next: How to install PL2303 (Prolific) driver on Windows.