EspExceptionDecoder icon indicating copy to clipboard operation
EspExceptionDecoder copied to clipboard

How to make this work in PlatformIO

Open starlino opened this issue 5 years ago • 9 comments

Any help or hints appreciated.

starlino avatar Jan 14 '19 21:01 starlino

I also need

lucasromeiro avatar Jan 15 '19 13:01 lucasromeiro

me too!

proddy avatar Mar 10 '19 16:03 proddy

Me too! 😊

hputzek avatar Mar 23 '19 13:03 hputzek

Hi there ! some news about integration in PIO ?

MkLHX avatar Jul 04 '19 12:07 MkLHX

I used a Python implementation which reads the stack dump from a file. I launch it from Visual Studio Code directly. See https://github.com/proddy/EMS-ESP/blob/master/scripts/analyze_stackdmp.py

proddy avatar Jul 04 '19 13:07 proddy

Thanks proddy.

Q: Is there any way to get /.pio/build/debug/firmware_d1_mini.elf as a variable so it is not hard-coded in script ??

I guess one could just run a pre/post script: https://docs.platformio.org/en/latest/projectconf/advanced_scripting.html and read "$BUILD_DIR/${PROGNAME}.elf" OR just scan the /.pio/build/debug/ directory for the (single ?) .elf file

Anyone game to make an VS Code extension using the Python script ???

starlino avatar Jul 04 '19 15:07 starlino

@starlino yes you can get all the pio variables in python so easy to adjust. See the doc https://docs.platformio.org/en/latest/projectconf/advanced_scripting.html

Creating a VSC extension isn't that useful. If you want to debug, just copy & paste the stack dump into a file or pipe it into the python script either on a command line or double clicking the file in VSC

proddy avatar Jul 05 '19 08:07 proddy

You can use this indirectly to decode a stack trace from PlatformIO, but you do need Arduino installed. However you don't need to open your PlatformIO project in Arduino, so it is not too hard. Try this:

  1. Install in the Arduino tools as described.
  2. In PlatformIO build and run your project and get the stack trace ready in the terminal window. This generates the .elf file.
  3. Open in Arduino menu, Tools, ESP Exception Decoder.
  4. You are prompted for a .esp file. Open from /.pio/build/lolin-d32/firmware.elf (or similar)
  5. You are prompted for the trace - paste in from the terminal
  6. Read the decoded stack results. Capture

qurm avatar Oct 03 '20 08:10 qurm

Since version 4.3 platformio has monitor_filters including esp8266_exception_decoder and esp32_exception_decoder. These will automatically decode the exception.

liebman avatar Oct 03 '20 12:10 liebman