Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

**SOLVED** Has anyone else experienced "flakey" uploads? (ESPtool.exe is broken) - read to bottom

Open tim-in-oakton opened this issue 11 years ago • 94 comments

My config is as follows:

  • ESP8266 -03 modules
  • Regulated 3.3v supply - arduino style battery input/USB regulator thing
  • 3.3v FTDI USB:serial converter

On my first module I successfully compiled and uploaded maybe 500 times - occasionally I would need to upload twice if the first upload failed to execute correctly. This got worse over time, it seemed like restarting the Arduino IDE and rebooting my PC was some help (hard to prove, it was intemittent). I did try to reflash with a minimal sketch as well, that didn't really seem to help. The program is a datalogging app for a Beer Keg - maybe 1000 lines of code or so. Not very big.

Recently it got harder & harder to get a "good" upload (I used the serial monitor & wireless behavior to confirm if it was "working"). This morning I was completely unable to get an upload to work - the upload using the Arduino IDE would complete with no errors, but the uploaded executable image would not execute.

Using the Python ESPTool uploader, I was able to "erase" the flash, but not upload the 512K "blank" file - it would consistenly fail at 32% (hex800000). I replaced the ESP module with another, the FIRST upload worked fine and executed perfectly, when I made a minor change to the code however it would upload with no errors but not execute. Frustrating.

The IDE reports: Sketch uses 205,912 bytes (39%) of program storage space. Maximum is 524,288 bytes. warning: unsupported baud rate: 115200, using 115200 Uploading 38112 bytes from C:\Users\timm\AppData\Local\Temp\build7944810091012342573.tmp/Kegerator-v4.3.cpp_00000.bin to flash at 0x00000000 ...................................... Uploading 167848 bytes from C:\Users\timm\AppData\Local\Temp\build7944810091012342573.tmp/Kegerator-v4.3.cpp_40000.bin to flash at 0x00040000 ....................................................................................................................................................................

I will try to upgrade the power supply to something I trust more than an off-brand Arduino-style regulator, but is this something that others have seen? Are there any tricks to reliable upload&execute?

I am using the 1.6.3 IDE with a GIT pull from maybe 2 weeks ago - have there been any changes to the upload functionality or to the linker directives?

Any thoughts? Not sure if I have a bug or a PEBCAK issue- are there any known "gotchas" to be aware of that complicate uploading? thanks! tim

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

tim-in-oakton avatar Apr 22 '15 02:04 tim-in-oakton

I forgot to specify - Windows build, will try a fresh clone tonight-

tim-in-oakton avatar Apr 22 '15 02:04 tim-in-oakton

Hi

I'm now having issues like this too. Everything was fine but now it appears to upload successfully, then nothing except 'gobbledygook' on the serial monitor.

From what little I've been able to understand, the 'gobbledygook' is a bootloader message at 76800 baud - but I don't have that as a baud rate option for the serial monitor.

It's not the PSU - have tried 3 and they're all 3.3 +/- 0.03V. It's not the FTDI Friend that I'm using as USB to Serial - that works fine with an Arduino Pro Mini 3.3V. The wiring hasn't changed - Vcc, CH_PD and RST (via 1K) to 3V3, GND to 0V, ESP Rx to FTDI Tx, ESP Tx to FTDI Rx). The method remains the same - ground GPIO0, ground and release RST, release GPIO0, upload, ground and release RST. It's the same problem with all modules - ESP-01 and Olimex.

I'm running Windows XP with the 1.6.1-p1 release from GitHub (I can't fathom out all the 'pull', 'fork' and everything else to do it any other way). I've tried closing down the IDE and restarting and I've tried hard rebooting the laptop.

There's an occasional "4j - Error when starting" type error when I restart the IDE but that doesn't appear to be consistent (and I have no idea what it is anyway).

It might (though not guaranteed) be helpful to read the bootloader message after a reset, so discovering how to get 76800 baud rate in the IDE Serial Monitor could be a good start...

From what I can understand, it appears that either the 1.6.1-p1 IDE is failing somehow or seven ESP modules have failed at the same time - which seems improbable as four of them were previously OK and the other three were brand new...

All help and advice gratefully received.......

On 22 April 2015 at 04:27, tim-in-oakton [email protected] wrote:

I forgot to specify - Windows build, will try a fresh clone tonight-

— Reply to this email directly or view it on GitHub https://github.com/esp8266/Arduino/issues/95#issuecomment-95000931.

duncan-a avatar Apr 22 '15 10:04 duncan-a

Your description matches mine exactly, thanks for the 76800bps tip, I may look into that (did not know the magic number was 76800!).

I tried a third module late last night - same behavior... first upload works, second LOOKS fine uploading, but doesn't work. Resetting after upload shows "gobbletygook" in the serial monitor....

AFAIK I changed NOTHING in my upload environment, and I have 3 PCs used for development - all are behaving in this manner (or, changing to a different PC doesn't seem to change the upload-not-working behavior). All PC's are WIndows7, using the earlier 1.6.1 Zip download with patched libs for the UDP port issue (thanks IGRR).

Once in this state, it doesn't appear that I can upload a functioning "minimal sketch" to a module either - although this problem seemed to "grow over time" - from an occasional failed upload to "can't upload at all anymore". Very strange, the common factors would seem to be the IDE/uploader code, the host OS (windows7 with auto-updates) & the power supply in my case... I'll have a better bench supply this evening UMT-5 to test with.

Anyone else seeing flakiness? If so, can you share your system/project specs?

tim-in-oakton avatar Apr 22 '15 11:04 tim-in-oakton

I don't get the "first upload works, second LOOKS fine uploading, but doesn't work" - it's now just "LOOKS fine uploading, but doesn't work", even with a fresh module.

I'm limited to one (rather ancient) Win XP laptop using "1.6.1 Zip download" but without "patched libs for the UDP port issue" (I don't understand how to do things like that!) - but I can use that IDE OK with a Pro Micro 3.3V (Board: Pro Micro, Processor: ATMega 328 8MHz, Programmer: AVR ISP) so that's proving that the FTDI Friend is OK and that the 'genuine Arduino' part of the IDE is OK.

If you discover a way of adding 76800 into the options for the serial monitor, please share it (in simple terms if possible - anything too techie is way over my head).

On 22 April 2015 at 13:41, tim-in-oakton [email protected] wrote:

Your description matches mine exactly, thanks for the 76800bps tip, I may look into that (did not know the magic number was 76800!).

I tried a third module late last night - same behavior... first upload works, second LOOKS fine uploading, but doesn't work. Resetting after upload shows "gobbletygook" in the serial monitor....

AFAIK I changed NOTHING in my upload environment, and I have 3 PCs used for development - all are behaving in this manner (or, changing to a different PC doesn't seem to change the upload-not-working behavior). All PC's are WIndows7, using the earlier 1.6.1 Zip download with patched libs for the UDP port issue (thanks IGRR).

Once in this state, it doesn't appear that I can upload a functioning "minimal sketch" to a module either - although this problem seemed to "grow over time" - from an occasional failed upload to "can't upload at all anymore". Very strange, the common factors would seem to be the IDE/uploader code, the host OS (windows7 with auto-updates) & the power supply in my case... I'll have a better bench supply this evening UMT-5 to test with.

Anyone else seeing flakiness? If so, can you share your system/project specs?

— Reply to this email directly or view it on GitHub https://github.com/esp8266/Arduino/issues/95#issuecomment-95146344.

duncan-a avatar Apr 22 '15 13:04 duncan-a

Heh, my debug output works at 77400. :)

My devices are all VERY voltage-sensitive; they pull too much current for the 3.3V lines on most of my serial adapters.

My advice would be to grab PuTTY, monitor the serial port, and try to restart the module in to flash mode.

If you see a boot mode of anything but (1,7) in the debug output, something's wrong. First number is the boot type - 1 means boot from UART (aka flash over serial), 3 means boot from SPI flash (aka normal startup), 5 means boot from SDIO (aka...nobody's doing this yet.) The second number appears to be related to whether or not the chip started cleanly - 7 is good, anything less and you might not be able to flash.

abl avatar Apr 22 '15 20:04 abl

Thanks for joining in Alexander

Hmmm...

In my case, I'm running a 5V 1.2A wall wart (stable +/- 0.1V according to a multimeter) and following it with an AMS117 type 3.3V regulator which, according to the specs, should be good for 1A - again, on the multimeter, the 3.3V rail is rock steady.

I'll try and get PuTTY installed and hope that provides an answer to the what (the heck's happening?) - that may subsequently lead to a why (this is happening) and a how (to fix it).

One thing I'm wondering relates to tim-in-oakton and I both using the 1.61-p1 from the .zip file on the 'releases' page - most other people are being much more techie and doing clever things (that I can't follow) from the regular builds on the main GitHub page. Could it be that this problem has appeared before, has been fixed by some devious and unfathomable means on the main page but that it hasn't made it to the .zip file?

Just a thought...

On 22 April 2015 at 22:52, Alexander [email protected] wrote:

Heh, my debug output works at 77400. :)

My devices are all VERY voltage-sensitive; they pull too much current for the 3.3V lines on most of my serial adapters.

My advice would be to grab PuTTY, monitor the serial port, and try to restart the module in to flash mode.

If you see a boot mode of anything but (1,7) in the debug output, something's wrong. First number is the boot type - 1 means boot from UART (aka flash over serial), 3 means boot from SPI flash (aka normal startup), 5 means boot from SDIO (aka...nobody's doing this yet.) The second number appears to be related to whether or not the chip started cleanly - 7 is good, anything less and you might not be able to flash.

— Reply to this email directly or view it on GitHub https://github.com/esp8266/Arduino/issues/95#issuecomment-95331760.

duncan-a avatar Apr 22 '15 21:04 duncan-a

Yeah, I don't think it's your power supply - which is significantly more stable than mine - I just got VERY similar problems when I had a flaky power supply.

PuTTY should be the easiest way to get a terminal open - no install necessary, you can get it as a standalone executable.

The underlying flash tools probably haven't changed, and that appears to be where the issue lies if it isn't the chip; I'm not familiar with this particular project but I'm fairly familiar at this point (in that when one falls out of a tree, one becomes familiar with many branches) with the ESP8266 and the Arduino platform in general.

I'll dig deeper once I get home.

abl avatar Apr 22 '15 21:04 abl

Yup, the belief that USB can power anything and you can always get 3.3V from an Arduino seems to be a widespread erroneous belief within some sections of the maker movement. I may be useless with software, out of my depth with a lot of the modern stuff and totally confused by the proliferation of unfathomable terms, but fifty years of engineering from the days of all valves (tubes) has taught me the value of adequate power supplies.

I could try a chunky electrolytic close to the ESP but I really doubt it will make any difference - the multimeter may be slow to react but I think there should be more than enough in hand, even if the 117 is a 'Chinese copy' of dubious pedigree...

I can't rule out ESP chip failure, but at the attrition rate I've experienced with 'fresh from the packet' ones not working at the first try since this problem materialised, I doubt that's at the root of the problem

  • and living on a pension doesn't allow me to keep throwing them at the problem!!!

Ho hum...............

On 22 April 2015 at 23:35, Alexander [email protected] wrote:

Yeah, I don't think it's your power supply - which is significantly more stable than mine - I just got VERY similar problems when I had a flaky power supply.

PuTTY should be the easiest way to get a terminal open - no install necessary, you can get it as a standalone executable.

The underlying flash tools probably haven't changed, and that appears to be where the issue lies if it isn't the chip; I'm not familiar with this particular project but I'm fairly familiar at this point (in that when one falls out of a tree, one becomes familiar with many branches) with the ESP8266 and the Arduino platform in general.

I'll dig deeper once I get home.

— Reply to this email directly or view it on GitHub https://github.com/esp8266/Arduino/issues/95#issuecomment-95344767.

duncan-a avatar Apr 22 '15 23:04 duncan-a

...but it says 3.3 right on the board!

I've done some moderately heinous things to my ESPs - the flashing process is flaky, and without the debug info at that magical baud rate it's really hard to tell what's failing. I suspect your chips are fine. Looking forward to seeing what you get out of PuTTY :)

abl avatar Apr 23 '15 00:04 abl

Thank goodness Im not the only with this problem - I thought I was going crazy last night. Im using the lates github files with the arduino from the readme.

I started to notice problems when I was experimenting with deepsleep. I noticed the problem when deepsleep would cause a fatal exception instead of the usual "deep sleep 15s".

I would change nothing, simply click verify then upload, and randomly it would work.

I still have not found a solution, but I think its the problem you guys are having as i believe it is programmer related.

My setup: Windows 7 32 bit ESP-01 with rst <> xpdc wire LD1117 3.3v regulator feeding the ESP Logic level converter (https://www.sparkfun.com/products/12009) USB-UART is a CP2102 based. Ground is common across esp and usb-uart.

codewise-nicolas avatar Apr 23 '15 06:04 codewise-nicolas

Alexander

Yep, it does say 3.3V and usually it is - but it depends on what you're trying to do with it, what else is going on with the Arduino and how the Aeduino is being powered ...

  • Desktop/Laptop/Tablet USB ports are very 'variable' in the current they can supply - I've seen things crap out at 120mA before now from a laptop, others have been happy at 500mA.
  • The 5V and 3.3V regulators used in Arduino vary from type to type - and the 'clones' complicate things further.
  • The 3.3V reg follows the 5V reg so is dependent upon what's being drawn off 5V not just the current drawn on the 3.3V line.

Running an Arduino off USB is often a primary source of 'unexplained problems' - particularly with things taking high peak currents - WiFi, Bluetooth Classic, RF and Ethernet modules for instance...!!!

Back to the problem in hand...

I can't get PuTTY to work - due, I'm sure, to total incompetence and lack of experience with terminal programs.

The USB adaptor is on Com8 so, in the Connection/Serial part of the PuTTY config window, I'm trying to set:

Serial Line: COM8 Speed: 76800 Data Bits: 8 Stop Bits: 1 Parity: None Flow Control: tried all options...!!!

Hitting "Open" gives me a 'Windows Bong' (feel like I could use a bong at the moment - flashback many years!) - no more, no less...

What am I doing wrong???

On 23 April 2015 at 02:01, Alexander [email protected] wrote:

...but it says 3.3 right on the board!

I've done some moderately heinous things to my ESPs - the flashing process is flaky, and without the debug info at that magical baud rate it's really hard to tell what's failing. I suspect your chips are fine. Looking forward to seeing what you get out of PuTTY :)

— Reply to this email directly or view it on GitHub https://github.com/esp8266/Arduino/issues/95#issuecomment-95371475.

duncan-a avatar Apr 23 '15 11:04 duncan-a

Although not directly related to "the problem", I tripped over this on the ESP8266 Community Forum:

"Did you a add a capacitor across Vcc and GND near the ESP?I also experienced many unwanted resets like you you have. The majority of these resets disappeared when I added a pulup resistor from RST to Vcc. Before I did that I could cause a reset by nearing the ESP with a hand."

I also read something else about pickup on connecting leads causing all sorts of problems, but I can't remember the context.

Where I'm living in Spain, there is no mains earth anywhere in the house wiring - that may (or may not?) be significant.

Several schematics I've seen include a resistor and capacitor (to add a delay to one of the pulses) when using an 'automatic upload' option - I'll search for one and add details when I find it - any port in a storm!!!

One thing I have concluded in my trawling today is that there do appear to be some issues with ESPTool - though most of the tecnicalities were over my head. There seem to be quite a few posts relating to problems in various configurations (using ESP8266/Arduino, direct to the ESP, etc) so we're not the only ones with problems, though we do seem to be leading in the"it did work, now it won't"contest.

For those who are very techie: Is there anything in the 1.6.1-p1 zip version that might have 'filled up', 'overflowed' or anything like that? I'm a bit loath to try a reinstall, but has anybody tried it?

Just thinking out loud...!

On 23 April 2015 at 13:02, Duncan Amos [email protected] wrote:

Alexander

Yep, it does say 3.3V and usually it is - but it depends on what you're trying to do with it, what else is going on with the Arduino and how the Aeduino is being powered ...

  • Desktop/Laptop/Tablet USB ports are very 'variable' in the current they can supply - I've seen things crap out at 120mA before now from a laptop, others have been happy at 500mA.
  • The 5V and 3.3V regulators used in Arduino vary from type to type - and the 'clones' complicate things further.
  • The 3.3V reg follows the 5V reg so is dependent upon what's being drawn off 5V not just the current drawn on the 3.3V line.

Running an Arduino off USB is often a primary source of 'unexplained problems' - particularly with things taking high peak currents - WiFi, Bluetooth Classic, RF and Ethernet modules for instance...!!!

Back to the problem in hand...

I can't get PuTTY to work - due, I'm sure, to total incompetence and lack of experience with terminal programs.

The USB adaptor is on Com8 so, in the Connection/Serial part of the PuTTY config window, I'm trying to set:

Serial Line: COM8 Speed: 76800 Data Bits: 8 Stop Bits: 1 Parity: None Flow Control: tried all options...!!!

Hitting "Open" gives me a 'Windows Bong' (feel like I could use a bong at the moment - flashback many years!) - no more, no less...

What am I doing wrong???

On 23 April 2015 at 02:01, Alexander [email protected] wrote:

...but it says 3.3 right on the board!

I've done some moderately heinous things to my ESPs - the flashing process is flaky, and without the debug info at that magical baud rate it's really hard to tell what's failing. I suspect your chips are fine. Looking forward to seeing what you get out of PuTTY :)

— Reply to this email directly or view it on GitHub https://github.com/esp8266/Arduino/issues/95#issuecomment-95371475.

duncan-a avatar Apr 23 '15 17:04 duncan-a

I did experience flakyness the very first few times (long ago) with the esp8266 and so the cap+resistors fixed it. Its now standard in all my ESP work.

I think this is somehow related to the compiler or the programmer (esptool).

Im trying to make it happen again so I can grab the crash report and post it for more knowleadgeable people to figure out. But to no avail.

Does this method of programming (arduino ide) also make use of the bank 0/1 concept of the ESP; that is, does it program the same file to both banks ? Does the ESPtool verify everything it writes ?

codewise-nicolas avatar Apr 23 '15 17:04 codewise-nicolas

ABL - thanks for the Putty recommendation, I didn't even thin to use it for Serial!! Following are results, I uploaded the sketch, reset and reset again with the GPIO left high.....

Reset results after a “apparently successful flash upload” (Arduino IDE output): Sketch uses 206,664 bytes (39%) of program storage space. Maximum is 524,288 bytes. warning: unsupported baud rate: 115200, using 115200 Uploading 38224 bytes from C:\Users\timmeyer\AppData\Local\Temp\build2395631062301061534.tmp/Kegerator-v4.3.cpp_00000.bin to flash at 0x00000000 ...................................... Uploading 168488 bytes from C:\Users\timmeyer\AppData\Local\Temp\build2395631062301061534.tmp/Kegerator-v4.3.cpp_40000.bin to flash at 0x00040000 .....................................................................................................................................................................

/* connect PUTTY set for 76800bps, reset while still in “upload” mode w GPIO0 pulled low / ets Jan 8 2013,rst cause:1, boot mode:(1,7) / as expected, "I'm cool, waiting for code delivered over the Serial port" */

/* Now reboot/power cycle with the GPIO left to flow high – which normally SHOULD execute the previously uploaded code*/ load 0x40100000, len 30216, room 16 tail 8 chksum 0x2f load 0x3ffe8000, len 2860, room 0 tail 12 chksum 0x21 ho 0 tail 12 room 4 load 0x3ffe8b30, len 4988, room 12 tail 0 chksum 0x8a csum 0x8a

/* This is repeatable – power cycle 5X and see the same exact output 5X. I’ve tried it on three machines now (all Win7 with similar IDE downloads), no change in results.

Previously (last week) this EXACT process worked more than half the time – my code booted up and performed great. The only changes that I am aware of is my code grew modestly, I’ve written a bit more to the EEPROM (nowhere near what I’d expect to create wear), and the original module was transported from work & back (bit of mechanical jostling). */

Any other ideas? When life (work, wife, kids, etc) permits, I'm going to try to use a Linux box as the IDE host and uploader instead of the WIndows boxes used to date, and I'm planning on putting a pair of caps right on the PCB to make sure power is clean. I may also wire other GPIO leads high as a hedge.

I did verify with a 'sillyscope that my power is solid and clean - at least at the power supply (rock solid 3.3v, no noticeable ripple). I don't think that this is power issue now, but I'll throw some caps on to be sure.

Again - my environment was always a little flakey (maybe one upload in 5-10 failed), but it degraded over time to now be unusable - on any of the machines I'm using.

It FEELS like I hit some threshold where the upload process is breaking - setting the wrong jump vectors, putting the code in the wrong place..... dunno. Based on this info, any more thoughts, suggestions or observations? thanks all, I really appreciate the positive feedback- tim

tim-in-oakton avatar Apr 23 '15 18:04 tim-in-oakton

Had time on a break to set up on Ubuntu - compiles and uploads without complaints but STILL doesn't run - After uploading using Linux Arduino IDE and rebooting without GPIO held low I see (at 76800bps):

ets Jan 8 2013,rst cause:1, boot mode:(3,7)

load 0x40100000, len 31024, room 16 tail 0 chksum 0x12 load 0x3ffe8000, len 2844, room 8 tail 4 chksum 0x56 load 0x3ffe8b20, len 4956, room 4 tail 8 chksum 0x66 csum 0x66

It seems a little notable that it compiles to different sizes, but I don't expect that is the root issue - I may try with a minimal sketch as well, but this is replicated behavior - two modules, four computers, two different IDE host OS's (Win7&Ubuntu 14something).

Next up is caps & terminating ALL inputs.... still think this is an upload tool issue though.

tim-in-oakton avatar Apr 23 '15 20:04 tim-in-oakton

codewise-nicolas: Things are getting a bit too technical for me but I'll try to survive as long as possible...

My setup' is Win XP Pro with the ESP8266/Arduino .zip 1.6.1-p1 version - Board: Generic ESP8266 board, Programmer: esptools.

It certainly appears to upload in two blocks, as shown in tim-in-oakton's latest post (thanks for that Tim - I'd still like to have understood enough to have done that!) and it terminates with a clean "Done uploading" most of the time - there do seem to be random errors but nothing particularly consistent. I don't think it can be verifying as it goes - despite taking an incredibly long time from hitting upload to it finishing (admittedly my laptop is incredibly ancient and slow, but it takes several minutes - I can make a cup of coffee easily).

