ESP-01 : What does "CUT HERE FOR EXCEPTION DECODER" mean?

I needed to make a change to an ESP-01 I have running in a project, but after I uploaded the code, I started seeing this (on the serial monitor) repeat every few seconds:

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Soft WDT reset

>>>stack>>>

ctx: cont
sp: 3ffffd70 end: 3fffffc0 offset: 01a0
3fffff10:  0031bd9b 3ffee554 00000010 00000001  
3fffff20:  40238a43 3ffee554 00000001 3ffee61c  
3fffff30:  3fffdad0 00000bf6 000000c8 4020103a  
3fffff40:  3fffdad0 0000000f 3ffee554 40201140  
3fffff50:  40205bac 00000000 40205bac 00000000  
3fffff60:  40205bac 00ffffff 40205bac 010a0a0a  
3fffff70:  40205bac 190a0a0a 00000000 feefeffe  
3fffff80:  3fffdad0 00000000 3ffee608 40201217  
3fffff90:  feefeffe feefeffe feefeffe feefeffe  
3fffffa0:  feefeffe feefeffe feefeffe 40202f3c  
3fffffb0:  feefeffe feefeffe 3ffe85e0 40100b51  
<<<stack<<<

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Here is what I've tried to troubleshoot the problem:

  1. I've tried FOUR different programmers
  2. THREE different ESP-01's
  3. Three different USB cables
  4. TWO different USB Hubs
  5. I tried to program them in Mac and Windows (via Virtual Machine)
  6. Minimal sketch - (just a blank Setup and Loop)

NOTHING is working... when they get in this mode, are they not able to be programmed anymore?

I guess I should mention that when I upload a sketch, it uploads just fine ... acts like it always does ... but then after the upload is finished, I get that text repeating over and over.

A blank sketch give the error, you write?

Post an image of your setup with a blank sketch loaded and the error being given, please.

There is something wrong in your code, triggering a soft watchDogTimer reset. This error occurs when there is a loop that takes longer than 1.5 Seconds to complete and in which the WDT is not reset.
yield(); resets the wdt and executed scheduled tasks.
delay() call yield() and yield is called at the end of loop() as well.
Find the long (or infinite) loop in your sketch and add yield() to that.

1 Like

The OP claims the error is generated by a blank sketch,

.

Sorry missed that.

Since it is about a ESP-01, there is not much chance that there is something connected to the GPIO pins causing this behavior, so what core are you using and what are the settings ?

1 Like

OK, I exaggerated a little on the blank sketch, I did have ONLY the Wifi connection code in there just to see if it could come up ... but when Deva_Rishi mentioned the delay issue ... I realized that I have a routine in there that someone told me to use instead of delay ... this is the routine:

void wait(unsigned long time) {
    unsigned long start=millis();
    while(millis()-start < time);
}

When I removed it and used delay instead, it is now working.

1 Like

Turns out, all I needed to do was add yield(); into the while loop and it doesn't crash anymore.

I had a suspicion.

And what would be the advantage of using that routine according to this 'someone'

Yep. I do use that sort of thing in case of microSeconds, since

delaMicroseconds();

does not incur yield()
and at times just a small delay might be useful and i guess to execute scheduled tasks can be a good use of it.

Well, in this case, the only reason for pausing at all is in the code that connects it to the WiFi:

void startWiFi() {
    int conn_tries = 0;
    WiFi.mode(WIFI_STA);
    WiFi.config(localIP,gateway,subnetMask);
    WiFi.begin(homeSSID, homePassword);
    while ((WiFi.status() != WL_CONNECTED) && (conn_tries++ < WIFI_RETRIES)) {
        wait(200);
    }
    if (WiFi.status() == WL_CONNECTED) {
        Serial.println("Wifi Connected");
        Udp.begin(port);
    }
    else {
        Serial.println("Wifi NOT Connected");
    }
}

Here is the modified wait() method

void wait(unsigned long time) {
    unsigned long start=millis();
    while(millis()-start < time) {
        yield();
    };
}

After that, it only really does three things ... when it gets UDP data, it echo's it on the serial port for the attached ATMEGA 328P-U chip which then does stuff and sends back over serial more data that the wifi then sends over UDP .... it's just a relay. It also sends the word 'ping' every 30 seconds so my Java program will know it's online. The 30 seconds in this case is using a non-blocking timer that I wrote.

VERY BASIC use case here... :relaxed:

1 Like

thanks to you @EasyGoing1, your answers were very helpful to me and thus, just thought to reply so the life of this page gets another 6 months.

Really appreciate your help.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.