2

I was able to flash a micropython binary which I'd cross compiled some 6 months ago, and it was working fine. It was built from master branch at that point of time, and I did not save the code, nor the binary.

Today, when I again compiled, the binary is having problem at a point. So I want to revert back to the old binary, only problem is I'm not sure what commitID/build the master was at at that point of time ~6 months ago when my compiled binary which works fine was created.

I do have an ESP which has that binary flashed into it. So I was thinking if there is a way to retrieve the binary from the ESP?

Please let me know if this can be done somehow via ampy, etc.. Or suggest me some workaround. I'm already trying to find out the approximate commit around that time, and would cross compile again, which I'm not sure if would work as expected.

4

3 回答 3

3

无论您将哪个固件加载到 ESP8266 模块(NodeMCU、MicroPython、Arduino 等)上,您都可以使用esptool.py将闪存内容转储到如下文件中:

./esptool.py -p PORT -b 460800 read_flash 0 0x200000 flash_contents.bin

read_flash是命令,0x200000是内存上限 (2MB) 的参数。

于 2018-12-25T18:19:32.030 回答
0

将固件读取为 BIN 文件 将固件读取为 BIN 文件,您需要首先将 FTDI 与 IR 模块上的引脚正确连接

FTDI 到 IR 模块如下

FTDI 3.3 V    to  IR 3.3 V,
FTDI GND      to  IR GND,
FTDI GND      to  IR IO0 (flash mode - IMPORTANT otherwise it will not work),
FTDI RX       to  IR TXD,
FTDI TX       to  IR RXD

然后运行命令(如果 COM 端口是 5 并且提取 bin 的名称是 flash-contents,否则你替换它们以匹配你的 COM 和你想要的名称)——重要的是波特率是 9600

esptool.py -p COM5 -b 9600 read_flash 0 0x200000 flash_contents.bin

以下是我的结果(在 Windows 11 上的 python 3.10.2 下运行):

  PS F:\> esptool.py -p COM5 -b 9600 read_flash 0 0x200000 flash_contents.bin
  esptool.py v3.2
  Serial port COM5
  Connecting....
  Detecting chip type... Unsupported detection protocol, switching and trying 
  again...
  Connecting...
  Detecting chip type... ESP8266
  Chip is ESP8266EX
  Features: WiFi
  Crystal is 26MHz
  MAC: 10:52:1c:f8:b7:c7
  Stub is already running. No upload is necessary.
 2097152 (100 %)
 2097152 (100 %)
 Read 2097152 bytes at 0x0 in 2215.2 seconds (7.6 kbit/s)...
 Hard resetting via RTS pin...
 PS F:\>

记住esptool.py -p COM5 -b 9600 read_flash 0 0x200000 flash_contents.bin是 2MB 内存

但它esptool.py -p COM5 -b 9600 read_flash 0 0x100000 flash_contents.bin在 1MB 内存中运行良好,就像在我的 IR 模块中一样

于 2022-01-21T14:44:01.113 回答
0

我降低了读取我的 esp8266 460800 闪存的速度为“46080”,我取了一个零。并且成功

我的系统是windows 10

C:\Users\POSITIVO\Downloads\esptool-master\esptool-master>esptool.py -p COM6 -b 46080 read_flash 0 0x400000 flash_contents3.bin
esptool.py v3.0-dev
Serial port COM6
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 2c:3a:e8:42:b9:f7
Uploading stub...
Running stub...
Stub running...
4194304 (100 %)
4194304 (100 %)
Read 4194304 bytes at 0x0 in 937.7 seconds (35.8 kbit/s)...
Hard resetting via RTS pin...
于 2020-05-07T08:41:34.933 回答