-
-
Notifications
You must be signed in to change notification settings - Fork 515
feat: Exception Stack Trace Decoder for esp32 #1893
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
Conversation
Multi address decoder for esp32 boards with emphasised data output
kolipakakondal
commented
Feb 27, 2023
Hi @radurentea Could you add a screen recording to get a glimpse of this feature?
* fix: different version of tool I found a bug in which, the version of the tool in Arduino15 folder was different from the version the serial monitor was outputting, which would make the link unvalid (unreachable)
Added Screen Recording of the feature.
Also, I feel like I did not give a good enough reasoning behind this PR. I've made this feature with this discussion in mind: #58
This implementation is more for demoing purposes, since I'm not sure if it should be an external plugin or if it can be directly implemented into the ide.
If it receives the ok to be implemented directly into the ide, I can put more work into this PR, if not, I'm opened to suggestions on how to implement it as something else.
ubidefeo
commented
Apr 18, 2023
hi @radurentea
We've been discussing this internally for a bit and came to the conclusion that such a feature should not be part of the stock IDE 2, but it should be provided when a user decides to install it, or even better as an extension to the ESP32 platform.
As we try to find ways for developers to access useful features in IDE 2.0, we've investigated the VSIX way, since Theia supports VS Code extension in that format.
Unfortunately such layer won't be able to access things which are very useful.
You want to know which board is selected, installed cores etc, and since extensions won't communicate with the CLI daemon there are a lot of limitations towards implementing this feature.
I have had a chat with @kittaakos regarding this, but maybe this PR can start a conversation and maybe an RFC.
I know for a fact that we don't have the time right now to implement a 3rd party usable API, but it's something which has been on our plate for a while and we really see a great amount of value.
I personally would love to see Stack Decoder in IDE 2 :)
I'd also invite @alranel to chime in on the discussion.
frank26080115
commented
May 12, 2023
@radurentea can this be installed as some sort of overlay on top of existing IDE installations? As in, a set of files in a folder structure that the user has to simply copy and paste into an existing IDE installation directory? I looked at ed66479 and arduino-ide-frontend-module.ts and arduino-ide-frontend-module.js and it seems like this is the only file where you made insertions, the rest are new files.
Perhaps it isn't too bad having the user making a 17 line patch into one JS file to enable this feature? Maybe later a wizard can be created.
can this be installed as some sort of overlay on top of existing IDE installations?
I am not aware of any easy way of doing it. Also, it won't work with the current code base anymore, as the frontend code is directly calling server code. Here is an example.
@radurentea, I have different output from my ESP8266 board. Can you help me to try out your feature proposal? No matter what I copy-paste, I see no decoded output. What is the input of the Decode Box? I use 8d04969. Thanks!
My sketch:
void setup() { Serial.begin(9600); } void loop() { delay(10000); abort(); }
(Part of) the monitor output:
[...]
21:44:58.361 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
21:44:58.427 -> ��¡�z���8����
21:45:08.533 -> User exception (panic/abort/assert)
21:45:08.566 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
21:45:08.628 ->
21:45:08.673 -> Abort called
21:45:08.673 ->
21:45:08.673 -> >>>stack>>>
21:45:08.673 ->
21:45:08.695 -> ctx: cont
21:45:08.695 -> sp: 3fffff90 end: 3fffffd0 offset: 0010
21:45:08.750 -> 3fffffa0: 00002580 00000000 3ffee54c 4020104e
21:45:08.791 -> 3fffffb0: 3fffdad0 00000000 3ffee54c 402018ac
21:45:08.822 -> 3fffffc0: feefeffe feefeffe 3fffdab0 40100d19
21:45:08.888 -> <<<stack<<<
21:45:08.888 ->
21:45:08.920 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
21:45:08.985 -> �V��5�PT�p ����
21:45:19.083 -> User exception (panic/abort/assert)
21:45:19.116 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
21:45:19.180 ->
21:45:19.180 -> Abort called
21:45:19.212 ->
21:45:19.212 -> >>>stack>>>
21:45:19.212 ->
21:45:19.212 -> ctx: cont
21:45:19.244 -> sp: 3fffff90 end: 3fffffd0 offset: 0010
21:45:19.280 -> 3fffffa0: 00002580 00000000 3ffee54c 4020104e
21:45:19.340 -> 3fffffb0: 3fffdad0 00000000 3ffee54c 402018ac
21:45:19.374 -> 3fffffc0: feefeffe feefeffe 3fffdab0 40100d19
21:45:19.439 -> <<<stack<<<
21:45:19.439 ->
21:45:19.439 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
[...]
Hi @dankeboy36,
I've made the decoder as a prototype, unfortunately, it only works for the ESP32 modules. The ESP8266 have a different format.
I could add more logic and add the regex that is needed to work for ESP8266 as well, but I'm not sure how soon I could do that because currently I don't have my hands on that chip.
If you want to have a try at it yourself, you can check the Exception Decoder from the old IDE. This is what I used as a reference https://github.com/me-no-dev/EspExceptionDecoder/blob/master/src/EspExceptionDecoder.java
Just let me know!
I've made the decoder as a prototype, unfortunately, it only works for the ESP32 modules.
Hi, @radurentea! I tried it with my ESP32-S2 Pico after installing the core from https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json. It did not work for me with the same sketch content. Does this prototype work with an ESP32-S2 board?
Veriy and upload worked. The monitor prints nothing, and the board connection is permanently lost. Can somebody please help? I want to try out this example to understand how it works. Thank you!
stacktrace_decoder_esp32_s2.mp4
ubidefeo
commented
Jun 8, 2023
I am also unable to get the board to dump the stack after setting Debug Level to Verbose
any hint on why or how?
@dankeboy36 and I are both using an ESP32-S2 by Waveshare
Hello, thank you for your contribution. I will close this PR without accepting it. Please use https://github.com/dankeboy36/esp-exception-decoder instead with today's nightly IDE2 from https://www.arduino.cc/en/software#nightly-builds. It's a drop-in Arduino IDE extension that you can use. If you happen to have any issues, please report them at https://github.com/dankeboy36/esp-exception-decoder/issues/new.
If you do not agree with something, please ping me.
Uh oh!
There was an error while loading. Please reload this page.
Exception Stack Trace Decoder for esp32 boards with emphasised data output
Motivation
Decoding exception stack trace
Change description
Adds a component component similar stylistically with the serial monitor in which the user can paste the backtrace.
decoder.mp4
Other information
Based on the decoder from the old arduino ide (https://github.com/me-no-dev/EspExceptionDecoder)
Reviewer checklist