me-no-dev / EspExceptionDecoder

Exception Stack Trace Decoder for ESP8266 and ESP32
GNU General Public License v2.0
1.04k stars 137 forks source link

Do not decode ESP32 compiled with gcc8_4_0-esp-2021r2 #68

Closed cicciocb closed 2 years ago

cicciocb commented 2 years ago

When compiling with latest arduino-ESP32 2.0.1(using the compiler gcc8_4_0-esp-2021r2) an error message is shown "Decode failed".

Using the previous version of the compiler (using the compiler gcc8_4_0-esp-2021r1) works properly.

image

cicciocb commented 2 years ago

Finally the problem comes from xtensa-esp32-elf-gdb.exe that has not been compiled using static libraries so it miss many .dll to work

pilnikov commented 2 years ago

++

witnessmenow commented 2 years ago

Is this an ESP32 Core issue? Is there a issue raised over there?

I have an issue on 2.0.1 and I am basically lost without this 😄

cicciocb commented 2 years ago

@witnessmenow It is an issue with the compiler gcc8_4_0-esp-2021r2 that is part of the 2.0.1. The "xtensa-esp32s2-elf-gdb.exe" inside the folder has been compiled to be used with external dll that are missing in the folder (not statically compiled like the others .exe). Simply copy these 2 dll in the folder packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2\bin and voilà. gdb_dll_missing.zip

witnessmenow commented 2 years ago

Thanks @cicciocb

smuellener commented 2 years ago

@cicciocb where is this folder "packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2\bin" exactely? I am on arduino core 2.0.2 tag and can not find it in the folder ide\hardware\espressif\esp32. Thanks

cicciocb commented 2 years ago

@cicciocb where is this folder "packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2\bin" exactely? I am on arduino core 2.0.2 tag and can not find it in the folder ide\hardware\espressif\esp32. Thanks

Hi @smuellener, the folder is generally located here :

C:\Users\YOUR_NAME\AppData\Local\Arduino15

smuellener commented 2 years ago

I have the following folder as custom installation folder for the IDE: C:\Users\Public\arduino\ide. That resulted in having to copy the files into the following folder:

C:\Users\Public\arduino\ide\hardware\espressif\esp32\tools\xtensa-esp32-elf\bin

Thanks @cicciocb !

mcpicoli commented 2 years ago

The solution provided by @cicciocb worked nicely, thank you very much.

However, it would be much more preferable if someone could point to some official source for these DLLs, and/or instructions for downloading official binaries for them instead of a ZIP file.

I checked the files provided with Windows Defender and found nothing wrong or malicious about them, and decided to take some risk in downloading and using unsigned DLLs from an unknown source. Users in corporate environments, or dealing with sensitive data probably would not share my point of view.

Please let me be clear, I am NOT creating any suspicion about @cicciocb (thanks again), just pointing that it is not a good practice from a security standpoint.

Unfortunately I currently do not have the resources to find and post the solution for the problem I just pointed.

pgrawehr commented 2 years ago

It appears the bug has been fixed on master. With xtensa-esp32-elf-g++ (crosstool-NG esp-2021r2-patch2) 8.4.0 the exception decoder works again (without having to copy the files from the above zip)

me-no-dev commented 2 years ago

https://github.com/me-no-dev/EspExceptionDecoder/releases/tag/2.0.2 works for all

mcpicoli commented 2 years ago

Hi,

Just to help people avoiding all of the trouble I had to get this working. TL;DR: Manual Install is the way

Finally...

I believe that the board definition files from the official Espressif repository on Github are outdated, using the old toolchain, and the EspExceptionDecoder will never work "out of the box" using the standard, easy procedures of installation, until they're updated to use the newer toolchain.

Please note that this comment will be obsoleted the moment the definitions for the ESP32 boards are updated. Please try the usual "Arduino Board Manager" method before. It is valid as of today however (2022-03-03 11:47 UTC).

Edit.: Typo, comment about newer versions.