I think it's probably an issue with esptools but the occasional inconsistency makes me wonder if it it one single cause...

Thanks to all for the inputs so far.

On 23 April 2015 at 20:25, tim-in-oakton [email protected] wrote:

ABL - thanks for the Putty recommendation, I didn't even thin to use it for Serial!! Following are results, I uploaded the sketch, reset and reset again with the GPIO left high.....

Reset results after a “apparently successful flash upload” (Arduino IDE output): Sketch uses 206,664 bytes (39%) of program storage space. Maximum is 524,288 bytes. warning: unsupported baud rate: 115200, using 115200 Uploading 38224 bytes from C:\Users\timmeyer\AppData\Local\Temp\build2395631062301061534.tmp/Kegerator-v4.3.cpp_00000.bin to flash at 0x00000000 ...................................... Uploading 168488 bytes from C:\Users\timmeyer\AppData\Local\Temp\build2395631062301061534.tmp/Kegerator-v4.3.cpp_40000.bin to flash at 0x00040000

.....................................................................................................................................................................

/* connect PUTTY set for 76800bps, reset while still in “upload” mode w GPIO0 pulled low

/ ets Jan 8 2013,rst cause:1, boot mode:(1,7) / as expected, "I'm cool, waiting for code delivered over the Serial port" */

