How to fix ESP32 E (81) spi_flash: Detected size(4096k) smaller than the size in the binary image header(8192k). Probe failed.
Problem
Your ESP32 board repeatedly reboots with error messages like
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x2a (SPI_FAST_FLASH_BOOT)
Saved PC:0x40376c68
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x4bc
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a0c
entry 0x403c98d0
E (81) spi_flash: Detected size(4096k) smaller than the size in the binary image header(8192k). Probe failed.
assert failed: do_core_init startup.c:328 (flash_ret == ESP_OK)
Backtrace: 0x4037705a:0x3fceb180 0x4037a395:0x3fceb1a0 0x4037fb8d:0x3fceb1c0 0x4200a3aa:0x3fceb2f0 0x403769cb:0x3fceb320 0x403cd86b:0x3fceb350 0x403cdb2a:0x3fceb380 0x403c9925:0x3fceb4b0 0x40045c01:0x3fceb570 0x40043ab6:0x3fceb6f0 0x40034c45:0x3fceb710
ELF file SHA256: fda71b8413cb6eda
E (111) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0
Rebooting...
Solution
This error occurs because you are trying to flash a binary image built for 8MB
flash size onto a board with 4MB
flash size. The ESP32 board is not able to detect the correct flash size, and therefore it fails to boot.
You need to modify your build configuration to build for a 4MB module, then rebuild & reflash to fix the issue.
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow