Downloading and installing the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By behines
#85951 I confess that my problem statement isn't fully formed here. I am hoping that someone will be able to point me in a direction.

My situation is this.
1) I am working on a hobby project and have successfully used Arduino with a NodeMCU 1.0 board.
2) I am now trying to deploy my app onto a standalone ESP-12E module. I am stumped.

Background:
* I am well versed at this point in GPIO0/GPIO2/GPIO15, all of that.
* I am a professional embedded programmer and EE by trade. I've busted out my meters and oscilloscope and all that along the way. I mention this not out of any conceit, but just so you are aware that whatever mistakes I am making are not likely to be overly naive ones.

Situation:
1) I can talk to my ESP8266 with a FTDI cable. I see console messages at 74880 baud that say things like "boot mode (3,6)".
2) I *appear* to be able to successfully flash the device. I have used assorted tools, including the ESP8266 Download Tool, NodeMCU-PyFlasher, and the Arduino IDE. All of these appear to give successful flashes.
3) But when I go to reboot and then run my Arduino sketch (I am using Manual flash and reboot, not DTR/RTS, since the FTDI cable does not carry those signals over), it just fails. Boot loops or else gobbledy-gook on the console, depending on exactly what I try.

I fear that I may have pseudo-bricked the device? At one point during my efforts I told the Arduino IDE to Tools/Erase Flash/All Flash Contents.

Was that a mistake? Does this mean that I've deleted, for example, the nonOS-SDK?

Or did my "bare" ESP-12E come with no SDK at all and I need to install it?

I'm at the point of preparing to go back to bare bare metal and just going with the Espressif Getting Started guide, including possibly rebuilding the entire SDK. I have tried to reflash using the ESP8266 Download tool, but I don't currently understand all the "bin" and "blank" and "user" files you put into ESP8266 Download tool, and what values to use for addresses in the right-hand column.

I also took a wild stab in the dark at cloud-compiling my own NodeMCU build at NodeMCU-build.com, but after I flashed it, it fared no better - my Arduino sketch still dies after a reset.

I feel like somehow after I flash my Arduino sketch, the processor isn't restarting at the correct address. But I don't understand all the issues involved.

Any advice or tips out there? I've been at this for several days, and it's quite murky. I can't tell if I've hosed my device, or if I'm just doing something else wrong, or?? I could try another device, but the current device is now well-soldered into my project, and I'd be looking at a few hours to swap in another. My sense is that the device is just fine and that this is a software issue.

Thanks for any tips,
Brad
User avatar
By torntrousers
#85966 Maybe a power supply issue? If you're powering in the ESP from the FTDI adaptor that will be it. Flashing only requires about 30ma but there is a big spike in current draw of a few hundred milliamps when the ESP boots the firmware and if your power supply can't provide that quickly you can see those sort of problems.
User avatar
By behines
#86000 Wow, tomtrousers, I can hardly believe this, but you are right!

I had seen similar comments on the web, and had pooh-poohed them, and was about to post something that said "no, that can't possibly be it" and ask for further advice, but decided to try the definitive experiment - I took the exact same supply that was powering my NodeMCU and used it to power my standalone ESP-12E, and it worked!

I don't fully understand why - I am powering from a standalone 3.3V supply, using identical 3.3V switching power modules in both setups (albeit with slightly different circuitry on the input side of the switching power modules). But now I have something concrete to chase down.

I appreciate your taking the time to reply and inspiring me to do this experiment to "prove you wrong". Proved me wrong! Lesson learned. Thanks!
User avatar
By behines
#86014 Just to close out the story, I found the problem.

My power supply uses a center tap transformer. The connection to one of the two windings was bad. So in effect I was only getting AC power for half of each 17 ms AC cycle.

My filter capacitors were up to the task under flash load but not reboot load.

Fixing the bad connection made it work.

Thanks again for the tip.