/* Now reboot/power cycle with the GPIO left to flow high – which normally SHOULD execute the previously uploaded code*/ load 0x40100000, len 30216, room 16 tail 8 chksum 0x2f load 0x3ffe8000, len 2860, room 0 tail 12 chksum 0x21 ho 0 tail 12 room 4 load 0x3ffe8b30, len 4988, room 12 tail 0 chksum 0x8a csum 0x8a

/* This is repeatable – power cycle 5X and see the same exact output 5X. I’ve tried it on three machines now (all Win7 with similar IDE downloads), no change in results.

Previously (last week) this EXACT process worked more than half the time – my code booted up and performed great. The only changes that I am aware of is my code grew modestly, I’ve written a bit more to the EEPROM (nowhere near what I’d expect to create wear), and the original module was transported from work & back (bit of mechanical jostling). */

Any other ideas? When life (work, wife, kids, etc) permits, I'm going to try to use a Linux box as the IDE host and uploader instead of the WIndows boxes used to date, and I'm planning on putting a pair of caps right on the PCB to make sure power is clean. I may also wire other GPIO leads high as a hedge.

I did verify with a 'sillyscope that my power is solid and clean - at least at the power supply (rock solid 3.3v, no noticeable ripple). I don't think that this is power issue now, but I'll throw some caps on to be sure.

