-->
Page 1 of 1

Any way to "unbrick" an interrupted flash?

PostPosted: Mon Mar 07, 2016 2:08 am
by ProfBeeman
I'm using an Adafruit Huzzah with Arduino 1.6.5 and ESP8266 2.1.0, communicating from OSX over a genuine FTDI cable. My rig has always worked perfectly, literally hundreds of times in the past.

Today, however, I screwed up and interrupted a flash midway through. The Huzzah now seems to be stuck--it won't drop out of flash mode (the little red LED on the Huzzah stays half-bright), but the Arduino IDE and esptool can't connect to it to restart the flash so that it will finish. Resetting doesn't help (with or without GPIO0 held low), unplugging doesn't help, rebooting my Mac doesn't help... it really seems like this board is now just permanently stuck in this state.

I can't believe I'm the first person to botch a serial flash this way. Has anyone else seen a similar problem? More importantly, has anyone else solved a similar problem?

Thanks in advance!

Re: Any way to "unbrick" an interrupted flash?

PostPosted: Tue Mar 08, 2016 10:55 am
by leenowell
Can the esptool.py connect to it at all? If so, have you tried it to erase the flash completely and then reload a new one? This is what fixed my "bricked" esp12f's. The other issue I had on the write flash was that I was not using 4M flash size. This was working fine for ages until one day it got bricked. Doing the erase and then reflashing my code using 4M fixed it

SOLVED!

PostPosted: Tue Mar 08, 2016 11:58 am
by ProfBeeman
Thanks for the reply, Lee. I had tried, unsuccessfully, running esptool with erase_flash, but your message prompted me to try harder. :)

Here's the sequence that finally worked:
1. Jump GPIO2 to +3.3V
2. Jump GPIO15 to GND
3. Hold the button to bring GPIO0 to GND
4. Press the RESET button, then release it and GPIO0
5. Erase the flash with esptool erase_flash. The tool says "this will take a while", but it actually finishes almost instantly. The GPIO0 LED will still be half-lit, but you are not out of the woods yet.
6. Remove the GPIO2 and GPIO15 wires
7. Reset while holding the GPIO0 button as with a normal flash operation
8. Upload with the IDE

Digging into the Espressif docs, I think I kind of understand why this fixed the problem, and I think all I really needed to do was jump GPIO15 low. [EDIT: Nope, after bricking another one, I got the chance to experiment some more and all of these steps are required.] But I'm not sure, and I certainly don't want to re-brick another one just to test my theory. So I'll just leave these instructions here as a voodoo ritual for the next person.

Re: Any way to "unbrick" an interrupted flash?

PostPosted: Tue Mar 08, 2016 5:52 pm
by xtal
I have had a lot of strange happening's and thought I bricked a unit, but never have.....
Yet anyway! Hats off to those who wrote the loader...