New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A fatal error occurred: MD5 of file does not match data in flash! (ESPTOOL-139) #473
Comments
I try to flash back the original firmware into my switch but having the MD5 of file does not match data in flash error. By right should not have issue right? |
Hi @TTTANG53 , Yes, this suggests some problem with the hardware, maybe some of the flash is write protected. Is the firmware a secret? If not, can you take another dump of current flash contents with |
Hi @projectgus, |
Hi @TTANG53, Thanks. The binary files suggest that some bytes of the new firmware were not written to flash successfully and are still 0xFF. The failed bytes seem mostly random. If you re-run flashing, do you get the same "Flash md5:" value or a different one each time? Do you have a good enough 3.3V power supply to the SONOFF when flashing? Bad power during the flash can cause this kind of corruption. |
Hi @projectgus, |
It's possible that the FTDI board can't supply enough stable current at 3.3V and the chip is browning out during programming. If you can: try a different board, and/or add a capacitor between the 3.3V and GND pins (on either the FTDI board or the Sonoff). Angus |
@projectgus , TTT |
Hi @TTTANG53 , Any success? Angus |
Hi @projectgus , TTT |
I used 5 Volts from FTDI to power 3.3 V Sonoff Switch (Jumper pins was set to 5 V ) Voila it worked like a charm no MD5 Error. 4 of my 10 sonoff switches were giving this error but other 6 worked fine on 3.3 v setting. |
Just wanted to add my 0.02 here in case someone faces the same issue I did and ends up here after a Google search, like me. I was trying to flash Tasmota/ESPHome in a Sonoff TX and was facing the same error reported here. To be fair, I had this device running the original firmware for a few months and it stopped working recently, so I knew there was something wrong with it. But I was able to put it into programming mode and it was responding to most commands, so I thought it was worth a shot. I tried to flash it several times and always got this MD5 mismatch error, and it was always the same MD5 value. After a while playing with the This Sonoff has 1 MB of flash and according to the Since the ESPHome base image is a bit less than 400KB, I created a custom image configured as if my device only had 512KB of flash, instead of 1MB. Then I tried to flash it using I'm still not sure if half of my device's flash memory just went bad, but the device is now working again and 100% funcional. |
@rsieiro Thanks for sharing this. What is the output of |
Right now the device is installed in my living room wall, but I'll take some time during the weekend to check for that info. |
@rsieiro Oh! Look, if it's working then don't worry about too much. I was curious to verify that the flash was actually 1MB in size, according to its flash id. I think otherwise your theory that it's somehow defective is probably the correct one. |
Hello everyone, |
This is happening when your build tool doesn't delete *.bin files produced by 'gen_appbin.py' This tool, instead of overwriting existing data it will keep append to existing eagle.app.flash.bin file so after a while, will wrap around and write complete mess into chip. |
Hola tengo una vasta experiencia en programación, pero son los primeros indicios con electronica y todo este tema de arduino, recientemente tuve el mismo error con mi esp32s al inicio funciono bien (La conexion a internet) y de un momento comenzo a salir este error, no tengo idea de como solucionarlo. y se me es un poco complejo entender lo que dicen |
just go to python and flashthe memory |
(Please delete any lines which don't apply.)
Full esptool.py command line as run:
C:\esptool\2.8>python esptool.py --port COM3 write_flash -fs 1MB -fm dout 0x0 4gangNormal_1M.bin
Full output from esptool.py (please copy and paste all lines of output)
esptool.py v2.8
Serial port COM3
Connecting....
Detecting chip type... ESP8266
Chip is ESP8285
Features: WiFi, Embedded Flash
Crystal is 26MHz
MAC: c4:4f:33:8a:d0:e2
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Compressed 1048576 bytes to 308292...
Wrote 1048576 bytes (308292 compressed) at 0x00000000 in 27.2 seconds (effective 308.1 kbit/s)...
File md5: 4b98739f0db188e625e4b4b66165d001
Flash md5: e35ca09416f586361b9a6f106bfef588
MD5 of 0xFF is 2fdd6851b32ae931637d4845c037b550
A fatal error occurred: MD5 of file does not match data in flash!
What is the expected behaviour?
Should have error write flash as the flash is original backup.
Do you have any other information from investigating this?
Is there any other information you can think of which will help us reproduce this problem?
The text was updated successfully, but these errors were encountered: