MD5 of file doas not match data in flash ( fatal error )

kasra75
Posts: 3
Joined: Wed Dec 27, 2017 2:38 pm

MD5 of file doas not match data in flash ( fatal error )

Postby kasra75 » Wed Dec 27, 2017 5:03 pm

Hello everyone,

i get this error when trying to upload my sketch : A fatal error occurred: MD5 of file does not match data in flash!

here is the complete log :

esptool.py v2.1
Connecting........_
Chip is ESP32D0WDQ6 (revision 0)
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Warning: Could not auto-detect Flash size (FlashID=0x0, SizeID=0x0), defaulting to 4MB
Compressed 8192 bytes to 47...

Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 9362.3 kbit/s)...
File md5: e6327541e2dc394ca2c3b3280ac0f39f
Flash md5: a4a128c2e76bca618746b1a172a1229e
MD5 of 0xFF is 84d04c9d6cc8ef35bf825d51a5277699

A fatal error occurred: MD5 of file does not match data in flash!
A fatal error occurred: MD5 of file does not match data in flash!

The code did'nt change at all ( i am able to upload it in another board )

My "hardware" knowedge is not great could you please help meto understand what is that mean and how to fix it ?

informations about my environement :
IDE : Arduino ide 1.8.5 with the arduino-esp-32 pluged on it.
my board is a WEMOS LOLIN32

Best Regards,

Kasra

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: MD5 of file doas not match data in flash ( fatal error )

Postby ESP_Angus » Wed Dec 27, 2017 10:11 pm

Hi Kasra,

This means that after esptool.py wrote the new binary to the flash it read back the contents and it didn't match. So something was corrupted, or write protection prevented the flash from being updated.

Probably a more concerning warning is this:

Code: Select all

Warning: Could not auto-detect Flash size (FlashID=0x0, SizeID=0x0), defaulting to 4MB
This indicates that the flash isn't properly responding to commands at all (FlashID and SizeID should be non-zero values.)

Has this LOLIN32 board ever worked successfully? Is anything connected to any of the GPIO pins of the board, in particular the GPIOs which are used by the internal SPI flash -numbers 6, 7, 8, 9, 10, 11?

kasra75
Posts: 3
Joined: Wed Dec 27, 2017 2:38 pm

Re: MD5 of file doas not match data in flash ( fatal error )

Postby kasra75 » Thu Dec 28, 2017 11:46 am

Hello,

Thanks a lot for your answer .

Yes the boards were working when pluged it for the first time ( there is always a little demo in the screen ) .
Then i was able to upload the code .

Here is the exact board that i have : http://www.instructables.com/id/ESP32-W ... ting-Star/

And according to the picture, GPIOs that are used by the internal SPI flash where free ( nothing was pluged on GPIO 6,7,8,11).
i don't see GPIO 9 and 10 as the picture is showing.
But i can't upload anything now. I just have the code of my first upload on it, but i can't do anything else .
The GPIO that are used are : 16 , 2 , 13,12,15 ( all are in the right side of the board ) and Yes they are connected during the process of upload.

i attached 2 pictures for showing you the exact schema.
I used 2 different boards, and when i try to upload something on these boards i have 2 different fatal error.
For the first board ( first picture ) i have the MD5 fatal error that i send to you on my first message whenever i try to upload something. As you can see when i plug the board the program that is into it ( from the very first upload ) is not starting.


for the second board
i have another fatal error whenever i try to upload again :

esptool.py v2.1
Connecting........_
Chip is ESP32D0WDQ6 (revision 0)
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Warning: Could not auto-detect Flash size (FlashID=0x0, SizeID=0x0), defaulting to 4MB
Compressed 8192 bytes to 47...

Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 7281.7 kbit/s)...

A fatal error occurred: Timed out waiting for packet header
A fatal error occurred: Timed out waiting for packet header



But as you can see on the picture the program is starting ( you can see the "OFF" message which is from my code )
Is it a way to reinitialze everything ? it's important for me to understand what bad actions i did to not reproduce them.
if you have a tutorial or documents that shows how to reinitilize the board it would be nice ;) .
If you have an answer it's even better lol. i just hope that i didn't kill the boards.

thanks again,

have a nice day.
Kasra
Attachments
second.jpg
second.jpg (1.74 MiB) Viewed 183170 times
first.jpg
first.jpg (2.11 MiB) Viewed 183170 times

kasra75
Posts: 3
Joined: Wed Dec 27, 2017 2:38 pm

Re: MD5 of file doas not match data in flash ( fatal error )

Postby kasra75 » Fri Dec 29, 2017 10:57 am

for the MD5 of file that does not match data in flash,

here is the complete command line . Just in case it could help.

