Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By Eyal
#13942 I have a few esp modules. This time I use an esp07 with a very simple program (in lua) that repetedly does
Code: Select allnode.dsleep(1*1000000)


After a few loops (10 to 30) it stops and at 115200 baud I see:

Code: Select allMEM CHECK FAIL!!!
Fatal exception (29):
epc1=0x40222768, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000044, depc=0x00000000


What is it trying to tell me?
Thanks
User avatar
By cal
#14147
Eyal wrote:I have a few esp modules. This time I use an esp07 with a very simple program (in lua) that repetedly does
Code: Select allnode.dsleep(1*1000000)


After a few loops (10 to 30) it stops and at 115200 baud I see:

Code: Select allMEM CHECK FAIL!!!
Fatal exception (29):
epc1=0x40222768, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000044, depc=0x00000000


What is it trying to tell me?
Thanks


Moin,

at program counter 0x40222768 an exception 29 StoreProhibitedCause was thrown by trying to write
to address 0x00000044. That area as write protected.
The PC value depends on the firmware you uploaded. Did you properly wire up rst and have a stable power supply?

Carsten
User avatar
By Eyal
#14150 AFAIK power should be good. It comes from the FTDI (probably fake) USB-TTL adaptor and is 3.5v.

On the reset pin I have a100n cap to gnd, a 10k pullup to vcc and a 330 connection to gpio16.

Reset seems to always work. in the sense that the boot (after deep sleep) always starts and gives the usual stats:

Code: Select all ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 32700, room 16
tail 12
chksum 0x91
ho 0 tail 12 room 4
load 0x3ffe8000, len 2716, room 12
tail 0
chksum 0xe7
load 0x3ffe8aa0, len 12552, room 8
tail 0
chksum 0x55
csum 0x55


It is then followed, when it hangs, with the exception notice. I have the boot pins connected as gpio0 and gpio2 to vcc, gpio15 to gnd. I tried pullups (12k or 2k) and direct connection. It will allways fail after a while with the same exception.

I should say that I often see the
Code: Select allMEM CHECK FAIL!!!

message even when it does not fail. What is this about? Could be elated?

I also connected 3xAA NiMH batteries. The voltage is a bit high at 3.9v, with same result (crash). Delivering power through a diode drops it to 3.3v (acceptable) and it still brashes but it takes a bit longer. I have other modules attached to an adjustable DC-DC which I set to different voltages (as low as 3.0v) and I still get failures.

I need to get a DSO to inspect the boot process and see if any power spike is causing a problem.

BTW, where do I find these exception codes documented? I could not find it in the usual doco (2A, 2B and 2C). Or should I just read the code?
User avatar
By cal
#14166 Moin,

I finally managed to hack my esp 01 for dsleep and now I get the same exception.
I got the exception info from

Xtensa ®
Instruction Set Architecture (ISA)
Reference Manual

But something does not fit.
The epc1 does indicate a problem in epc1=0x40222768 which according to my mapfile is inside pm_wait4wakeup
(Ignore that its called "u2" instead of "up", I am playing with symbols.)
But at that location is no memory write???

pm_wait4wakeu2():
40222740: 021226 beqi a2, 1, 40222746 <pm_wait4wakeu2+0x6>
40222743: 2f2266 bnei a2, 2, 40222776 <pm_wait4wakeu2+0x36>
40222746: ff1851 l32r a5, 402223a8 <pm_rtc2usec+0x8>
40222749: 010522 l8ui a2, a5, 1
4022274c: 62ec bnez.n a2, 40222776 <pm_wait4wakeu2+0x36>
4022274e: b6bb21 l32r a2, 4021023c <_irom0_text_start+0x23c>
40222751: 0020c0 memw
40222754: 4a2232 l32i a3, a2, 0x128
40222757: 143030 extui a3, a3, 0, 2
4022275a: a3cc bnez.n a3, 40222768 <pm_wait4wakeu2+0x28>
4022275c: 0020c0 memw
4022275f: 4a2242 l32i a4, a2, 0x128
40222762: 144040 extui a4, a4, 0, 2
40222765: ff3416 beqz a4, 4022275c <pm_wait4wakeu2+0x1c>
40222768: 270c movi.n a7, 2
4022276a: 0020c0 memw
4022276d: 4a2262 l32i a6, a2, 0x128
40222770: 106670 and a6, a6, a7
40222773: 034562 s8i a6, a5, 3
40222776: f00d ret.n

Carsten