So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Hairyloon
#85378 I've uploaded my sketch to the ESP and it doesn't do what I expected, but instead says this:

Code: Select allException (0):
epc1=0x4021aa3c epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000


ctx: sys
sp: 3fffed90 end: 3fffffb0 offset: 01a0
3fffef30:  4023bc86 3fffdab0 00000000 3fffdcb0 
3fffef40:  3ffef600 3fffdad0 3fff0240 4020f96f 
3fffef50:  40000f49 40000f49 3fffdab0 40000f49 
3fffef60:  40000e19 40001878 00000002 00000000 
3fffef70:  3fffff10 aa55aa55 000000ed 401048b9 
3fffef80:  401048bf 00000002 00000000 2e003266 
3fffef90:  4010000d 746e6f66 6674742f 6d782e00 
3fffefa0:  402338a0 3fffef3c 40233859 3fffff38 
3fffefb0:  3fffffc0 00000000 00000000 feefeffe 

Followed by an endless stream of "feefeffe"...
It seems to do this irrespective of what I load it with, so I think the module is dud, but I thought I would seek a second opinion before I bin it, because clearly it is not completely dead.
User avatar
By gsimon75
#85469 Don't despair, most probably your chip is OK.
This crashloop happens when the normal chip initialization fails for some reason, and so a reset occurs, then again, and again, and so on. But this means that the CPU is OK and the flash is most probably OK.

The most probable cause for this is a weak power supply. At initialization, when the wifi transceiver is being powered on, it consumes a hell lot of power, so if you have a weaker power supply (like a partially drained battery), it can draw so much current that the voltage drops from the nominal 3.3V below the minimal 2.5V, an there you have a power glitch. If this happens with the module in some circuit, try to power it up separately.

Another probable cause is a noisy power supply, like most switching mode buck-converter voltage regulators. Try to add two capacitors in parallel the power line, as near to the ESP8266 as possible: a 10-50 uF electrolytic and a 20..100 nF ceramic. The big one helps buffering out the bigger power surges, the smaller one reduces the noise somewhat.

A third possibility is a slowly rising power. The ESP8266 powers on at 2.5V, but the serial eeproms usually start at 2.7V, so if the power rises so slowly that the CPU tries to access the eeprom but it's not yet ready, that can cause trouble. When you try to power on the module separately, pull the CHIP_EN input to high with a 10k resistor (as usual), but initially short it to ground (I mean manually), and only remove this after you switched on the power.

And last the phenomenon I encountered, after doing all those above :).

When I leave the ADC pin just floating, the board boots up fine every time. When I connect the ADC pin to some analog input (in my case, between 0.5V and 1V, clamped below 1V by diodes for safety), then it doesn't boot and produces a crashloop similar to your case.

Now, the ADC can be used for measuring the voltage of this pin, but also for measuring the Vcc, and about this case the ESP8266EX Datasheet says (at "4.9 ADC"):

Measure the power supply voltage of VDD3P3 (Pin3 and Pin4).
Hardware Design: TOUT must be floating.
When vdd33_const = 0xff, the power voltage of Pin3 and Pin4 will be tested by the internal self-calibration process of ESP8266EX itself. RF circuit conditions should be optimized according to the testing results.

So, my suspicion is that either during this internal self-calibration, or somewhere in the framework code I use (PlatformIO) there is a Vcc measurement, and then it causes a failure if the ADC pin isn't floating freely.

I'll do some more investigating about what are the exact conditions of the ADC pin that causes my crashloop, but yours can easily be because of another cause.

Anyway, check your power supply and try to power up the module separately. It's much easier to pinpoint a problem if you can find a 'known-good' setup and then try to change it towards the real environment step-by-step :).

Good luck!
User avatar
By Hairyloon
#87740 Thank you for the suggestion, and sorry that I've taken so long to get back to you, but I hadn't noticed the reply.

The circuit works fine with other, nominally identical modules, so I think it is not the power, and it's an ESP01, which doesn't have the ADC.

I think that the module is fried in some way, not least because I seem to have fried another couple that now behave in much the same way.

Ah well, they're cheap, it's not the end of the world.
User avatar
By Hairyloon
#87858 Since I've got a few of these dodgy modules now, and I just happened to plug one in that is behaving slightly less badly, I thought I'd post up another possible clue: this one runs an erratic loop before descending into feefeffe.
ets Jan 8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 3456, room 16
tail 0
chksum 0x84
csum 0x84

I say "Erratic" because it doesn't always do the same: just occasionally it will run the programme that it is supposed to.