Beginner’s Guide to Cloning the ESP32 Board: Step-by-Step Instructions for Replicating Your Microcontroller Setup

Cloning an ESP32 or any other microcontroller or embedded device can serve various purposes depending on what you intend to achieve:

  1. Backup: Cloning allows you to create a backup of the current firmware and configuration. This can be useful in case something goes wrong during development or if you want to replicate the same setup across multiple devices.
  2. Development: If you are working on a project that requires multiple ESP32 devices, cloning can help you quickly set up new devices with the same firmware and configuration, saving you time and effort.
  3. Testing: Cloning provides a way to create identical testing environments. This can be helpful when you want to test different scenarios without affecting the original setup.
  4. Customization: Once you have a cloned copy, you can modify its firmware or configuration without affecting the original device. This allows you to experiment and make changes without risking the integrity of the primary setup.
  5. Redundancy: In critical applications, cloned devices can act as a backup in case the primary device fails. This ensures uninterrupted operation and reliability.
  6. Distribution: If you are manufacturing a product based on the ESP32, cloning allows you to replicate the device configuration across multiple units, ensuring consistency in performance and behavior.

When cloning an ESP32 or any microcontroller, it’s essential to understand the licensing agreements and intellectual property rights associated with the firmware and software you are cloning. Always ensure that you have the necessary permissions and rights to clone and modify the device.

This guide provides step-by-step instructions to clone an ESP32 using Windows Operator System. Make sure you follow each step carefully to successfully clone your ESP32 board.

In this guide, we used the Espressif Systems ESP32-WROOM-32D-N8 chip as an example to demonstrate reading and writing to the chips.

**Step 1: Finding Location of esptool.exe**

1. Open the Arduino IDE version 1.8x on your computer.

2. On the right-top corner of the Arduino IDE, click ‘File’ open the pop-up ‘Prefenrences’

Ensure the ‘compilation’ and ‘upload’ checkboxes are selected, and add the following URLs:

3. Go to `Tools` > `Board` and select `ESP32 Dev Module`.

4. Without connecting the ESP32 board to the computer, click on the upload arrow in the Arduino IDE.

5. An error will appear since the ESP32 board isn’t connected. However, the path to the esptool.exe file will be displayed in the output.

6. Locate the `esptool.exe` file path, usually found at: `C:\Users\dream\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\4.2.1\esptool.exe’.

7. Copy this path to the Clipboard by pressing `CTRL+C`.

` cd./Users/dream/AppData/Local/Arduino15/packages/esp32/tools/esptool_py/4.2.1/ `.

**Step 2: Finding Flash Size of ESP Chip**

1. Search for `Command Prompt` on the Windows Search bar and open it.

2. Type `cd..` repeatedly until you reach the root `C:\>`.

3. Paste the copied path from Step 1 by pressing `CTRL+V` and press `Enter`.

4. Type the following command and press `Enter`:


   esptool.exe –chip esp32 –port COM3 –baud 921600 flash_id


5. This will display the chip information, including the flash memory size.

**Step 3: Reading the Firmware bin File**

1. Connect the ESP32 board to your computer.

2. Copy the following command and paste it into the Command Prompt, then press `Enter`:


   esptool.exe –chip esp32 –port COM3 –baud 921600 read_flash 0 0x800000 plantmateII_v16.bin

   “` 3. Wait for about a minute as it reads the ESP32 flash memory. The firmware will be saved as `plantmateII_v16.bin` in the same folder as esptool.exe.

**Step 4: Flashing the Firmware bin File**

1. Disconnect the original ESP32 board and connect the ESP32 you want to clone to.

2. Copy the following command and paste it into the Command Prompt, then press `Enter`:


   esptool.exe –chip esp32 –port COM3 –baud 921600 –before default_reset –after hard_reset write_flash -z –flash_mode dio –flash_freq 80m –flash_size 8MB 0 C:\Users\dream\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\4.2.1\plantmateII_v16.bin


3. Wait for about a minute as it writes the firmware bin file to the new ESP32 board.

***  The End  ***

Leave a Reply

Your email address will not be published. Required fields are marked *