espressif / esptool

Espressif SoC serial bootloader utility
https://docs.espressif.com/projects/esptool
GNU General Public License v2.0
5.5k stars 1.37k forks source link

Corruption when writing to 25Q80BSIG flash using QIO #71

Closed dreamlayers closed 8 years ago

dreamlayers commented 8 years ago

I have a module with GigaDevice 25Q80BSIG 8mbit flash. Esptool uses QIO by default, and that leads to corruption when writing flash. Most of the chip gets written properly, but some data ends up in the wrong place, as if some address bits get flipped, commonly in some specific small areas of the chip. It does not seem like data bits get flipped. Reads seem fine with QIO. Going to 20 MHz SPI clock does not help. Adding a 10 microfarad tantalum capacitor at the module also didn't help. I don't get any corruption with DIO.

The original firmware was set up for QIO, and it worked. I modified esptool to write firmware set up for QIO even when writing using DIO, and the new firmware also works with QIO. Of course the firmware does a lot less writing during normal operation, so I can't be sure it won't corrupt the flash sometimes. I realize this could be a hardware issue with the module.

projectgus commented 8 years ago

Sorry for the slow reply.

This is a really strange problem! I think if the checksum that the serial bootloader calculates matches what esptool expects, and the serial protocol otherwise succeeds, then I'm not sure if there's anything we can do from the esptool end.

Do you have multiple modules that all display the same problem? I guess otherwise my money would be on faulty SPI flash before anything else.

Angus

projectgus commented 8 years ago

I'm going to close this issue now, but please reopen if you think esptool.py is doing something wrong.