Closed mirko closed 1 year ago
Hello @mirko,
Attempting to re-flash those boards with esptool via UART constantly results in A fatal error occurred: MD5 of file does not match data in flash!.
I am not sure what is causing this, but it seems like the flash chips of the second batch are getting write-protected. Is adding the write_flash_status --bytes 2 --non-volatile 0
step into your flashing process (/opt/bin/flash_esp32.sh
) a viable option for you?
We've got no answers. Closing...
Operating System
Linux, Python 3.11.4
Esptool Version
v4.5.1
Python Version
Python 3.11.4
Chip Description
ESP32 WROVER-E with internal SPI flash (16MiB)
Device Description
Custom PCB
Hardware Configuration
No response
How is Esptool Run
No IDE
Full Esptool Command Line that Was Run
python3 esptool.pyc --chip esp32 --baud 115200 write_flash -z 0x1000
Esptool Output
More Information
We're in the middle of production of ESP32-based PCBs and got the first and second batch of boards using an ESP32 WROVER-E module with builtin 16MiB SPI flash.
All PCBs of the first batch (~100) were successfully flashed UART and are running fine.
Now we received and are flashing the second batch of boards from our manufacturer and while flashing appears to work (at least no error), they behave "weird", which narrows down to flash related operations (e.g. NVS can't be written, nor can files on LittleFS be created). However they definitely were flashed, as they're running our software - except not being able to write to flash.
Attempting to re-flash those boards with esptool via UART constantly results in
A fatal error occurred: MD5 of file does not match data in flash!
.The md5 of the read-out of the flash is constant (per board at least), so it's not random noise on the UART.
What's relieving as much as concerning to me, that I can successfully re-flash the ESP32 on these boards if issuing
esptool.py write_flash_status --bytes 2 --non-volatile 0
beforehand (as in: before I issue above statedwrite_flash
-call).I do not know, what
esptool.py write_flash_status --bytes 2 --non-volatile 0
exactly does. From what I figure, it clears the flash settings - possibly including the bit for write-protection.However why would that flash settings be set that way in the first place and why can I flash via UART initially but can't write to flash right after first flashing anymore?
On a additional note,
read_flash_status
on working boards from the first batch returns the same value as on the boards which show this issue:Status value: 0x0200
. However on re-surrected boards -- after executingwrite_flash_status --bytes 2 --non-volatile 0
-- the status value is0x0000
.Other Steps to Reproduce
No response
I Have Read the Troubleshooting Guide