ESPHome-Flasher vs Browser Based Flasher

Using the Arduino IDE & picking Sketch → Export Compiled Binary creates a set of .bin files in a folder like:

.../Arduino/the_sketch
├── build
│   └── esp32.esp32.the_esp32_board
│       ├── the_sketch.ino.bin
│       ├── the_sketch.ino.bootloader.bin
│       ├── the_sketch.ino.elf
│       ├── the_sketch.ino.map
│       ├── the_sketch.ino.merged.bin
│       └── the_sketch.ino.partitions.bin
└── the_sketch.ino

I would distribute the the_sketch.ino.bin file and direct people to download and use the ESPHome-Flasher (GitHub - esphome/esphome-flasher: Simple GUI tool to flash ESPs over USB) app to flash that binary to the device. Worked like a charm.

With that tool deprecated in favour of browser based flashers, I was looking to update the instructions to use the newer method. I’ve tried a number of these: ESP Tool; ESPWebTool; ESPHome with the same the_sketch.ino.bin file.

While they all download the file to the device (even after making adjustments to the base address in the tools that allow that), the device fails to execute the code. Note that I erase the device flash before downloading the .bin file.

Now if I instead use the_sketch.ino.merged.bin at a base address of 0x0000 the browser-based flashers all work.

Since ESPHome-Flasher and the web based flashers all use esptool behind the scenes, the somewhat academic question is, what does the original ESPHome-Flasher do that allows it to properly flash the device with the much smaller the_sketch.ino.bin file?

Note: this came about in part because the the_sketch.ino.bin file is about 280 KB, while the merged file, the_sketch.ino.merged.bin is the size of the device flash — 4MB in this case. But if the target has 32MB flash, which creates a 32MB .._merged.bin file, it limits the methods used to distribute it.