-
• #2
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
-
• #3
Shame on me, I didn't even know anything about this debugger.
Anyway, its working on ESP32, what a crazy world ;-)>hello() 1 3 ...r b='World';console.log(1);debugger;console.log(2),foo(bar(a... ^ debug>info locals Locals: -------------------------------- a : "Hello" b : "World" Execution Interrupted at line 3 col 44 ...r b='World';console.log(1);debugger;console.log(2),foo(bar(a... ^ in function "hello" called from line 1 col 7 hello() ^ >
-
• #4
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. -
• #5
Is there any way to debug my code externally? Like some tool using a virtual machine or something like that?
-
• #6
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).
-
• #7
;-)... a nice, new 'definition' of in-circuit debugger. I like that very much.
-
• #8
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.
-
• #10
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 :)
-
• #11
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.
Anytime i trie to use the debugger in any code i get this:
Is it just some bug or am i doing something wrong?