无法写入flash,MD5检验错误:MD5 of file does not match data in flash

wong_eric
Posts: 1
Joined: Mon Oct 25, 2021 4:19 pm

无法写入flash,MD5检验错误:MD5 of file does not match data in flash

Postby wong_eric » Mon Oct 25, 2021 4:43 pm

模组:ESP32-WROOM-32D
ESP-IDF版本:4.3.1
尝试编译烧写example/hello_world实例,正常编译无法烧写:
日志如下:

Serial port COM10
Connecting....
Chip is ESP32-D0WD (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 4c:75:25:57:0f:64
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00007fff...
Flash will be erased from 0x00010000 to 0x00039fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 25440 bytes to 15871...
Writing at 0x00001000... (100 %)
Wrote 25440 bytes (15871 compressed) at 0x00001000 in 0.4 seconds (effective 466.9 kbit/s)...
File md5: b181f1484c264652f0f20d506db35eca
Flash md5: 4c03feeb3298a10ad0ea93ed8c09925b
MD5 of 0xFF is 281039d6031a5a11af6c530e21de18d6

A fatal error occurred: MD5 of file does not match data in flash!
CMake Error at run_serial_tool.cmake:56 (message):
C:/Users/legen/.espressif/python_env/idf4.4_py3.8_env/Scripts/python.exe
F:/cv/Esp32Dev/ESP/esp-idf/components/esptool_py/esptool/esptool.py --chip
esp32 failed


FAILED: CMakeFiles/flash
cmd.exe /C "cd /D F:\cv\Esp32Dev\ESP\esp-idf\components\esptool_py && C:\Users\legen\.espressif\tools\cmake\3.20.3\bin\cmake.exe -D IDF_PATH="F:/cv/Esp32Dev/ESP/esp-idf" -D SERIAL_TOOL="C:/Users/legen/.espressif/python_env/idf4.4_py3.8_env/Scripts/python.exe F:/cv/Esp32Dev/ESP/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32" -D SERIAL_TOOL_ARGS="--before=default_reset --after=hard_reset write_flash @flash_args" -D WORKING_DIRECTORY="F:/WorkFlow/raspiberry/Mods/Esp32/hello_world/build" -P F:/cv/Esp32Dev/ESP/esp-idf/components/esptool_py/run_serial_tool.cmake"
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

尝试运行python esptool.py --port COM10 write_flash_status --non-volatile 0发现无法设置flash状态
esptool.py v3.2-dev
Serial port COM10
Connecting...
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
Detecting chip type... ESP32
Chip is ESP32-D0WD (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 4c:75:25:57:0f:64
Uploading stub...
Running stub...
Stub running...
Initial flash status: 0x0200
Setting flash status: 0x0000
After flash status: 0x0200
Hard resetting via RTS pin...

使用 python espefuse.py --chip esp32 --port COM10 summary,信息如下
Connecting......
espefuse.py v3.2-dev
----------------------------------------------------------------------------------------
Calibration fuses:
BLK3_PART_RESERVE (BLOCK0): BLOCK3 partially served for ADC calibration data = False R/W (0b0)
ADC_VREF (BLOCK0): Voltage reference calibration = 1114 R/W (0b00010)

Config fuses:
XPD_SDIO_FORCE (BLOCK0): Ignore MTDI pin (GPIO12) for VDD_SDIO on reset = False R/W (0b0)
XPD_SDIO_REG (BLOCK0): If XPD_SDIO_FORCE, enable VDD_SDIO reg on reset = False R/W (0b0)
XPD_SDIO_TIEH (BLOCK0): If XPD_SDIO_FORCE & XPD_SDIO_REG = 1.8V R/W (0b0)
CLK8M_FREQ (BLOCK0): 8MHz clock freq override = 55 R/W (0x37)
SPI_PAD_CONFIG_CLK (BLOCK0): Override SD_CLK pad (GPIO6/SPICLK) = 0 R/W (0b00000)
SPI_PAD_CONFIG_Q (BLOCK0): Override SD_DATA_0 pad (GPIO7/SPIQ) = 0 R/W (0b00000)
SPI_PAD_CONFIG_D (BLOCK0): Override SD_DATA_1 pad (GPIO8/SPID) = 0 R/W (0b00000)
SPI_PAD_CONFIG_HD (BLOCK0): Override SD_DATA_2 pad (GPIO9/SPIHD) = 0 R/W (0b00000)
SPI_PAD_CONFIG_CS0 (BLOCK0): Override SD_CMD pad (GPIO11/SPICS0) = 0 R/W (0b00000)
DISABLE_SDIO_HOST (BLOCK0): Disable SDIO host = False R/W (0b0)

Efuse fuses:
WR_DIS (BLOCK0): Efuse write disable mask = 0 R/W (0x0000)
RD_DIS (BLOCK0): Efuse read disable mask = 0 R/W (0x0)
= NONE (BLK1-3 len=256 bits) R/W (0b00)
KEY_STATUS (BLOCK0): Usage of efuse block 3 (reserved) = False R/W (0b0)

Identity fuses:
MAC (BLOCK0): Factory MAC Address
= 4c:75:25:57:0f:64 (CRC 0x5b OK) R/W
MAC_CRC (BLOCK0): CRC8 for factory MAC address = 91 R/W (0x5b)
CHIP_VER_REV1 (BLOCK0): Silicon Revision 1 = True R/W (0b1)
CHIP_VER_REV2 (BLOCK0): Silicon Revision 2 = False R/W (0b0)
CHIP_VERSION (BLOCK0): Reserved for future chip versions = 2 R/W (0b10)
CHIP_PACKAGE (BLOCK0): Chip package identifier = 1 R/W (0b001)
MAC_VERSION (BLOCK3): Version of the MAC field = 0 R/W (0x00)

Security fuses:
FLASH_CRYPT_CNT (BLOCK0): Flash encryption mode counter = 0 R/W (0b0000000)
UART_DOWNLOAD_DIS (BLOCK0): Disable UART download mode (ESP32 rev3 only) = False R/W (0b0)
FLASH_CRYPT_CONFIG (BLOCK0): Flash encryption config (key tweak bits) = 0 R/W (0x0)
CONSOLE_DEBUG_DISABLE (BLOCK0): Disable ROM BASIC interpreter fallback = True R/W (0b1)
ABS_DONE_0 (BLOCK0): Secure boot V1 is enabled for bootloader image = False R/W (0b0)
ABS_DONE_1 (BLOCK0): Secure boot V2 is enabled for bootloader image = False R/W (0b0)
JTAG_DISABLE (BLOCK0): Disable JTAG = False R/W (0b0)
DISABLE_DL_ENCRYPT (BLOCK0): Disable flash encryption in UART bootloader = False R/W (0b0)
DISABLE_DL_DECRYPT (BLOCK0): Disable flash decryption in UART bootloader = False R/W (0b0)
DISABLE_DL_CACHE (BLOCK0): Disable flash cache in UART bootloader = False R/W (0b0)
BLOCK1 (BLOCK1): Flash encryption key
= 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W
BLOCK2 (BLOCK2): Secure boot key
= 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W
BLOCK3 (BLOCK3): Variable Block 3
= 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W
Flash voltage (VDD_SDIO) determined by GPIO12 on reset (High for 1.8V, Low/NC for 3.3V).

ESP_ICY
Posts: 404
Joined: Mon Aug 23, 2021 11:10 am

Re: 无法写入flash,MD5检验错误:MD5 of file does not match data in flash

Postby ESP_ICY » Tue Oct 26, 2021 1:07 pm

模组有无发热严重的现象?检查一下模组的供电是否正常

gavinl
Posts: 24
Joined: Fri Oct 22, 2021 5:53 pm

Re: 无法写入flash,MD5检验错误:MD5 of file does not match data in flash

Postby gavinl » Wed Oct 27, 2021 12:27 am

我发现波特率460800不可靠. 用115200,不会花太多时间,而且总是有效。

Who is online

Users browsing this forum: Bing [Bot] and 56 guests