Flash Download Tool for Mass Production

When a product moves from development to mass production, you need a reliable way to flash the same firmware image to many devices. Espressif provides the Flash Download Tool for Windows. It supports Develop and Factory work modes and can flash multiple devices in parallel on a production line.

For tool details, see the Flash Download Tool User Guide.


Overview

The Flash Download Tool is Espressif's official GUI for writing .bin firmware images to flash. It avoids manual command-line steps during production deployment.

Work Modes

After launching the tool, select the chip type (for example, ESP32-S31) and a work mode:

Work modeUse caseDescription
DevelopR&D, debugging, small-batch flashingUses absolute firmware paths. Flashes one device at a time. Supports multiple .bin files, offset addresses, chip information (Read Efuse, flash ID), and full flash erase.
FactoryMass production and OEM deliveryUses relative firmware paths. The interface is locked by default to reduce operator errors. Supports multi-channel parallel flashing (for example, 1-to-4 or 1-to-8).

In Factory mode, click LockSettings when you need to edit the download path or SPI flash settings.


Hardware Setup

Before batch flashing ESP32-S31 devices, wire the board so it can enter download mode.

Download Interface

ESP32-S31 supports flashing over built-in USB or UART0.

[!NOTE] Recommended for production: use the built-in USB Serial/JTAG interface. This avoids an external USB-to-UART bridge (such as CP2102 or CH340) and simplifies the test fixture.

  • Option A: Built-in USB Serial/JTAG (recommended)
    • Connect GPIO14 (USB_D+) and GPIO13 (USB_D-) to the USB connector or production test board.
    • No external USB-to-UART chip is required. Supports stable transfer at up to 12 Mbps or 480 Mbps depending on the interface used.
  • Option B: UART0
    • Connect GPIO58 (U0TXD) and GPIO59 (U0RXD) to the external USB-to-UART adapter RXD and TXD pins.

Strapping Pins

To enter download mode at power-on, meet these Strapping pin levels:

PinFunctionLevel in download modeFixture design
GPIO61Boot mode controlLow (0)Ground this pin during reset on the production fixture so the chip enters download mode automatically.
GPIO60ROM log controlFloating / weak pull-up (1)Keep the default state. Do not add a strong pull-down.

Production Test Hardware

Espressif provides production flashing and RF test hardware for factory deployment. See the Production Testing Equipment Overview.

ESP-FactoryTB2

UART base board for large-scale production flashing.

  • Provides stable multi-channel USB serial ports and power protection.
  • Bridges the PC host and module test fixtures for high-speed batch flashing.
  • Includes electrical protection and isolation for the host USB port.

Module Test Fixture

Press-fit fixture for Espressif modules.

  • Uses pogo pins to contact module test pads or stamp holes without soldering.
  • For ESP32-S31 modules, use a fixture that exposes power (VDD/GND), UART (TXD/RXD), and control pins (CHIP_PU / GPIO61).

ESP-BAT32

Low-cost RF golden unit for production RF screening.

  • Works as a reference transmitter/receiver for throughput, RSSI, and RF quality checks.
  • Suitable for 100% go/no-go RF screening before shipment when a full RF chamber tester is not required on every line.

Prepare a Merged Firmware Image

During development, ESP-IDF builds separate images such as bootloader.bin, partition-table.bin, ota_data_initial.bin, and the application .bin.

For production, deliver a single merged binary. The operator loads one .bin file at offset 0x0.

Method 1: CombineBin in the Flash Download Tool

  1. Open the tool in Develop mode.
  2. Load all partition .bin files and set the correct flash offsets.
  3. Select the files to merge. Make sure SPI SPEED, SPI MODE, and FLASH SIZE match your hardware.
  4. Click CombineBin.
  5. The tool saves the merged image as ./combine/target.bin.

Method 2: esptool.py merge_bin

Use this in CI/CD pipelines:

esptool.py --chip esp32s31 merge_bin -o factory_merged.bin --flash_mode dio --flash_size 8MB 0x2000 bootloader.bin 0x10000 partition-table.bin 0x12000 ota_data_initial.bin 0x20000 app.bin

Adjust offsets to match your partition table.


Flash in Factory Mode

After you have factory_merged.bin, configure batch flashing as follows.

Step 1: Start Factory Mode

Open flash_download_tool.exe and set:

  1. ChipType: ESP32-S31
  2. WorkMode: Factory

Step 2: Load Firmware and SPI Settings

  1. Firmware path: Select factory_merged.bin.
  2. Download address: 0x0 (checkbox enabled).
  3. SPI flash settings (must match the module):
    • SPI SPEED: 40MHz or 80MHz
    • SPI MODE: DIO or DOUT
    • FLASH SIZE: For example, 8MB or 16MB

[!NOTE] In tool versions >= 3.9.10, SPI SPEED and SPI MODE may be read-only and must match the firmware build configuration.

Step 3: Configure COM Ports

  1. Connect devices through an industrial USB hub if you flash multiple boards in parallel.
  2. Assign a COM port to each channel.
  3. Set the baud rate to 921600 or 1152000 to reduce flashing time.

Factory mode interface

Step 4: Start Flashing

  1. Click START (global or per channel).
  2. Each channel shows DOWNLOADING while flashing.
  3. A successful flash shows PASS; failures show FAIL with an error code.
  4. Insert the next board. The tool can detect port changes or you can click START again.

Lock Factory Settings

To prevent operators from changing flash size, baud rate, or firmware paths on the production line, lock the configuration file:

  1. Open the configure folder in the tool installation directory.

  2. Edit esp32s31/multi_download.conf (or the file for your chip).

  3. Add or update:

    [SECURE]
    lock_setting_password = true
    
  4. Save the file and restart the tool. Path, address, and SPI settings become read-only. Only COM port selection and START / STOP remain editable.


Troubleshooting

SYNC fail / Waiting for packet header

The chip did not enter download mode.

  • Verify GPIO61 is low at power-on.
  • Check UART TX/RXD or USB D+/D- wiring.
  • Ensure 3.3 V supply can provide at least 600 mA during flashing.

MD5 check fail

Read-back verification failed. This is often caused by noise on long cables or a damaged flash device.

  • Lower the baud rate (for example, from 1152000 to 921600).
  • Shorten cables between the fixture and the module.

Production Best Practices

  • Use pogo-pin fixtures instead of hand-soldered cables on the production line.
  • Use a powered industrial USB hub for multi-channel flashing.
  • Enable auto-start on port connect so operators do not need to click START for every board.