ESP32 Flash error: Failed to communicate with the flash chip

brianpdx
Posts: 13
Joined: Fri Jan 29, 2021 6:07 am

ESP32 Flash error: Failed to communicate with the flash chip

Postby brianpdx » Tue Jun 10, 2025 7:16 pm

I recently produced two prototype boards at JLCPCB with ESP32-WROVER-E modules attached to an FTDI FT2232HL UART chip. I'm currently unable to flash firmware onto either board and the idf.py software tells me:

Code: Select all

Connecting....
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 04:83:08:a9:29:48
Uploading stub...
Running stub...
Stub running...
WARNING: Failed to communicate with the flash chip, read/write operations will fail. Try checking the chip connections or removing any other hardware connected to IOs.

As you can see, the UART chip is communicating with the ESP32, and I receive serial console messages from both chips like:

Code: Select all

rst:0x10 (RTCWDT_RTC_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
invalid header: 0xffffffff
...

This tells me the board is powered correctly and is booting to the expected initial unflashed-firmware state.

Every resource I've found online suggests that the flash operation not being able to communicate with the flash chip indicates a hardware error. I've followed the schematics for reference designs and even used my footprint and this configuration previously on other boards with no problems.

The suggestion that it's a hardware error with the ESP32 seems unrealistic given it's happening on two separate boards, so I think it must be something I've done wrong, but I'm at a loss to figure out what it might be.

I'm attaching schematics for my board. I've verified the ESP32 is soldered correctly and my footprint has all the correct paste, mask, and connections for the heat transfer/gnd pad on the bottom of the chip so I don't think it's a connection issue (again since UART and power work I think the chip is soldered to the board correctly).

Thanks in advance for any insight you might be able to provide!

ESP32 Schematic:

Image

ESP32 Auto Program Schematic:

Image

FTDI FT2232HL Schematic:

Image

USB-C Connector Schematic:

Image

Sprite
Espressif staff
Espressif staff
Posts: 10599
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 Flash error: Failed to communicate with the flash chip

Postby Sprite » Wed Jun 11, 2025 9:18 am

Okay, that ESP32-WROVER-E-N4R8 should have onboard flash so that is not the issue. GPIO12 is a bootstrap pin that sets the flash voltage; can you try severing that from the FTDI-chip and seeing if that fixes the issue?

brianpdx
Posts: 13
Joined: Fri Jan 29, 2021 6:07 am

Re: ESP32 Flash error: Failed to communicate with the flash chip

Postby brianpdx » Wed Jun 11, 2025 8:39 pm

I cut all the connections to IO12, IO13, IO14, and IO15 (TDI, TCK, TMS, TDO) and verified discontinuity, so they're effectively floating other than how they are connected internally in the WROVER module.

The boot:0x17 message in the console indicates IO12 was low during boot and there isn't anything that can drive it high now, yet the problem persists. The flash operation still fails to detect the flash chip.

brianpdx
Posts: 13
Joined: Fri Jan 29, 2021 6:07 am

Re: ESP32 Flash error: Failed to communicate with the flash chip

Postby brianpdx » Wed Jun 11, 2025 8:54 pm

Here is the output of a few other commands for reference:

Code: Select all

$ python -m esptool --chip esp32 -p /dev/cu.usbserial-1101 flash_id
esptool.py v4.8.1
Serial port /dev/cu.usbserial-1101
Connecting....
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 04:83:08:a9:29:48
Uploading stub...
Running stub...
Stub running...
WARNING: Failed to communicate with the flash chip, read/write operations will fail. Try checking the chip connections or removing any other hardware connected to IOs.
Manufacturer: 00
Device: 0000
Detected flash size: Unknown
Flash voltage set by a strapping pin to 3.3V
Hard resetting via RTS pin...

trying to read 64KB from the flash acts like it works, but I don't know if it's actually reading anything:

Code: Select all

python -m esptool --chip esp32 --port /dev/cu.usbserial-1101 --baud 115200 read_flash --flash_size 4MB 0 65536 flash_read_output.bin
esptool.py v4.8.1
Serial port /dev/cu.usbserial-1101
Connecting....
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 04:83:08:a9:29:48
Uploading stub...
Running stub...
Stub running...
WARNING: Failed to communicate with the flash chip, read/write operations will fail. Try checking the chip connections or removing any other hardware connected to IOs.
Configuring flash size...
65536 (100 %)
65536 (100 %)
Read 65536 bytes at 0x00000000 in 6.1 seconds (85.3 kbit/s)...
Hard resetting via RTS pin...

Code: Select all

$ xxd -l 128 flash_read_output.bin
00000000: 1000 2000 0000 0000 0000 0000 0000 0000  .. .............
00000010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000030: 0000 0080 0000 0000 0000 0000 0000 0000  ................
00000040: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000050: 0000 0000 0000 0000 0000 0800 0000 0000  ................
00000060: 0000 0020 0000 0000 0000 0000 0400 0000  ... ............
00000070: 0000 0000 0000 0000 0000 0000 0000 0000  ................

Sprite
Espressif staff
Espressif staff
Posts: 10599
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 Flash error: Failed to communicate with the flash chip

Postby Sprite » Thu Jun 12, 2025 9:33 am

It's weird... as far as I can see, that module does not have any external pins that can mess with psram or flash. Sorry, I have no clue what else could cause that. Maybe your 3.3V is doing weird things, where are you generating that?

yangolan
Posts: 4
Joined: Wed Sep 17, 2025 7:49 am

Re: ESP32 Flash error: Failed to communicate with the flash chip

Postby yangolan » Wed Sep 17, 2025 1:03 pm

did the invalid header error happen immediately after trying to program the esp or after some time the esp has been working?

Who is online

Users browsing this forum: Google [Bot], Semrush [Bot] and 3 guests