Post links and attach files for documentation here, also chat about these docs freely

User avatar
By weekendguy
#63632 I have used numerous ESP8266 modules, basically nodemcu (12) and Adafruit Huzzah with ZERO problems using the Arduino IDE. In fact it has been so rock solid that I have redesigned an Arduino/ESP8266 logging system to just run on the ESP alone. I though this would be a straightforward port. I have spent DAYS just trying to get some consistent behavior from one of 5 different boards. In general, any small code always runs fine. But at some point in size it fails. I have tried:

Installed 2.3.0 esp board package in ...\Arduino\hardware... etc
Ruled out hardware issues - using multiple boards of different types, pull ups/downs all added, 2A 5v PS used.
Re-loaded all libraries and tested each one with an small example program.
Commented out chunks of code at a time to try to incrementally identify a problem.

The best I have gotten is to have some portion of the code run somewhat, sometimes, and only on the Huzzah. About 4 out of 5 times the code will never come out of the flash uploader and try to boot. Once in a while it will boot but if I try to run any more than 10 lines of setup() code it will fail to come out of the flash loader. I found one situation where if I placed an early return; it would run, initialize the I2C display and display the splash screen, but if I tried to move the return; a few lines down it will not boot. Note that moving the return does not fail due to the additional code, it fails by not booting at all.

I have found some old posts on github that describe this type of behavior but I'm not well versed in the xtensa tools and I can't be sure its the same problem. And it does not make sense that 2.3.0 would still be carrying issues from 1-2 years ago.

Using the nodemcu boards always resulted in constant reboots every second. I finally pulled out a new Adafruit Huzzah and that gets a bit further (no repeated reboots - sometimes actually boots) but still can't see what is causing this issue. Dropping the upload speed to 57600 seemed to help but not consistently.

It looks to me like this is related to a flashing failure, a link memory map/alignment issue of some kind, or a uninitialized memory problem but I'm guessing. I have ruled out hardware after spending most of the weekend on the issue. I have written tons of microcontroller code professionally over the years but have only worked with the ESP variants for about 1+ year.

Any direction much appreciated. I'd like to be refining the code, not chasing development environment issues. Many thanks.
User avatar
By weekendguy
#63700 I'd like to say I know why all is now working, but I don't know why. I switched to the Huzzah and found that GPIO0 needed to be constantly jumpered to GND to download. Even still, I only got a clean download every 5 times using 57600 baud rate.

I finally decided to try the nodemcu boards again because I was suspiscious of the USB/TTL cable on the Huzzah. Tada! I'm back with working hardware again - I really can't explain it, other than I may have reloaded the development environment again.

So I now have my entire Uno codeset ported and apparently working - still need to connect the remaining I2C devices. I will say it's very nice not needing a RTC since I can grab the time via NTP using the wifi.

Sorry for the exasperated post.