Again - my environment was always a little flakey (maybe one upload in 5-10 failed), but it degraded over time to now be unusable - on any of the machines I'm using.

It FEELS like I hit some threshold where the upload process is breaking - setting the wrong jump vectors, putting the code in the wrong place..... dunno. Based on this info, any more thoughts, suggestions or observations? thanks all, I really appreciate the positive feedback- tim

— Reply to this email directly or view it on GitHub https://github.com/esp8266/Arduino/issues/95#issuecomment-95677532.

duncan-a avatar Apr 23 '15 20:04 duncan-a

Tim...

Alexander wrote in his first post in this thread:

" _My advice would be to grab PuTTY, monitor the serial port, and try to restart the module in to flash mode. _If you see a boot mode of anything but (1,7) in the debug output, something's wrong. First number is the boot type - 1 means boot from UART (aka flash over serial), 3 means boot from SPI flash (aka normal startup), 5 means boot from SDIO (aka...nobody's doing this yet.) The second number appears to be related to whether or not the chip started cleanly - 7 is good, anything less and you might not be able to flash."

You're seeing 3.7, which would (I think) imply that it's not reacting yo GPIO0 correctly and is remaining in "normal startup" mode - if I'm understanding correctly...

Yes? No? Maybe? Rapidly losing the will to live?

On 23 April 2015 at 22:28, Duncan Amos [email protected] wrote:

codewise-nicolas: Things are getting a bit too technical for me but I'll try to survive as long as possible...

My setup' is Win XP Pro with the ESP8266/Arduino .zip 1.6.1-p1 version - Board: Generic ESP8266 board, Programmer: esptools.

It certainly appears to upload in two blocks, as shown in tim-in-oakton's latest post (thanks for that Tim - I'd still like to have understood enough to have done that!) and it terminates with a clean "Done uploading" most of the time - there do seem to be random errors but nothing particularly consistent. I don't think it can be verifying as it goes - despite taking an incredibly long time from hitting upload to it finishing (admittedly my laptop is incredibly ancient and slow, but it takes several minutes - I can make a cup of coffee easily).

I think it's probably an issue with esptools but the occasional inconsistency makes me wonder if it it one single cause...

Thanks to all for the inputs so far.

On 23 April 2015 at 20:25, tim-in-oakton [email protected] wrote:

ABL - thanks for the Putty recommendation, I didn't even thin to use it for Serial!! Following are results, I uploaded the sketch, reset and reset again with the GPIO left high.....

Reset results after a “apparently successful flash upload” (Arduino IDE output): Sketch uses 206,664 bytes (39%) of program storage space. Maximum is 524,288 bytes. warning: unsupported baud rate: 115200, using 115200 Uploading 38224 bytes from C:\Users\timmeyer\AppData\Local\Temp\build2395631062301061534.tmp/Kegerator-v4.3.cpp_00000.bin to flash at 0x00000000 ...................................... Uploading 168488 bytes from C:\Users\timmeyer\AppData\Local\Temp\build2395631062301061534.tmp/Kegerator-v4.3.cpp_40000.bin to flash at 0x00040000

.....................................................................................................................................................................

/* connect PUTTY set for 76800bps, reset while still in “upload” mode w GPIO0 pulled low

/ ets Jan 8 2013,rst cause:1, boot mode:(1,7) / as expected, "I'm cool, waiting for code delivered over the Serial port" */

/* Now reboot/power cycle with the GPIO left to flow high – which normally SHOULD execute the previously uploaded code*/ load 0x40100000, len 30216, room 16 tail 8 chksum 0x2f load 0x3ffe8000, len 2860, room 0 tail 12 chksum 0x21 ho 0 tail 12 room 4 load 0x3ffe8b30, len 4988, room 12 tail 0 chksum 0x8a csum 0x8a

/* This is repeatable – power cycle 5X and see the same exact output 5X. I’ve tried it on three machines now (all Win7 with similar IDE downloads), no change in results.

Previously (last week) this EXACT process worked more than half the time – my code booted up and performed great. The only changes that I am aware of is my code grew modestly, I’ve written a bit more to the EEPROM (nowhere near what I’d expect to create wear), and the original module was transported from work & back (bit of mechanical jostling). */

Any other ideas? When life (work, wife, kids, etc) permits, I'm going to try to use a Linux box as the IDE host and uploader instead of the WIndows boxes used to date, and I'm planning on putting a pair of caps right on the PCB to make sure power is clean. I may also wire other GPIO leads high as a hedge.

I did verify with a 'sillyscope that my power is solid and clean - at least at the power supply (rock solid 3.3v, no noticeable ripple). I don't think that this is power issue now, but I'll throw some caps on to be sure.

Again - my environment was always a little flakey (maybe one upload in 5-10 failed), but it degraded over time to now be unusable - on any of the machines I'm using.

It FEELS like I hit some threshold where the upload process is breaking - setting the wrong jump vectors, putting the code in the wrong place..... dunno. Based on this info, any more thoughts, suggestions or observations? thanks all, I really appreciate the positive feedback- tim

— Reply to this email directly or view it on GitHub https://github.com/esp8266/Arduino/issues/95#issuecomment-95677532.

duncan-a avatar Apr 23 '15 20:04 duncan-a

@duncan-a something else probably has your serial port captured - I find it helps to unplug, reboot, start PuTTY, and then plug in. Windows doesn't make that easy. I'm happy to set up a Teamviewer session or something to help debug, if you'd like!

@tim-in-oakton yep, @duncan-a is correct: boot mode (3,7) is a normal boot, so your GPIOs are not being pulled the way they need to be pulled. https://github.com/esp8266/esp8266-wiki/wiki/Boot-Process details this a bit - you want UART mode, which is GPIO15 low, GPIO0 low, and GPIO2 high.

abl avatar Apr 24 '15 06:04 abl

don´t connect GPIO2 to VCC, in boot-loader mode its an alternative TX connect it to VCC can damage the chip! see #92

Links2004 avatar Apr 24 '15 09:04 Links2004

Still, a 10k pull-up on GPIO2 has improved stability (both upload time and run time) in my case.

igrr avatar Apr 24 '15 09:04 igrr