Is it possible to extract a backup of the sketch uploaded to a NodeMCU (as I know that it is possible to backup the firmware).
If so, using which tools?
asked Jul 18, 2019 at 21:30
-
1is your goal just to have a backup of the hexcode, or actually de-compile it back into C/C++?Chad G– Chad G2019年07月18日 22:43:21 +00:00Commented Jul 18, 2019 at 22:43
-
esptool is THE tool for esp8266Juraj– Juraj ♦2019年07月19日 04:50:11 +00:00Commented Jul 19, 2019 at 4:50
1 Answer 1
esptool.py is 'avrdude' for the esp8266. it can read the flash too. but you must know the addresses. tha first copy of the application always start at address 0x1000. the length of the application area depends on the size of the flash and the size of the SPIFFS.
> esptool.py read_flash -h
usage: esptool read_flash [-h] [--spi-connection SPI_CONNECTION]
[--no-progress]
address size filename
positional arguments:
address Start address
size Size of region to dump
filename Name of binary dump
optional arguments:
-h, --help show this help message and exit
--spi-connection SPI_CONNECTION, -sc SPI_CONNECTION
ESP32-only argument. Override default SPI Flash
connection. Value can be SPI, HSPI or a comma-
separated list of 5 I/O numbers to use for SPI flash
(CLK,Q,D,HD,CS).
--no-progress, -p Suppress progress output
answered Jul 19, 2019 at 5:19
-
i was under the impression that the same tool that i use to flash (firmware) would be the one to get this job done. tks 4 confirming and indicating which options to use and how to use them. UPVOTED, ACCEPTED. :)tony gil– tony gil2019年07月19日 08:50:55 +00:00Commented Jul 19, 2019 at 8:50