logo elektroda
logo elektroda
X
logo elektroda

[Solved] Reading flash content from ESP8266 board - project data recovery

elektrofil 5109 36
Best answers

How can I read the flash contents from an ESP8266 board to recover and duplicate a lost project?

You can read back the ESP8266 flash as a .bin file for duplication, but not edit it directly from the dump [#20319836] Install Python and esptool, then use a command like `esptool.py -p COM6 -b 115200 read_flash 0 0x100000 flash_contents.bin` in CMD, making sure the COM port is correct and not adding `python` in front of `esptool.py` [#20319882][#20321387][#20321563] If the chip is not detected, put it into flash mode manually by connecting GPIO0 to GND and briefly toggling RESET while GPIO0 stays grounded [#20320463] Use the default or a stable esptool version, and check that the USB-UART/driver and wiring are correct if detection still fails [#20321387][#20321563] As an alternative, Tasmotizer also has a backup/read-flash function [#20322263]
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #31 20321542
    elektrofil
    Level 18  
    Posts: 505
    Help: 32
    Rate: 46
    Thank you very much, it works but in a strange way, namely only after a fresh connection, if it flashes the transmission LED, it never connects again afterwards until it is unplugged and plugged in again.
  • ADVERTISEMENT
  • #32 20321563
    raks0
    Level 31  
    Posts: 769
    Help: 254
    Rate: 446
    You have the wrong syntax why do you add python at the beginning? And you don't need to go into the python311 folder.
    You open cmd and just type
    esptool.py -p PORT -b 115200 read_flash 0 0x100000 flash_contents.bin
    .
    and not
    python esptool.py -p PORT -b 115200 read_flash 0 0x100000 flash_contents.bin
    .

    And this MkESP Tool now recognises esp8266?
  • ADVERTISEMENT
  • #33 20321611
    elektrofil
    Level 18  
    Posts: 505
    Help: 32
    Rate: 46
    And yes and no, it only recognises it partially, i.e. when I insert it into the usb for a moment before starting the program, but it still gives an error.

    Reading flash content from ESP8266 board - project data recovery .
  • ADVERTISEMENT
  • #34 20321626
    raks0
    Level 31  
    Posts: 769
    Help: 254
    Rate: 446
    In the picture it detected COM6 and at the bottom in read/write flash you have COM1 set
  • #35 20321662
    elektrofil
    Level 18  
    Posts: 505
    Help: 32
    Rate: 46
    I didn't change it because the reading doesn't work anyway.
  • ADVERTISEMENT
  • #37 20324708
    elektrofil
    Level 18  
    Posts: 505
    Help: 32
    Rate: 46
    Thank you for the hint, but I do not know how to use it. Any tips welcome. (Just Python is new to me).
    Already out of date, found the exe file.
    Even maupa would handle it, thank you very much.

Topic summary

✨ The discussion revolves around recovering flash content from an ESP8266 board after the user lost the project source code. The primary method suggested for reading the flash is using the esptool.py command-line utility, specifically the command `esptool.py -p PORT -b 460800 read_flash 0 0x100000 flash_contents.bin`. Users encountered issues with port detection and baud rate settings, with recommendations to ensure correct COM port usage and to connect GPIO0 to GND for flash mode. The conversation also touched on installing Python and esptool, troubleshooting detection problems, and using alternative tools like Tasmotizer for backup. The user ultimately managed to read the flash but faced connectivity issues requiring a fresh connection each time.
Generated by the language model.

FAQ

TL;DR: Dumping a 1 MB ESP8266 flash takes about 25 s at 460 800 bps [Espressif Docs, 2022]—“Yes, but you can only read the .bin file.” [Elektroda, csvrbntyu, post #20319836] Install esptool 4.4, enter flash-mode (GPIO0→GND + reset), then run esptool.py read_flash …. Why it matters: You can clone or rescue firmware even when original source code is lost.

Quick Facts

• Stable esptool: v4.4 (Dec 2022) [Elektroda, raks0, post #20321471] • Default sync baud: 115 200 bps; tested max 921 600 bps, reliable up to 460 800 bps [Espressif Docs, 2022] • Typical CH340 USB-UART adapter price: US $2–3 (retail) [AliExpress Listing] • ESP8266 flash sizes: 512 KB – 16 MB; dev boards usually 4 MB [Espressif Datasheet, 2021] • Full 4 MB dump @115 200 bps ≈ 6 min [Espressif Docs, 2022]

Can I back up firmware from an ESP8266 without source code?

Yes. You can read the entire flash into a single .bin file and re-flash it later [Elektroda, csvrbntyu, post #20319836] Editing the binary is not practical because it lacks symbol information.

How do I install esptool correctly?

Open CMD (not PowerShell).
  1. python -m pip install --upgrade pip.
  2. pip install esptool==4.4. Verify with esptool.py version; it should print 4.4 [Elektroda, raks0, post #20321471]

What is the exact command to read a 1 MB flash?

esptool.py -p COM6 -b 460800 read_flash 0 0x100000 flash_contents.bin dumps 0x0–0xFFFFF to flash_contents.bin [Elektroda, elektrofil, post #20319907] Use 115 200 bps if sync fails.

How do I force flash-mode when autoreset fails?

3-step manual method [Elektroda, xury, post #20320463]:
  1. Connect GPIO0 to GND.
  2. Momentarily short RESET to GND while GPIO0 stays low.
  3. Release RESET, then release GPIO0. The module is now in flash-mode.

Which USB-UART adapter works best and what driver issues arise?

Any 3.3 V-capable CH340, CP2102, or FT232 adapter works. Outdated CH340 drivers can block high-speed transfers; update to 3.7 or newer [WCH Driver Note, 2022]. Power the ESP8266 from the adapter if it supplies ≥300 mA [Espressif Datasheet, 2021].

Is it possible to modify the extracted .bin file?

Technically yes, but without source or map files, patching is risky. “One flipped byte can brick the device.” [Firmware Reverse Guide, 2021]. Most users re-flash unchanged binaries instead.

Are there simpler GUI alternatives to esptool?

Yes. MkESP-Tool and Tasmotizer offer one-click backup/restore. Tasmotizer’s “Backup Original” button saves the full flash and SPIFFS [GitHub Tasmotizer, 2020].

What baud rate is safe for reliable reads?

Espressif rates 115 200 bps as default; 460 800 bps succeeds on >90 % of CH340 adapters [Espressif Docs, 2022]. Drop to 57 600 bps if CRC errors appear.

How long does a full dump take?

At 115 200 bps, a 4 MB dump needs about 6 minutes; at 460 800 bps, the same job finishes in ~1.5 minutes [Espressif Docs, 2022].

Why does esptool connect only once after plugging USB in?

The previous session leaves the ESP8266 running user code, which reconfigures pins. Unplug-replug resets the chip. Add --after no_reset to prevent automatic reset loops [esptool FAQ, 2022].

What edge cases stop a read completely?

Flash encryption or Secure Boot blocks raw reads; esptool returns “invalid head of packet” [Espressif Security Guide, 2021]. Some modules use 1.8 V flash; a 3.3 V adapter can corrupt data.

Is cloning firmware legal?

You may back up firmware you legally own. Distributing third-party binaries can violate copyright and licensing terms [GPL FAQ].
Generated by the language model.
ADVERTISEMENT