-
-
Notifications
You must be signed in to change notification settings - Fork 637
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
Backtrace decoder for ESP32 #105
Comments
is there any way to back-trace in ESP-IDF |
I would greatly appreciate this functionality! |
I briefly looked at the implementation of monitor in PlatformIO. It uses miniterm from PySerial, therefore, it is not easy to extend it by post-processing of the output unless we change PySerial or PlatformIO ships its own monitor. |
would also be interested |
me too |
2 years later and this issue is still open... Oh well I guess I wiill have to keep on using the horrible Arduino IDE to debug my ESP32 Guru Meditations. |
It keeps amazing me how the Arduino IDE keeps ahead on PlatformIO on some vital points, like this one. I do edit en Visual Code editor with PlatformIO Plugin, try to compile and run in PlatformIO, but then revert to Arduino IDE to understand those crashes. So one could call this IIDDEE-Platform development. Almost like Turbo, but really it feels like using the bird in the Flintstones putting its beak on the rock-record since I know it will do the job... It feels backward indeed ... |
Guys, again this is ridiculous that such an important feature is simply left untouched. |
It is, but it would require a significant change to the PIO Serial (e.g. hack the MiniTerm or implement a custom one), so I understand it can take a while to implement. However, I don't understand why there is no reaction from the PIO maintainers for over a year... |
I would honestly settle for a copy and paste solution, even that initially would be useful. |
Try janLo/EspArduinoExceptionDecoder... (actually, the me21 fork is supposed to be better for ESP32) if you copy the stacktrace to a file as suggested in the readme, and then run I have used luffykesh/EspExceptionDecoder-CLI in the past, but it needs java. |
Since PlatformIO currently uses Python3, it should be possible to use contextlib.redirect_stdout around the call of miniterm in the PlatformIO core. Then a custom file-like object could do the translation. However, this requires a change to the platform API - it has to be able to provide a custom post-processor. Who should I contact with such a request/consultation? |
It's super-annoying but here's what I use as a workaround:
Replace |
I personally, and suspect many others would also be very interested in having this added to PlatformIO :D thanks for the great work so far !! |
Thanks to @Tasssadar 's great contribution this issue has been finally resolved! We need some feedback/testing before making the final release of PlatformIO Core 4.3 and this dev-platform. Please re-test:
See documentation https://docs.platformio.org/en/latest/core/userguide/device/cmd_monitor.html#filters |
This works a treat when the upstream dev-platform doesn't break things. On a small demo script, everything went off without a hitch, but when compiling and flashing a larger project (that works fine on the stable platform) something goes wrong. I get a bootloop with garbage coming over the serial line. |
Hi @LeedanJohnson ! The upstream should work as well, could you please provide more details or even open a new issue? |
EDITI tried to replicate the issue after writing the below, so that I could give more details and context, but it worked now. Perhaps there was something I had configured incorrectly. If the issue manifests again, I will make another reply to the thread. Thanks! Initial CommentI'd love to supply more details here, but I really don't know what details to provide. If I change that to 'platform = https://github.com/platformio/platform-espressif32.git', the project still compiles and will upload, but will bootloop and spit garbage over the serial line. Interestingly enough, if I purposefully introduce an exception early on in the program, the same project will start up and run as intended (hitting the exception, and dumping the registers before restarting). |
The issue is back again, with the same behaviour, although I'm not getting the garbled text over serial now. The following is what comes over serial. The second type of boot loops forever. rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) |
@LeedanJohnson What framework/board do you use? |
I think this will answer those questions, if not let me know. [env:esp32dev] |
I have the same issue. Version:
Config:
Any ideas? |
|
TL; DR, Basically just add one line to your platform.ini
Wouldn't it be fantastic if this could somehow be the default... |
What would cause |
@tablatronix what is your macOS version? Try to remove |
I am not using vscode, cli, but I will poke around a bit in python |
You don't need VSCode, just remove those folders and use installer script https://docs.platformio.org/en/latest/core/installation.html#super-quick-mac-linux. It seems you installed PlatformIO Core globally where there is an outdated |
As a breadcrumb for others, if you're adding the filter and it's not doing anything, make sure you have |
See [comment][1]. Do not forget to build in debug-mode. For example in PlatformIO IDE, select as project task 'Advanced' → 'Pre-Debug'. See also [here][2]. To decode backtraces from the Wokwi serial monitor, one can use [this python script][3]. [1]: platformio/platform-espressif32#105 (comment) [2]: https://docs.platformio.org/en/latest/projectconf/build_configurations.html#build-configurations [3]: https://github.com/me21/EspArduinoExceptionDecoder
See [comment][1]. Do not forget to build in debug-mode. For example in PlatformIO IDE, select as project task 'Advanced' → 'Pre-Debug'. See also [here][2]. To decode backtraces from the Wokwi serial monitor, one can use [this python script][3]. [1]: platformio/platform-espressif32#105 (comment) [2]: https://docs.platformio.org/en/latest/projectconf/build_configurations.html#build-configurations [3]: https://github.com/me21/EspArduinoExceptionDecoder
See [comment][1]. Do not forget to build in debug-mode. For example in PlatformIO IDE, select as project task 'Advanced' → 'Pre-Debug'. See also [here][2]. To decode backtraces from the Wokwi serial monitor, one can use [this python script][3]. [1]: platformio/platform-espressif32#105 (comment) [2]: https://docs.platformio.org/en/latest/projectconf/build_configurations.html#build-configurations [3]: https://github.com/me21/EspArduinoExceptionDecoder
See [comment][1]. Do not forget to build in debug-mode. For example in PlatformIO IDE, select as project task 'Advanced' → 'Pre-Debug'. See also [here][2]. To decode backtraces from the Wokwi serial monitor, one can use [this python script][3]. [1]: platformio/platform-espressif32#105 (comment) [2]: https://docs.platformio.org/en/latest/projectconf/build_configurations.html#build-configurations [3]: https://github.com/me21/EspArduinoExceptionDecoder
See [comment][1]. Do not forget to build in debug-mode. For example in PlatformIO IDE, select as project task 'Advanced' → 'Pre-Debug'. See also [here][2]. To decode backtraces from the Wokwi serial monitor, one can use [this python script][3]. [1]: platformio/platform-espressif32#105 (comment) [2]: https://docs.platformio.org/en/latest/projectconf/build_configurations.html#build-configurations [3]: https://github.com/me21/EspArduinoExceptionDecoder
See [comment][1]. Do not forget to build in debug-mode. For example in PlatformIO IDE, select as project task 'Advanced' → 'Pre-Debug'. See also [here][2]. To decode backtraces from the Wokwi serial monitor, one can use [this python script][3]. [1]: platformio/platform-espressif32#105 (comment) [2]: https://docs.platformio.org/en/latest/projectconf/build_configurations.html#build-configurations [3]: https://github.com/me21/EspArduinoExceptionDecoder
fix for extracting LittleFS image content
There is a backtrace decoder for ESP32 which is installed in Arduino IDE: https://github.com/me-no-dev/EspExceptionDecoder
And another CLI backtrace decoder written in Python: https://github.com/janLo/EspArduinoExceptionDecoder
It would be nice to use it from Platformio IDE somehow. Serial port monitor is already there, it should be possible to copy&paste the backtrace.
The text was updated successfully, but these errors were encountered: