Skip to content
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

ESP8266_Exception_decoder filter does not work as expected #207

Open
geekbozu opened this issue May 4, 2020 · 8 comments
Open

ESP8266_Exception_decoder filter does not work as expected #207

geekbozu opened this issue May 4, 2020 · 8 comments

Comments

@geekbozu
Copy link

geekbozu commented May 4, 2020

When monitoring serial output with the filter decoder active I would expect the stack trace to get re-written
Instead I get an output saying it can not find the .elf file for the build.
Looking harder it seems that the build directory is getting cleared on calling of monitor.

Not sure how to fix this, I tried forcing the elf file to read only as a work around which silenced the error but still got no updated stack trace information.

@stavultras
Copy link

stavultras commented Jun 4, 2020

PIO Version:

You're up-to-date!
PlatformIO 4.3.4 is currently the newest version available.

For me it does nothing at all. My settings:

build_type = debug
monitor_filters = esp8266_exception_decoder

It just outputs the regular ESP crash data:

Executing task: C:\Users\Ultras\.platformio\penv\Scripts\platformio.exe device monitor <

--- Available filters and text transformations: colorize, debug, default, direct, esp8266_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at http://bit.ly/pio-monitor-filters
--- Miniterm on COM5  115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

Exception (28):
epc1=0x4020f80f epc2=0x00000000 epc3=0x00000000 excvaddr=0x02900004 depc=0x00000000

>>>stack>>>

ctx: cont
sp: 3ffffd30 end: 3fffffc0 offset: 0190
3ffffec0:  3ffee770 00000020 00000010 3ffee770
3ffffed0:  00000000 00000001 00000000 4020aadc  
3ffffee0:  00000005 3fff0264 3ffee770 3ffee770
3ffffef0:  3ffee770 00000001 00000000 402068ea
3fffff00:  4020d791 00000bb8 3ffeea10 3ffeea10  
3fffff10:  3fffdad0 00000000 3ffe84fc 4020631b
3fffff20:  feefeffe feefeffe feefeffe feefeffe
3fffff30:  feefeffe feefeffe feefeffe feefeffe
3fffff40:  feefeffe feefeffe feefeffe feefeffe  
3fffff50:  feefeffe feefeffe feefeffe feefeffe
3fffff60:  feefeffe feefeffe feefeffe feefeffe
3fffff70:  feefeffe feefeffe feefeffe feefeffe  
3fffff80:  feefeffe feefeffe feefeffe feefeffe
3fffff90:  feefeffe feefeffe feefeffe 3ffeea10
3fffffa0:  3fffdad0 00000000 3ffe84fc 4020c7ec  
3fffffb0:  feefeffe feefeffe feefeffe 40100fbd
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3456, room 16 
tail 0
chksum 0x84
csum 0x84
va5432625
~ld

Not sure what I'm doing wrong.

Meanwhile, when I use the output in Arduino -> ESP Exception Decoder for the same .elf file, it decodes the data properly:

Exception 28: LoadProhibited: A load referenced a page mapped with an attribute that does not permit loads
PC: 0x4020f80f: ModesContainer::get(unsigned char) at lib\ModeAbstract/ModeAbstract.h line 12
EXCVADDR: 0x02900004

Decoding stack results
0x4020aadc: ModesContainersContainer::add(ModesContainer*) at lib\ModesContainersContainer\ModesContainersContainer.cpp line 7
0x402068ea: modesInit() at src\modes.cpp line 27
0x4020631b: setup() at src\main.cpp line 72
0x4020c7ec: loop_wrapper() at C:\Users\Ultras\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_main.cpp line 194

@sblantipodi
Copy link

still using the
monitor_filters = esp8266_exception_decoder, colorize
but it does not work.

nothing changed with the exception decoder or without.

@xsrf
Copy link

xsrf commented Feb 14, 2021

Doesn't work for me either with espressif8266@2.6.3 - output doesn't change 🤷‍♂️

@xsrf
Copy link

xsrf commented Feb 16, 2021

Okay, it actually does work, but I ran into two issues:

  • whenever you change platformio.ini, e.g. to edit monitor_filters the firmware/elf binary is deleted from the .pio\build directory. Without the binary the filter will just do nothing. The binary must be present the moment monitoring is started! So one has to rebuild and restart monitor after adding the filter!
  • It also won't work together with the time or colorize filter

@stavultras
Copy link

stavultras commented Feb 16, 2021

@xsrf I tried to rebuild the project many times without success after changing platformio.ini. The binary file was there and nothing was happening. Have no idea why.

Btw, it works fine with ESP32, but I guess it's another project and story.

@GOB52
Copy link

GOB52 commented May 22, 2021

@sblantipodi @xsrf

It also won't work together with the time or colorize filter

If you change the order of the monitor_filters, it might work.
see also platformio/platform-espressif32#545

@sblantipodi
Copy link

it worked for me by simply adding
build_type = debug

@saikek
Copy link

saikek commented Jul 13, 2021

You need to remember to compile / upload sketch before you debug, since it's using .elf file for mapping issue.
Also, as mentioned:

[platformio]
build_type = debug
monitor_filters = esp8266_exception_decoder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants