It is one of the most misleading faults in embedded work. You flash your ESP32, esptool reports the write succeeded and the hash verified, you reset the board, and the application never runs. The ROM bootloader prints something like this instead:

invalid header: 0x8e465484 

Most people respond the same way: reflash, swap the USB cable, change the port, reflash again. I know, because I did all of that too, on three ESP32 DevKit V1 boards from a single purchase batch that all behaved exactly this way. What finally moved the investigation forward was not another reflash. It was accepting one uncomfortable idea and testing the boot chain in order.

Flashing and booting are different paths

Here is the core idea the whole method hangs on. Flashing exercises the ROM downloader path: host-driven, host-paced, host-checked. Booting exercises the ROM's own read of the same flash, under boot parameters, with no host involved. The two paths share silicon and pins and almost nothing else that matters. A fault can live in exactly one of them.

So "it flashed and verified" tells you the downloader path works. It tells you nothing about the boot path. In my three boards, one path was flawless and the other was broken on every unit.

The boot chain you are always testing, whether you say so or not:

Power / Reset → ROM Bootloader → SPI Flash Read → Image Header Parse → Application Startup 

Your job is to find which arrow fails, and to prove it.

Step 1: Capture the symptom exactly, before changing anything

Record the exact ROM output at reset. "It still fails" is not an observation. "Fails with invalid header: 0x8e465484" is an observation.

In the case study, the header values never repeated across resets: 0x3ffea272, 0xd610e111, 0x8e465484, 0x5691acba. That turned out to be the single most valuable clue in the investigation. A valid image header starts with magic byte 0xE9. Fixed corruption returns the same wrong value every time. Non-repeating wrong values point at the transfer, not the content.

Step 2: Verify each subsystem independently

Cheapest and most discriminating tests first. USB enumeration, power indication, UART communication, download mode entry, flash identification:

esptool flash-id 

Each subsystem you close is a fault domain eliminated. On my boards all of these passed, which felt like bad news and was actually progress: the elimination list is what makes the final conclusion defensible.

Step 3: Never trust a write. Read back and validate.

Dump the flash and validate the dump:

esptool read-flash 0 0x400000 flash_dump.bin esptool image-info flash_dump.bin 

If the checksum is valid and the validation hash is valid, the stored image is structurally sound, and you can stop suspecting your build, your partition table, and your flashing process in one move.

Step 4: Audit the security state early

espefuse summary 

Do this before anything writes to the device, because eFuse state cannot be captured retroactively once it changes. On unfamiliar or suspect boards, the security state is part of the board's identity.

My boards were not factory virgin: FLASH_CRYPT_CNT = 1, FLASH_CRYPT_CONFIG = 15, RD_DIS = 1, download decrypt disabled, JTAG disabled. A standard erase refused to run, reporting active security features. A forced erase completed:

esptool erase-flash # refused on these boards esptool erase-flash --force # completed 

The security state and the erase behaviour corroborated each other. That is a free probe, and it reframed the whole investigation.

Step 5: Change one variable at a time, and record every result

With the stored image proven valid, I swept SPI mode and clock individually and logged the symptom after each change:

Configuration Observed header at boot
DIO at 80 MHz 0xd610e111
DIO at 40 MHz 0x8e465484
DOUT at 40 MHz 0x5691acba

The stored data was constant. The header, still invalid, changed with interface settings. The corruption is introduced in the boot-time transfer, not present in the stored content. That one table moved the fault out of the content domain and into the interface domain.

Changing two settings at once would have destroyed that signal. Change one variable, record, repeat.

Step 6: Replicate across units before concluding anything

One failing board supports "this board is defective." Three boards from one batch failing identically supports "this batch has a property." The experiments worth running are different in those two worlds, and so is the disposition. Unit-level defect means component isolation on one board. Batch-level property means quarantine and a fault domain report.

Step 7: Stop at the boundary your instruments can defend

Nine of my ten test groups passed. The only failing behaviour was application execution. The conclusion the evidence supports is a bounded fault domain:

ROM Bootloader → SPI Flash Interface → Flash Security / Configuration → Application Startup 

The next discriminating steps need a logic analyzer on the SPI bus and a known-good control board, neither of which I had. So the investigation closed with a fault domain, high confidence in the domain, and the next experiments defined. Not a best guess dressed as a root cause. An investigation that claims one step more than its evidence teaches everyone to discount all of its steps.

The decision flow, condensed

Work these in order. The first four cost minutes and close most real-world cases.

  1. ROM output on serial? No: power, USB, UART path. Yes: continue.
  2. Download mode reachable? You want boot:0x3 (DOWNLOAD_BOOT) and "waiting for download". No: strapping or GPIO0 fault. Yes: continue.
  3. Flash ID sane? No: flash device or SPI wiring. Yes: continue.
  4. Readback image valid? No: write-path fault. Yes: continue.
  5. eFuse state normal for a new board? Abnormal: you are in the configuration domain. Normal: continue.
  6. Does an SPI sweep change the symptom? Changes: interface domain. Constant: re-examine your content and configuration.
  7. Does it replicate on other units? Yes: batch property. No: unit defect.

One more thing: when the security state is the fault

There is a related case worth knowing about. If your eFuse summary shows flash encryption already enabled (for example FLASH_CRYPT_CNT = 1) and the images you are flashing were built and written as plaintext, the board can show this exact symptom while every host diagnostic passes. In one documented case, a board like this was recovered by writing its boot chain in encrypted form to match its recorded security state, with no eFuses written by the procedure itself. It went from a validation score of 15 out of 100 to 100 out of 100, with all firmware tests passing.

The honest limit: that is a single board result, not a general fix. If your eFuse state does not show encryption enabled, that procedure does not apply to you, and the method above is how you find out where your fault actually lives.

Get the checklist free

I turned the ordered checklist from this investigation into a free download, the same one I now run on any new board from first power-on to application execution:

ESP32 Bring-Up Checklist, free on Gumroad

If you want the full method with the complete case study, the command reference, the fault investigation and test log templates, and the recovery chapter, that is the ESP32 Bring-Up and Boot Failure Debugging Pack ($15). And if you would rather automate the whole validation run, the ESP32 Automated Validation Framework is the Python host runner and test firmware I built to do it repeatably.

The investigation itself, including the evidence package and the final fault domain analysis, is public on my GitHub: esp32-boot-failure-investigation.

If you have fought this fault before, I would like to hear where yours turned out to live.