ESP Chip Cannot Be Flashed Anymore

Hello dear community,

I am currently facing an issue with an ESP32 Developer Board and two Sonoff Basic modules. Some time ago, these were flashed with ESPHome via Home Assistant. Unfortunately, they disappeared from Home Assistant and were neither listed among the devices nor in the add-on sidebar.

After some updates and backups, the devices reappeared. Unfortunately, I did not note down the encryption code. I was able to find the YAML files for two devices in the File Editor under the ESP folder and copy the code. These are now back in Home Assistant, but unfortunately not in the add-on where you can edit the YAML files, but only under devices.

Now, I wanted to simply reflash the devices and proceeded as follows:

  1. I created a new device in Home Assistant.
  2. I opened the ESP web page.
  3. I connected an FTDI adapter to the Sonoff or ESP Developer Board via USB to my laptop.
  4. An audible signal was played, but an error message also appeared: “This device has been stopped because it has reported errors. (Code 43) Error with a request of the USB device descriptor.”
  5. Consequently, the devices were also not found under “Connect.”

Does anyone have any advice on how I can reflash and correctly use my devices?

I would be very grateful for any help.

Best regards, Josch

Most probably need to connect GPIO00 to ground while connecting USB to laptop and powering the board.

This error used to appear when there’s something wrong with USB uart adapter (or usb chip). Either wrong drivers, bad connection (damaged cable, damaged usb connector…) or, some time ago these errors also appeared when Chinese fake USB chips were connected to windows and consequently driver was disabled. Ok, bad USB chip is also an option, although not likely.
Try to remove/reinstall usb driver, or use another computer (if you have one). If you have another usb uart device also try with that one (note that’s very advisable to have more than 1 usb - uart adapter anyway).

“Esp32 Developer board” is really vague and knowing which one out of the dozens of developer boards would be useful as they dont all use the same procedure to enter boot mode.

Problems like this, just start doing a process of elimination.

  1. Test flashing a new board to see if its your esp32 itself or something ellse.

  2. Make sure you’re using a data USB cord and not a power only USB.

  3. Go to Google and search for “your specific dev board + boot mode”. Find the boot mode instructions for your specific dev board and not vague “Esp32 dev board”


You could try flashing it with the old esphome-flasher from a .bin file. Download from github.

Hey folks,

after experiencing difficulties flashing Sonoff devices or similar, I tried different cables and FTDI adapters, but that didn’t solve the problem. It wasn’t until my wife asked if I had replaced both that I realized both the cable and the FTDI adapter could be damaged. After replacing them, flashing these devices works perfectly again.

Unfortunately, I’m still having trouble flashing the ESP32 DEVKIT V1. Even after attempting to connect it directly to the Home Assistant computer with an FTDI and flash it, I still receive error messages. Here’s an excerpt from the log I received:

INFO ESPHome 2024.4.2
INFO Reading configuration /config/esphome/esp32-devkit-v1.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing esp32-devkit-v1 (board: esp32dev; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Dependency Graph
|-- AsyncTCP-esphome @ 2.1.3
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.1.0
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
RAM:   [=         ]  12.4% (used 40528 bytes from 327680 bytes)
Flash: [====      ]  44.3% (used 812193 bytes from 1835008 bytes)
========================= [SUCCESS] Took 3.24 seconds =========================
INFO Successfully compiled program.
esptool.py v4.7.0
Serial port /dev/ttyUSB1
Connecting......................................
ERROR Running command failed: Failed to connect to ESP32: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
ERROR Please try running esptool.py --before default_reset --after hard_reset --baud 460800 --port /dev/ttyUSB1 --chip esp32 write_flash -z --flash_size detect 0x10000 /data/build/esp32-devkit-v1/.pioenvs/esp32-devkit-v1/firmware.bin 0x1000 /data/build/esp32-devkit-v1/.pioenvs/esp32-devkit-v1/bootloader.bin 0x8000 /data/build/esp32-devkit-v1/.pioenvs/esp32-devkit-v1/partitions.bin 0xe000 /data/cache/platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin locally.
INFO Upload with baud rate 460800 failed. Trying again with baud rate 115200.
esptool.py v4.7.0
Serial port /dev/ttyUSB1
Connecting......................................
ERROR Running command failed: Failed to connect to ESP32: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
ERROR Please try running esptool.py --before default_reset --after hard_reset --baud 115200 --port /dev/ttyUSB1 --chip esp32 write_flash -z --flash_size detect 0x10000 /data/build/esp32-devkit-v1/.pioenvs/esp32-devkit-v1/firmware.bin 0x1000 /data/build/esp32-devkit-v1/.pioenvs/esp32-devkit-v1/bootloader.bin 0x8000 /data/build/esp32-devkit-v1/.pioenvs/esp32-devkit-v1/partitions.bin 0xe000 /data/cache/platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin locally.

Perhaps someone else has experienced similar issues or can glean from the log excerpt what the problem might be. Any advice would be greatly appreciated!

Cheers!

Try swap the Rx and Tx pin of FTDI.
Confirm weather you short the FTDI jumper to 3.3v

And try : https://youtu.be/obl4U9qTFEM?si=ec5ECa_oKv2O0Mqz for erase and try https://youtu.be/1mny3kUSKME?si=jDmBjICbLYhVji3K to write

Enjoy IoT

A little late to the party, but two things to try if your board is still not flashable:

  1. The command and options suggested in the log you posted
  2. Lower your baud rate

I think it is unlikely that you have reached the limit of rewrites for your device’s flash memory, unless you had a write-intensive configuration in place. That would be something to keep in mind for the replacement device.

If you created your own yaml files, change the log level to a ‘production’ level, less intensive and verbose than debug and reduce the number of events that are logged. During development you want to know every time a pin changed, but once you have a stable device, that is usually not of interest anymore.