Debugger causes wdt reset

Posted on
  • Anytime i trie to use the debugger in any code i get this:

    8          debugger;
     ets Jan  8 2013,rst cause:4, boot mode:(3,7)
    wdt reset
    load 0x40100000, len 2408, room 16
    tail 8
    chksum 0xe5
    load 0x3ffe8000, len 776, room 0
    tail 8
    chksum 0x84
    load 0x3ffe8310, len 632, room 0
    tail 8
    chksum 0xd8
    csum 0xd8
    2nd boot version : 1.6
      SPI Speed      : 80MHz
      SPI Mode       : QIO
      SPI Flash Size & Map: 32Mbit(512KB+512KB)
    jump to run user1 @ 1000

    Is it just some bug or am i doing something wrong?

  • The debugger should never have been included in ESP8266 builds, I'll see about taking it out. Due to the way it works it'll never be usable on ESP8266 I'm afraid. I'm unsure if it'd even work on ESP32.

    If you need it you're best off using one of the proper Espruino boards

  • Shame on me, I didn't even know anything about this debugger.
    Anyway, its working on ESP32, what a crazy world ;-)

    3       ...r b='World';console.log(1);debugger;consolĀ­e.log(2),foo(bar(a...
    debug>info locals
     a                    : "Hello"
     b                    : "World"
    Execution Interrupted
    at line 3 col 44
    ...r b='World';console.log(1);debugger;consolĀ­e.log(2),foo(bar(a...
    in function "hello" called from line 1 col 7
  • Great! It should also integrate with the IDE (albeit not for breakpoints).

    Just to clear up why there are issues: ESP8266 expects tasks to finish in under ~1 second, but the debugger works by keeping a task running and then handling user input via IRQs. The only solution would be to add proper multi-tasking to ESP8266 but then it'd realistically use too much RAM. It's the same reason you can crash the ESP8266 with while(1); where on Espruino boards you can just Ctrl+C out of it.

    ESP8266 used to be compiled with SAVE_ON_FLASH, which took out some features (including debug) to lower the flash memory usage. At some point that changed though, and it probably wasn't obvious that debugging started getting compiled in because of that.

  • Is there any way to debug my code externally? Like some tool using a virtual machine or something like that?

  • You could buy a proper Espruino WiFi board? If you then wanted to switch back to ESP8266 once it was working, there isn't much in the way of code to change (it's just the Wifi initialisation stuff).

  • ;-)... a nice, new 'definition' of in-circuit debugger. I like that very much.

  • Actually just to add you could compile Espruino for Linux or Raspberry Pi (maybe even windows with Ubuntu for Windows) and could run your code on that. Obviously there's no digital IO though.

  • digital IO though.

    @Gordon, can it be mocked? ...stubbed? least limited? ...if so, then that would be pretty cool, because a (unit and to a certain extent integration) testing can be done...

  • Well, I think pins D0 to D31 are in there, they just don't do anything. You could add your own custom code in jshardware.c for it and do whatever you wanted - but at some point it becomes far more simple to just use real hardware :)

  • I can confirm espruino for Linux compiles and runs on ubuntu on windows 10. It's great for testing things like websockets and using the filesystem code as you can edit the files from within windows and have them change in the windows sub-system.

    I also build the esp32 code within the sub-system - it's easier than starting a virtual machine that uses more resources.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Debugger causes wdt reset

Posted by Avatar for Stipser @Stipser