Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soft WDT reset on interrupts #5885

Closed
6 tasks done
CRCinAU opened this issue Mar 16, 2019 · 14 comments
Closed
6 tasks done

Soft WDT reset on interrupts #5885

CRCinAU opened this issue Mar 16, 2019 · 14 comments

Comments

@CRCinAU
Copy link

CRCinAU commented Mar 16, 2019

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: Wemos D1 Mini clone
  • Core Version: 2.5.0
  • Development Env: Platformio
  • Operating System: Fedora 29

Problem Description

When using interrupts to count transitions (CHANGE), I get a stack trace and the program crashes. Have also tried with FALLING, but still same issue. I believe I've marked everything I need.

MCVE Sketch

#include <Arduino.h>
#define PIN_UP_LED D6
#define PIN_DOWN_LED D7

volatile uint8_t downChanges = 0;
volatile long lastDownChange = 0;
volatile uint8_t upChanges = 0;
volatile long lastUpChange = 0;

void ICACHE_RAM_ATTR handleUpInterrupt() {
    if ( millis() > (lastUpChange + 50 ) ) {
        upChanges++;
    }
    lastUpChange = millis();
}
void ICACHE_RAM_ATTR handleDownInterrupt() {
    if ( millis() > (lastDownChange + 50 ) ) {
        downChanges++;
    }
    lastDownChange = millis();
}

void setup() {
    pinMode(PIN_UP_LED, INPUT);
    pinMode(PIN_DOWN_LED, INPUT);
    attachInterrupt(digitalPinToInterrupt(PIN_UP_LED), handleUpInterrupt, CHANGE);
    attachInterrupt(digitalPinToInterrupt(PIN_DOWN_LED), handleDownInterrupt, CHANGE);
}

void loop() {
    Serial.print("upChanges = "); Serial.println(upChanges);
    Serial.print("downChanges = "); Serial.println(downChanges);
    Serial.print("PIN_UP_LED = "); Serial.println(digitalRead(PIN_UP_LED));
    Serial.print("PIN_DOWN_LED = "); Serial.println(digitalRead(PIN_DOWN_LED));
    bool UpLED = digitalRead(PIN_UP_LED);
    bool DownLED = digitalRead(PIN_DOWN_LED);
    delay(1000);
}

Debug Messages

upChanges = 0
downChanges = 1
PIN_UP_LED = 0
PIN_DOWN_LED = 1
upChanges = 0
downChanges = 0
PIN_UP_LED = 0
PIN_DOWN_LED = 1
Soft WDT reset
>>>stack>>>
ctx: sys
sp: 3fffe840 end: 3fffffb0 offset: 01b0
3fffe9f0:  a8754a02 e57f7f14 eb760033 84485d46
3fffea00:  0ac58f04 473df3bd f952d0f4 d97ca509
3fffea10:  216376d3 1ff89eb4 94cb59b3 eeb8787f
3fffea20:  17c747e3 067efc3d 1ac20709 bd075939
3fffea30:  c09b5533 ef5e94fa 01c3d221 f8945262
3fffea40:  cf273551 08b79e6a 45da4530 6cd259d3
3fffea50:  d8aeaf85 0ac58f04 473df3bd 1764eb77
3fffea60:  4000b5f9 00000008 00000038 3fffeb40
3fffea70:  00000008 3fffeb40 6b2c7e7e c0ef43de
3fffea80:  c19fbe5f e0cfdd8f 0cbf8439 1a248ceb
3fffea90:  37158cc6 d11e1e14 8bd5371f 77c2764c
3fffeaa0:  158e4cfb c6f1b776 e7c9a310 a775e4c8
3fffeab0:  477a0211 e5fcafa3 eb760033 84485d46
3fffeac0:  1ac20709 bd075939 067efc3d 201135ec
3fffead0:  5b095531 a2d390d5 2c15c1e2 3070a2b4
3fffeae0:  eeb8787f 94cb59b3 1ff89eb4 3ae22c38
3fffeaf0:  216376d3 34f7b3d2 a4956504 f221ceb7
3fffeb00:  4000b6c4 3fffeb40 3fffed10 ffffffff
3fffeb10:  3fffd644 3fffeb20 00000008 3a432ea6
3fffeb20:  00000000 a0020000 4000a333 3fffec48
3fffeb30:  3fffed10 3fffec28 3fffed60 ffffffff
3fffeb40:  68f807f7 80112c0b a28d0b9c 86398b25
3fffeb50:  6b2ffae3 00000400 00000000 8e70d1a5
3fffeb60:  d6758147 92b28e23 16deec43 47b9bcf8
3fffeb70:  00000080 00000000 00000000 00000000
3fffeb80:  00000000 00000000 00000000 00000000
3fffeb90:  00000000 00000000 a0020000 3fffec20
3fffeba0:  4000ba18 3fffec20 00000001 3ffedcbf
3fffebb0:  3fffed10 40100384 3fffc258 00000022
3fffebc0:  3fffc200 40100384 3fffc258 4000050c
3fffebd0:  4000b804 00000030 00000000 ffffffff
3fffebe0:  3f383d3e 393a3a6c 5c5c6d39 5c5c5c5c
3fffebf0:  5c5c5c5c 5c5c5c5c 5c5c5c5c 5c5c5c5c
3fffec00:  5c5c5c5c 5c5c5c5c 5c5c5c5c 5c5c5c5c
3fffec10:  5c5c5c5c 5c5c5c5c 5c5c5c5c 5c5c5c5c
3fffec20:  3fffebe0 3fffed10 5c5c5c5c 5c5c5c5c
3fffec30:  5c5c5c5c 5c5c5c5c 5c5c5c5c 5c5c5c5c
3fffec40:  00000040 00000014 5c5c5c5c 5c5c5c5c
3fffec50:  3fffec10 3fffecf0 3fffece0 ca3d70a3
3fffec60:  3fffecb8 3fffed10 4000ba40 3fffed74
3fffec70:  0000046f 3fffecbc 00000004 4010011c
3fffec80:  3ffedcbf 0000000a 00000000 40100448
3fffec90:  3fffecd0 3fffecf0 4000b7a0 0000000a
3fffeca0:  4000b7eb 3fffecd8 3fffc258 4000050c
3fffecb0:  3ffedcbf 0000000a 3fffecf0 00000014
3fffecc0:  4000b7fa 3ffedcbf 3ffedc98 00000011
3fffecd0:  3ffedc98 3fffece0 00000011 00000004
3fffece0:  02000000 ffffffac 0000000f 3ffee2c8
3fffecf0:  652eb866 855f7c4c 8e62c9a5 52a2afbb
3fffed00:  e8a34d28 00000030 00000017 ffffffff
3fffed10:  8e70d1a5 d6758147 92b28e23 16deec43
3fffed20:  47b9bcf8 00000003 3ffee6f0 fffffdff
3fffed30:  3fffed60 4000b872 0000000c 3ffedd14
3fffed40:  00000002 00000014 0000000a 00001000
3fffed50:  3ffedc98 00000017 60000200 42da0000
3fffed60:  75f73f08 a99ac0e1 f64ced20 d1cf807b
3fffed70:  409daa6a 00000006 00000005 ffffff80
3fffed80:  40243ea6 3ffee2c8 4023ea4c 4023e6ac
3fffed90:  3ffefc2c 3ffedcbf 3ffedc98 00000011
3fffeda0:  00001000 4023e6ac 4023ea4c 4023e6ac
3fffedb0:  3ffedd00 3ffedcbf 40243e3d 0000000a
3fffedc0:  3fff0027 3ffee2c8 3ffedcbf 3ffedc98
3fffedd0:  40244aca 3ffeee58 4023ea4c 4023e6ac
3fffede0:  00000011 00000030 00000010 ffffffff
3fffedf0:  4023eaa8 402540e8 3ffedb78 ffffffef
3fffee00:  401063a3 00000000 00000000 000000b0
3fffee10:  00000000 00000000 00000000 00000000
3fffee20:  4023dff0 3ffee268 3ffefc2c 00000030
3fffee30:  3ffee2c8 4023dfb4 3ffee2c8 00000000
3fffee40:  4023ea45 3ffee2c8 00000000 4023e6ac
3fffee50:  4023e82f 3ffee2c8 3ffedd32 4000050c
3fffee60:  40000f68 00000030 00000010 ffffffff
3fffee70:  40000f58 00000000 00000020 00000000
3fffee80:  00004bc6 4023c524 3ffee988 00000000
3fffee90:  00000000 3ffef4dc 00000000 3fffdab0
3fffeea0:  00000000 3fffdcb0 3ffee9c8 00000030
3fffeeb0:  00000000 4023c1ae 3ffee170 00000000
3fffeec0:  4023e6ac 4bc6a7f0 00000bec 60000600
3fffeed0:  4025bb20 3ffefc2c 4023e6b6 3ffee170
3fffeee0:  4023c257 3ffee170 40100256 3020c49b
3fffeef0:  4023bfc9 3ffee188 3ffee9b0 002ea8ec
3fffef00:  60000600 00000002 3ffee988 402195dc
3fffef10:  4023c52d 000e773a 3ffee9b0 60000600
3fffef20:  4024cdc1 3ffee188 3ffee9b0 002e9297
3fffef30:  4024ce06 3fffdab0 00000000 3fffdcb0
3fffef40:  3ffee9d0 3fffdab0 00000000 4020d2d3
3fffef50:  40000f49 40000f49 3fffdab0 40000f49
3fffef60:  40000e19 40001878 00000002 3fffffb0
3fffef70:  3fffff10 aa55aa55 000000ad 40104be8
3fffef80:  40104bee 00000002 3fffffb0 73757461
3fffef90:  4010000d 72703c3e 3c003e65 6572702f
3fffefa0:  40100dac 3fffef3c 40100d4d 3fffff38
3fffefb0:  3fffffc0 00000000 00000000 feefeffe
3fffefc0:  feefeffe feefeffe feefeffe feefeffe
3fffefd0:  feefeffe feefeffe feefeffe feefeffe
3fffefe0:  feefeffe feefeffe feefeffe feefeffe
3fffeff0:  feefeffe feefeffe feefeffe feefeffe
3ffff000:  feefeffe feefeffe feefeffe feefeffe
3ffff010:  feefeffe feefeffe feefeffe feefeffe
3ffff020:  feefeffe feefeffe feefeffe feefeffe
3ffff030:  feefeffe feefeffe feefeffe feefeffe
3ffff040:  feefeffe feefeffe feefeffe feefeffe
3ffff050:  feefeffe feefeffe feefeffe feefeffe
3ffff060:  feefeffe feefeffe feefeffe feefeffe
3ffff070:  feefeffe feefeffe feefeffe feefeffe
3ffff080:  feefeffe feefeffe feefeffe feefeffe
3ffff090:  feefeffe feefeffe feefeffe feefeffe
3ffff0a0:  feefeffe feefeffe feefeffe feefeffe
3ffff0b0:  feefeffe feefeffe feefeffe feefeffe
3ffff0c0:  feefeffe feefeffe feefeffe feefeffe
3ffff0d0:  feefeffe feefeffe feefeffe feefeffe
3ffff0e0:  feefeffe feefeffe feefeffe feefeffe
3ffff0f0:  feefeffe feefeffe feefeffe feefeffe
3ffff100:  feefeffe feefeffe feefeffe feefeffe
3ffff110:  feefeffe feefeffe feefeffe feefeffe
3ffff120:  feefeffe feefeffe feefeffe feefeffe
3ffff130:  feefeffe feefeffe feefeffe feefeffe
3ffff140:  feefeffe feefeffe feefeffe feefeffe
3ffff150:  feefeffe feefeffe feefeffe feefeffe
3ffff160:  feefeffe feefeffe feefeffe feefeffe
3ffff170:  feefeffe feefeffe feefeffe feefeffe
3ffff180:  feefeffe feefeffe feefeffe feefeffe
3ffff190:  feefeffe feefeffe feefeffe feefeffe
3ffff1a0:  feefeffe feefeffe feefeffe feefeffe
3ffff1b0:  feefeffe feefeffe feefeffe feefeffe
3ffff1c0:  feefeffe feefeffe feefeffe feefeffe
3ffff1d0:  feefeffe feefeffe feefeffe feefeffe
3ffff1e0:  feefeffe feefeffe feefeffe feefeffe
3ffff1f0:  feefeffe feefeffe feefeffe feefeffe
3ffff200:  feefeffe feefeffe feefeffe feefeffe
3ffff210:  feefeffe feefeffe feefeffe feefeffe
3ffff220:  feefeffe feefeffe feefeffe feefeffe
3ffff230:  feefeffe feefeffe feefeffe feefeffe
3ffff240:  feefeffe feefeffe feefeffe feefeffe
3ffff250:  feefeffe feefeffe feefeffe feefeffe
3ffff260:  feefeffe feefeffe feefeffe feefeffe
3ffff270:  feefeffe feefeffe feefeffe feefeffe
3ffff280:  feefeffe feefeffe feefeffe feefeffe
3ffff290:  feefeffe feefeffe feefeffe feefeffe
3ffff2a0:  feefeffe feefeffe feefeffe feefeffe
3ffff2b0:  feefeffe feefeffe feefeffe feefeffe
3ffff2c0:  feefeffe feefeffe feefeffe feefeffe
3ffff2d0:  feefeffe feefeffe feefeffe feefeffe
3ffff2e0:  feefeffe feefeffe feefeffe feefeffe
3ffff2f0:  feefeffe feefeffe feefeffe feefeffe
3ffff300:  feefeffe feefeffe feefeffe feefeffe
3ffff310:  feefeffe feefeffe feefeffe feefeffe
3ffff320:  feefeffe feefeffe feefeffe feefeffe
3ffff330:  feefeffe feefeffe feefeffe feefeffe
3ffff340:  feefeffe feefeffe feefeffe feefeffe
3ffff350:  feefeffe feefeffe feefeffe feefeffe
3ffff360:  feefeffe feefeffe feefeffe feefeffe
3ffff370:  feefeffe feefeffe feefeffe feefeffe
3ffff380:  feefeffe feefeffe feefeffe feefeffe
3ffff390:  feefeffe feefeffe feefeffe feefeffe
3ffff3a0:  feefeffe feefeffe feefeffe feefeffe
3ffff3b0:  feefeffe feefeffe feefeffe feefeffe
3ffff3c0:  feefeffe feefeffe feefeffe feefeffe
3ffff3d0:  feefeffe feefeffe feefeffe feefeffe
3ffff3e0:  feefeffe feefeffe feefeffe feefeffe
3ffff3f0:  feefeffe feefeffe feefeffe feefeffe
3ffff400:  feefeffe feefeffe feefeffe feefeffe
3ffff410:  feefeffe feefeffe feefeffe feefeffe
3ffff420:  feefeffe feefeffe feefeffe feefeffe
3ffff430:  feefeffe feefeffe feefeffe feefeffe
3ffff440:  feefeffe feefeffe feefeffe feefeffe
3ffff450:  feefeffe feefeffe feefeffe feefeffe
3ffff460:  feefeffe feefeffe feefeffe feefeffe
3ffff470:  feefeffe feefeffe feefeffe feefeffe
3ffff480:  feefeffe feefeffe feefeffe feefeffe
3ffff490:  feefeffe feefeffe feefeffe feefeffe
3ffff4a0:  feefeffe feefeffe feefeffe feefeffe
3ffff4b0:  feefeffe feefeffe feefeffe feefeffe
3ffff4c0:  feefeffe feefeffe feefeffe feefeffe
3ffff4d0:  feefeffe feefeffe feefeffe feefeffe
3ffff4e0:  feefeffe feefeffe feefeffe feefeffe
3ffff4f0:  feefeffe feefeffe feefeffe feefeffe
3ffff500:  feefeffe feefeffe feefeffe feefeffe
3ffff510:  feefeffe feefeffe feefeffe feefeffe
3ffff520:  feefeffe feefeffe feefeffe feefeffe
3ffff530:  feefeffe feefeffe feefeffe feefeffe
3ffff540:  feefeffe feefeffe feefeffe feefeffe
3ffff550:  feefeffe feefeffe feefeffe feefeffe
3ffff560:  feefeffe feefeffe feefeffe feefeffe
3ffff570:  feefeffe feefeffe feefeffe feefeffe
3ffff580:  feefeffe feefeffe feefeffe feefeffe
3ffff590:  feefeffe feefeffe feefeffe feefeffe
3ffff5a0:  feefeffe feefeffe feefeffe feefeffe
3ffff5b0:  feefeffe feefeffe feefeffe feefeffe
3ffff5c0:  feefeffe feefeffe feefeffe feefeffe
3ffff5d0:  feefeffe feefeffe feefeffe feefeffe
3ffff5e0:  feefeffe feefeffe feefeffe feefeffe
3ffff5f0:  feefeffe feefeffe feefeffe feefeffe
3ffff600:  feefeffe feefeffe feefeffe feefeffe
3ffff610:  feefeffe feefeffe feefeffe feefeffe
3ffff620:  feefeffe feefeffe feefeffe feefeffe
3ffff630:  feefeffe feefeffe feefeffe feefeffe
3ffff640:  feefeffe feefeffe feefeffe feefeffe
3ffff650:  feefeffe feefeffe feefeffe feefeffe
3ffff660:  feefeffe feefeffe feefeffe feefeffe
3ffff670:  feefeffe feefeffe feefeffe feefeffe
3ffff680:  feefeffe feefeffe feefeffe feefeffe
3ffff690:  feefeffe feefeffe feefeffe feefeffe
3ffff6a0:  feefeffe feefeffe feefeffe feefeffe
3ffff6b0:  feefeffe feefeffe feefeffe feefeffe
3ffff6c0:  feefeffe feefeffe feefeffe feefeffe
3ffff6d0:  feefeffe feefeffe feefeffe feefeffe
3ffff6e0:  feefeffe feefeffe feefeffe feefeffe
3ffff6f0:  feefeffe feefeffe feefeffe feefeffe
3ffff700:  feefeffe feefeffe feefeffe feefeffe
3ffff710:  feefeffe feefeffe feefeffe feefeffe
3ffff720:  feefeffe feefeffe feefeffe feefeffe
3ffff730:  feefeffe feefeffe feefeffe feefeffe
3ffff740:  feefeffe feefeffe feefeffe feefeffe
3ffff750:  feefeffe feefeffe feefeffe feefeffe
3ffff760:  feefeffe feefeffe feefeffe feefeffe
3ffff770:  feefeffe feefeffe feefeffe feefeffe
3ffff780:  feefeffe feefeffe feefeffe feefeffe
3ffff790:  feefeffe feefeffe feefeffe feefeffe
3ffff7a0:  feefeffe feefeffe feefeffe feefeffe
3ffff7b0:  feefeffe feefeffe feefeffe feefeffe
3ffff7c0:  feefeffe feefeffe feefeffe feefeffe
3ffff7d0:  feefeffe feefeffe feefeffe feefeffe
3ffff7e0:  feefeffe feefeffe feefeffe feefeffe
3ffff7f0:  feefeffe feefeffe feefeffe feefeffe
3ffff800:  feefeffe feefeffe feefeffe feefeffe
3ffff810:  feefeffe feefeffe feefeffe feefeffe
3ffff820:  feefeffe feefeffe feefeffe feefeffe
3ffff830:  feefeffe feefeffe feefeffe feefeffe
3ffff840:  feefeffe feefeffe feefeffe feefeffe
3ffff850:  feefeffe feefeffe feefeffe feefeffe
3ffff860:  feefeffe feefeffe feefeffe feefeffe
3ffff870:  feefeffe feefeffe feefeffe feefeffe
3ffff880:  feefeffe feefeffe feefeffe feefeffe
3ffff890:  feefeffe feefeffe feefeffe feefeffe
3ffff8a0:  feefeffe feefeffe feefeffe feefeffe
3ffff8b0:  feefeffe feefeffe feefeffe feefeffe
3ffff8c0:  feefeffe feefeffe feefeffe feefeffe
3ffff8d0:  feefeffe feefeffe feefeffe feefeffe
3ffff8e0:  feefeffe feefeffe feefeffe feefeffe
3ffff8f0:  feefeffe feefeffe feefeffe feefeffe
3ffff900:  feefeffe feefeffe feefeffe feefeffe
3ffff910:  feefeffe feefeffe feefeffe feefeffe
3ffff920:  feefeffe feefeffe feefeffe feefeffe
3ffff930:  feefeffe feefeffe feefeffe feefeffe
3ffff940:  feefeffe feefeffe feefeffe feefeffe
3ffff950:  feefeffe feefeffe feefeffe feefeffe
3ffff960:  feefeffe feefeffe feefeffe feefeffe
3ffff970:  feefeffe feefeffe feefeffe feefeffe
3ffff980:  feefeffe feefeffe feefeffe feefeffe
3ffff990:  feefeffe feefeffe feefeffe feefeffe
3ffff9a0:  feefeffe feefeffe feefeffe feefeffe
3ffff9b0:  feefeffe feefeffe feefeffe feefeffe
3ffff9c0:  feefeffe feefeffe feefeffe feefeffe
3ffff9d0:  feefeffe feefeffe feefeffe feefeffe
3ffff9e0:  feefeffe feefeffe feefeffe feefeffe
3ffff9f0:  feefeffe feefeffe feefeffe feefeffe
3ffffa00:  feefeffe feefeffe feefeffe feefeffe
3ffffa10:  feefeffe feefeffe feefeffe feefeffe
3ffffa20:  feefeffe feefeffe feefeffe feefeffe
3ffffa30:  feefeffe feefeffe feefeffe feefeffe
3ffffa40:  feefeffe feefeffe feefeffe feefeffe
3ffffa50:  feefeffe feefeffe feefeffe feefeffe
3ffffa60:  feefeffe feefeffe feefeffe feefeffe
3ffffa70:  feefeffe feefeffe feefeffe feefeffe
3ffffa80:  feefeffe feefeffe feefeffe feefeffe
3ffffa90:  feefeffe feefeffe feefeffe feefeffe
3ffffaa0:  feefeffe feefeffe feefeffe feefeffe
3ffffab0:  feefeffe feefeffe feefeffe feefeffe
3ffffac0:  feefeffe feefeffe feefeffe feefeffe
3ffffad0:  feefeffe feefeffe feefeffe feefeffe
3ffffae0:  feefeffe feefeffe feefeffe feefeffe
3ffffaf0:  feefeffe feefeffe feefeffe feefeffe
3ffffb00:  feefeffe feefeffe feefeffe feefeffe
3ffffb10:  feefeffe feefeffe feefeffe feefeffe
3ffffb20:  feefeffe feefeffe feefeffe feefeffe
3ffffb30:  feefeffe feefeffe feefeffe feefeffe
3ffffb40:  feefeffe feefeffe feefeffe feefeffe
3ffffb50:  feefeffe feefeffe feefeffe feefeffe
3ffffb60:  feefeffe feefeffe feefeffe feefeffe
3ffffb70:  40100459 feefeffe feefeffe feefeffe
3ffffb80:  c0036035 feefeffe feefeffe feefeffe
3ffffb90:  feefeffe feefeffe feefeffe 00000022
3ffffba0:  3fffc200 40100384 3fffc258 4000050c
3ffffbb0:  4000d31c 00000030 00000008 ffffffff
3ffffbc0:  40211500 00000000 00000000 0000000a
3ffffbd0:  00000000 000000c0 00000000 00000000
3ffffbe0:  0000000a 402601c9 3ffffe03 3ffffdc0
3ffffbf0:  3ffffe02 3ffffe60 40215918 00000030
3ffffc00:  40100459 feefeffe 40100256 272b020c
3ffffc10:  c0036035 feefeffe feefeffe feefeffe
3ffffc20:  ffffffff 0000000d 3ffef2cc 00000022
3ffffc30:  3fffc200 40100384 3fffc258 4000050c
3ffffc40:  40215918 00000030 00000004 ffffffff
3ffffc50:  40211169 3ffe8308 3ffffe60 3ffffe03
3ffffc60:  00000000 00000000 3ffffd70 3ffffdd9
3ffffc70:  0000000a 402601c9 00000001 3ffffdc0
3ffffc80:  3ffe8308 3ffffe60 40215918 00000030
3ffffc90:  40215918 3ffffe20 00000001 00000000
3ffffca0:  000000a0 3fff0450 000007e7 3ffffe60
3ffffcb0:  00000000 00000000 0000000a 00000000
3ffffcc0:  00000000 00000000 0000000a 00000000
3ffffcd0:  40215cac 00000064 0000002e 00000000
3ffffce0:  00000000 a0000000 00000000 0000001c
3ffffcf0:  00000000 3fff0450 00000000 00000000
3ffffd00:  3ffffe60 00000000 3ffffe60 402159de
3ffffd10:  0000a000 3ffffe03 0000001f 401053c1
3ffffd20:  40100459 0000000d 40211500 00000001
3ffffd30:  c0036035 00000001 3ffffe60 402159de
3ffffd40:  3ffffdc0 3ffffe02 3ffffd70 00000022
3ffffd50:  3fffc200 40100384 3fffc258 4000050c
3ffffd60:  40215e2f 00000030 00000018 ffffffff
3ffffd70:  00000000 4bc6a7f0 00000885 00000020
3ffffd80:  00000000 00000000 4bc6a7f0 00000000
3ffffd90:  c0036035 402601c9 40100256 bef9db22
3ffffda0:  00000000 3ffef2c8 3ffe89e0 00000022
3ffffdb0:  ffffffff 0000000d 3ffef2cc 4010011c
3ffffdc0:  40100459 00000030 00000000 40100448
3ffffdd0:  c0036035 3fffff10 0000000a 0000000a
3ffffde0:  40100459 00000002 ff000000 00000022
3ffffdf0:  3fffc200 40100384 3fffc258 4000050c
3ffffe00:  4020d45b 00000030 00000010 ffffffff
3ffffe10:  40100459 002d9263 00000000 00000000
3ffffe20:  40100459 00000000 00000000 fffffffe
3ffffe30:  c0036035 3fffc6fc 00000001 00000022
3ffffe40:  3fffc200 40100384 3fffc258 00000022
3ffffe50:  3fffc200 40100384 3fffc258 4000050c
3ffffe60:  4020341f 00000030 00000010 ffffffff
3ffffe70:  40203404 00000baa 3ffeefb8 00000000
3ffffe80:  3ffeefb8 0000086c 00000001 000003e8
3ffffe90:  00000000 00000002 0000033e 3ffef450
3ffffea0:  00000000 3ffeefb8 3ffef2fc 00000030
3ffffeb0:  00000000 3fffdad0 3ffef480 00000030
3ffffec0:  4020d3fa 00000000 00000001 00000001
3ffffed0:  3fffdab0 00000000 3fffd9d0 3ffef480
3ffffee0:  00000000 00000000 00000001 3ffef450
3ffffef0:  00000000 3fffdad0 3ffef480 00000030
3fffff00:  3ffef2c8 3ffef2d0 3ffef1c8 4020d85e
3fffff10:  00000000 4bc6a7f0 00000baa 3ffef2fc
3fffff20:  40105504 000e9a51 3ffef4dc 00000000
3fffff30:  3ffee9b0 3ffef4dc 3ffe8514 3ffef4dc
3fffff40:  3ffef0b8 3ffef2fc 4020d348 3fffefa0
3fffff50:  3ffef4dc 3ffef0b8 00000064 4020160f
3fffff60:  3ffef0b8 00000000 3ffef450 402030b4
3fffff70:  4020e954 4020e968 3ffef0b8 40202fda
3fffff80:  402028b8 00000000 4020e994 4020e97c
3fffff90:  00000000 00000000 00000001 3ffef480
3fffffa0:  3fffdad0 00000000 3ffef450 4020d3f4
<<<stack<<<
ets Jan  8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v951aeffa
~ld
@CRCinAU
Copy link
Author

CRCinAU commented Mar 16, 2019

I wonder if this is somewhat related to #5788 - even though I'm not using SPIFFS at all?

@CRCinAU
Copy link
Author

CRCinAU commented Mar 16, 2019

Debugging this further, the MCVE code actually works.... (if you add the missing Serial.begin(115200).

It looks like this dies when I do a check for OTA updates - which takes a couple of seconds to run.

Commenting out the OTA updates check has no effect and it still crashes.

If I wrap this in noInterrupts() and then interrupts() when I call the function that does the OTA http check, everything seems to be fine.

Is this expected?

It still crashes. and I don't have any idea why now :(

The full code I'm using is here:
https://git.crc.id.au/netwiz/ESP8266_Code/src/branch/master/GarageDoor

@CRCinAU
Copy link
Author

CRCinAU commented Mar 16, 2019

Pinging @d-a-v - he seems the master of interrupts on ESP8266 from everything I've read. This may be something simple that I just haven't been able to get my head around... Interrupts seem like unstable voodoo at the moment :(

@d-a-v
Copy link
Collaborator

d-a-v commented Mar 16, 2019

I am far from being the interrupt master :)
Please summarize your findings, update your MCVE, add Serial.begin()

actually works
still crashed

Right after boot, or after some time ?
If you suspect millis(), have you tried to replace/remove it just to verify whether it's this call ?
Have you had a look to Functional Interrupts ?

I suggest to use git version master branch instead of v2.5.0.

@CRCinAU
Copy link
Author

CRCinAU commented Mar 16, 2019

I started adding code to the MCVE - but couldn't make it crash again until I hit the entire program I have :(

When I'm looking at the serial output, I can see a number of lines print, then there's a pause, sometimes there's a flood of loops run, then there's the reset again. It seems to do 2 x loops, then the pause, then sometimes a rush, then reset.

I'm going to try putting in a whole lot more Serial.print debug into my code and see what I can figure out before the crash.

This is my first experiment in interrupts - so I might be missing lots - but I've been finding what I can from your replies to other interrupt bug reports to hopefully get it right.

Functional Interrupts - do you have any links to information about this? As mentioned, this is my first attempt here.

@CRCinAU
Copy link
Author

CRCinAU commented Mar 16, 2019

Interesting news - when running with Debug port serial and Core+WiFi debug, see the following output:

SDK:3.0.0-dev(c0f7b44)/Core:2.5.0=20500000/lwIP:STABLE-2_1_2_RELEASE/glue:1.1/BearSSL:6778687
sleep disable

Running at millis: 2169
upChanges = 0
downChanges = 240
PIN_UP_LED = 0
PIN_DOWN_LED = 1
wifi evt: 2

Running at millis: 3171
upChanges = 0
downChanges = 150
PIN_UP_LED = 0
PIN_DOWN_LED = 1

scandone

At this point, the crash happens.

This code has millis() commented out in the interrupt - so I'm guessing we can rule that bit out... However I do note that I seem to get many more interrupts than I was expecting... I didn't see that when filtering for +50ms - however I wonder if the frequency of interrupts may be part of the problem?

@devyte
Copy link
Collaborator

devyte commented Mar 16, 2019

This looks like either an issue in the user's code or another instance of #5784 .
I can't reproduce with latest git and the provided MCVE. Closing for now.
If something actionable is found, please report it here and this will be reopened.

@devyte devyte closed this as completed Mar 16, 2019
@laercionit
Copy link
Contributor

I have the same problem.

@d-a-v
Copy link
Collaborator

d-a-v commented Mar 21, 2019

Are you able to reproduce the bug with core-release-2.4.2,

or better with core-git-master ?
https://arduino-esp8266.readthedocs.io/en/latest/installing.html#using-git-version (#5882 #5816)

@laercionit
Copy link
Contributor

laercionit commented Mar 21, 2019

The problem does not occur in 2.4.2, only in 2.5.0
I'm preparing environment to test with the master now.

@CRCinAU
Copy link
Author

CRCinAU commented Mar 21, 2019

I have a completely non-verified hunch on the problem... As the crash always happened at the 'scandone' print, I think that something to do with the wifi library is blocking or causing interrupts to stack up. I did actually find out that the signal I was monitoring was dirty as hell causing ~40-60k interrupts per second (using CHANGE). That may well be related.

As I can't easily change the circuit, I ended up using a 'best out of 10' polling method instead.

@laercionit
Copy link
Contributor

Unfortunately I can not put the master to run, it seems that incorporated SDFat in it, this is generating several conflicts in my project.

@d-a-v
Copy link
Collaborator

d-a-v commented Mar 21, 2019

It is supposed to be compatible and this version will be in core-release-2.5.1 soon,
so please elaborate.

@Frogmore42
Copy link

I have been battling this issue trying to get 9-bit soft serial to work reliably. I finally got some output from the SDK logging and discovered this:
espressif/ESP8266_NONOS_SDK#90

It looks like the sdk doesn't work well when ISRs take longer than 50us, so high speed software serial is pretty much out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants