How to build single flashable binary for ESP32 with

Build of ESP-IDF project produces several files, like bootloader, application binary or partition table.

Having several files makes it harder to ship the application outside of build computer.

Solution to the problem is merging binaries into single flashable file.

Build your project with as always:

cd project build

Merge binaries into single file. At the end of build process the tool will display command for flashing. This can be used to compose command like this: --chip ESP32 merge_bin -o merged-flash.bin --flash_mode dio ^
  --flash_size ^
  2MB 0x0 build\bootloader\bootloader.bin ^
  0x8000 build\partition_table\partition-table.bin ^
  0x10000 build\my_app.bin

Luckily there is a simpler way, because all those arguments are stored in build/flash_args file:

Example for Bash

(cd build; --chip esp32 merge_bin -o merged-flash.bin @flash_args)

Example for PowerShell

cd build --chip esp32 merge_bin -o merged-flash.bin "@flash_args"
No votes yet.
Please wait...

2. May 2023 at 11:50 - Development (Tags: , , , ). Both comments and pings are currently closed.

Comments are closed.