Esp32-cam MD5 Programming Error

Hi, while programming an esp32-2 cam module on the Arduino IDE, I encountered a MD5 error. The module programs as normal until the 100% point then a fatal error is displayed. Does anyone know the cure for this error? Thanks, Mac

Writing at 0x000d0e75... (100 %)
Wrote 812720 bytes (523366 compressed) at 0x00010000 in 12.3 seconds (effective 528.1 kbit/s)...
File  md5: fde0f08152a19780537b6c62ba5c775b
Flash md5: e30c4d9749a6e261ba1ed8a33789d2c7
MD5 of 0xFF is 3f223b2ca9c7fd36af682b7c667c2a7c

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

try to upload at a lower speed may be (115200) ?

Thanks for the suggestion JML,
I did change the Partition Scheme to your suggestion, but there was no "Rien" dropdown on the Core Debug Level setting.
The change did not fix the issue.
Mac

Rien means nothing in French (screengrab was the French version of the ide)

What I was suggesting was to change the upload speed to 115200 and keep the rest as it were

Ok, sorry about that.
I did not see anywhere in the IDE to change the upload speed, except in the preferences.txt file. Is that right?

assuming you use the 1.8.19 version of the IDE, once you've chosen your board, in the tools menu you have various options. One of them is upload speed.


by default I think it's 921600, I was suggesting to try with a slower speed like 115200

Yes, I use V1.8.19. I do not see "Upload Speed" heading after choosing Board: "AI Thinker ESP32-CAM" from the ESP32 Arduino heading.
Mac

you are right, it's not available if you pick that board.... my bad..

the error message you get MD5 of file does not match data in flash means that the upload did not work correctly and what is in flash on the board does not match what you tried to upload.

have you tried changing the cable? making sure that nothing is connected to the Serial port of the ESP? etc...

The on board flash may be defective.

I do not have a spare FTDI cable, but it programs fine with other ESP32-cam's I have. Is there a way to clear the flash? The funny part about this that the original sketch I uploaded still works fine, as I can view the video dashboard and pix when I WiFi connect to it and Brouse to the IP 192.168.1.4.
Mac

Ok, now just tried uploading code to different ESP32-CAM and it seemed to be programming until it got to 100% then gave same MD5 error?? The cam still works with its last programmed sketch. Totally baffled!

esptool.py v4.2.1
Serial port COM4
Connecting.....
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: c8:f0:9e:9d:3d:f0
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00073fff...
Compressed 18912 bytes to 13025...
Writing at 0x00001000... (100 %)
Wrote 18912 bytes (13025 compressed) at 0x00001000 in 0.4 seconds (effective 387.3 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 119...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (119 compressed) at 0x00008000 in 0.0 seconds (effective 786.1 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 2097.8 kbit/s)...
Hash of data verified.
Compressed 406912 bytes to 236280...
Writing at 0x00010000... (6 %)
Writing at 0x0001a74d... (13 %)
Writing at 0x000278b0... (20 %)
Writing at 0x0002cfd5... (26 %)
Writing at 0x000329dc... (33 %)
Writing at 0x00038162... (40 %)
Writing at 0x0003d5c4... (46 %)
Writing at 0x000427c6... (53 %)
Writing at 0x00047d22... (60 %)
Writing at 0x0004e82c... (66 %)
Writing at 0x00053efd... (73 %)
Writing at 0x0005a62a... (80 %)
Writing at 0x0006380e... (86 %)
Writing at 0x0006b77c... (93 %)
Writing at 0x000710e9... (100 %)
Wrote 406912 bytes (236280 compressed) at 0x00010000 in 5.6 seconds (effective 585.2 kbit/s)...
File  md5: 179f7fbdaa8c398c3235f28700abe20c
Flash md5: fa02d1ce2ebc42cddaa0b880479d67d3
MD5 of 0xFF is 7ff1aeaf00149370c948a90adf2ebdaf

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!

[SOLVED]: ESP32-CAM MD5 Programming Error

Hello, I was working with an ESP32 and this type of error also happened to me. It happened when I was trying to flashing some arduino code, even an empty one. The ESP32 didn't respond and didn't enter in programming mode and also the message "Could not auto-detect flash size" appeared in console.

I managed to fix this problem as follows:

  1. Connect the ESP32 to serial port but disconnect the power of the ESP32.
  2. Upload arduino sketch.
  3. While arduino is loading sketch and before "Conecting..." appears in the console, press the reset button and keep it press.
  4. Connect ESP32 to power while pressing reset button.
  5. Press the programming button to enter ESP32 in programming mode. Then, release buttons.

Automatically, It will start to writing the code into the ESP32.

I hope this would help you too.

1 Like

Thank for the good hint. I will try it when I return from vacation. :sunglasses:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.