C:\Users\User\Documents\Arduino\hardware\espressif\esp32/tools/esptool.exe
--chip esp32
--port COM10
--baud 921600
--before default_reset
--after hard_reset write_flash -z
--flash_mode dio
--flash_freq 80m
--flash_size detect
0xe000 C:\Users\User\Documents\Arduino\hardware\espressif\esp32/tools/partitions/boot_app0.bin
0x1000 C:\Users\User\Documents\Arduino\hardware\espressif\esp32/tools/sdk/bin/bootloader_dio_80m.bin
0x10000 C:\Users\User\AppData\Local\Temp\arduino_build_277135/SimpleWiFiServer.ino.bin
0x8000 C:\Users\User\AppData\Local\Temp\arduino_build_277135/SimpleWiFiServer.ino.partitions.bin

thanks,
Kasra

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: MD5 of file doas not match data in flash ( fatal error )

Postby WiFive » Sat Dec 30, 2017 1:50 am

Read esp32 datasheet strapping pins section. 15 and more importantly 2 and 12 are strapping pins.

ucpatnaik
Posts: 1
Joined: Wed Jan 27, 2021 1:00 pm

Re: MD5 of file doas not match data in flash ( fatal error )

Postby ucpatnaik » Wed Jan 27, 2021 1:10 pm

After a lot of studies, I am now convinced that the file MD5 has gone corrupt while Esp32 was on program mode because of a 5-volt power glitch that was caused by a defective power source, so at the beginning of loading the requested file asked in return does not match and thus it does not allow loading but the old program remains. As the chip is write-protected my esp32 (30 pins)now is a brick. Fingers crossed till I receive a new one. Don't waste your time.. You have lost it. :roll:

Araqel
Posts: 4
Joined: Wed Apr 29, 2020 4:39 pm

Re: MD5 of file doas not match data in flash ( fatal error )

Postby Araqel » Sat Jun 26, 2021 6:47 pm

The threat in my case has been solved accidentally. The board was Ai-Thinker ESP32-CAM, The GPIO3 has been grounded (flash mode set) and the power GND has been disconnected. The flashing gone successful. Magic!

MiGgen
Posts: 1
Joined: Fri Nov 19, 2021 11:51 pm

Re: MD5 of file doas not match data in flash ( fatal error )

Postby MiGgen » Fri Nov 19, 2021 11:54 pm

For me, just removing the connection of GPIO12 fixed this issue.

johnzbesko
Posts: 2
Joined: Sun Nov 21, 2021 3:49 am

Re: MD5 of file doas not match data in flash ( fatal error )

Postby johnzbesko » Sun Nov 21, 2021 3:58 am

Hello! I have a similar problem. I may have touched the wrong pins when debugging a soldered breadboard. The test sketch I was using seems to have been permanently written to somewhere on my ESP32-WROOM-32. I'm trying to erase everything and bring back factory condition. This is my latest attempt using a USB cable to connect to the ESP:

$ sudo python /home/johnz/.local/lib/python3.8/site-packages/esptool.py --chip auto --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size 4MB 0x0 factory/factory_WROOM-32.bin
esptool.py v3.2
Serial port /dev/ttyUSB0
Connecting.....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting.....
Detecting chip type... ESP32
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: c4:4f:33:6b:a4:29
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x003fffff...
Compressed 4194304 bytes to 942887...
Wrote 4194304 bytes (942887 compressed) at 0x00000000 in 86.8 seconds (effective 386.3 kbit/s)...
File md5: a595121b6aa7426e533006344d547440
Flash md5: d37302d28a3ce07290a5faabb8567d54
MD5 of 0xFF is 2b7a70fa59f8173635bcbe956bad56c6

A fatal error occurred: MD5 of file does not match data in flash!


Have I bricked my ESP? Do I need to get a serial to USB converter and use certain pins to upload?

johnzbesko
Posts: 2
Joined: Sun Nov 21, 2021 3:49 am

Re: MD5 of file doas not match data in flash ( fatal error )

Postby johnzbesko » Mon Nov 22, 2021 11:41 pm

Following this thread:

https://githubmemory.com/repo/espressif ... issues/662

I eventually tried:

$ sudo python /home/johnz/.local/lib/python3.8/site-packages/esptool.py write_flash_status --non-volatile 0
esptool.py v3.2
Found 1 serial ports
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting.....
Detecting chip type... ESP32
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: c4:4f:33:6b:a4:29
Uploading stub...
Running stub...
Stub running...
Initial flash status: 0x6200
Setting flash status: 0x0000
After flash status: 0x2000
Hard resetting via RTS pin...


I was then able to run:

$ sudo python /home/johnz/.local/lib/python3.8/site-packages/esptool.py --chip auto --port /dev/ttyUSB0 --baud 115200 --before default_reset --no-stub --after hard_reset write_flash -u --flash_mode dio --flash_freq 40m --flash_size 4MB 0x0 factory/factory_WROOM-32.bin
esptool.py v3.2
Serial port /dev/ttyUSB0
Connecting......
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: c4:4f:33:6b:a4:29
Enabling default SPI flash mode...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x003fffff...
Erasing flash...
Took 5.74s to erase flash block
Wrote 4194304 bytes at 0x00000000 in 404.4 seconds (83.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...


Fixed the problem! I am now able to upload new sketches using the Arduino IDE.

Who is online

Users browsing this forum: No registered users and 11 guests