Page 1 of 1

[Resolved] GDB issue with ESP32-C3 and esp-idf-tools 2.9 beta 6 [IDFGH-5410]

Posted: Sun Jun 13, 2021 5:04 pm
by mschultz
Summary:

Code: Select all

riscv32-esp-elf-gdb --version
fails to run from Windows CMD shell (or by any other means)
When run, two dialogs appear with the following error messages:

Code: Select all

The code execution cannot proceed because libgcc_s_seh-1.dll was not found. Reinstalling the program may fix this problem.
The code execution cannot proceed because libstdc++-6.dll was not found. Reinstalling the program may fix this problem.
Detail:

The toolchain was installed using esp-idf-tools-setup-online-2.9-beta-06.exe.
The IDF 'master' branch was selected. Tools were installed to D:\ESP\.espressif and IDF to D:\ESP\esp-idf.
Before running the above, I set up as best I knew how to create a 'clean' install. I removed all ESP-IDF references from the environment (e.g. IDF_TOOLS_PATH), deleted (actually, backed up and moved) my original ESP-IDF installation, and removed all application links (shortcuts) from desktop and start menu.

GDB runs OK for other targets; for example, xtensa-esp32-elf-gdb --version runs as expected without any error reports.
idf.py and other ESP-IDF tools work as expected.

I experience the same problem if I perform the ESP-IDF installation using an earlier version of the installer. I tried an installation using esp-idf-tools-setup-online-2.5 following the clean install procedure mentioned above with similar results.

Another somewhat-related issue, this one with the Eclipse ESP-IDF plugin:
If I go to create a Eclipse 'debug configuration' for a project set up to target the ESP32-C3 using this procedure:
  • Select project (blink example) and target (esp32c3). Run a build and perform a test run to ensure project configuration is correct.
  • From eclipse menu: Run -> Debug configurations
  • From Create, manage and run configurations dialog - select ESP-IDF GDB OpenOCD Debugging. Click New launch configuration button (icon with blank page with '+', upper left-hand corner).
  • Debugger configuration dialog appears on right hand side. Select Debugger tab.
  • In GDB Client Setup section of Debugger tab dialog, Actual Executable textbox, the following is put in by default:
    D:\ESP\.espressif\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gdb.exe
    What I would expect to see here is:
    D:\ESP\.espressif\tools\riscv32-esp-elf\1.24.0.123_64eb9ff-8.4.0\riscv32-esp-elf\bin\riscv32-esp-elf-gdb.exe
Note that if I change the path to GDB as illustrated above, and try to debug the project, I get an error dialog that states in part "Launching blink Configuration has encountered a problem. Could not determine GDB version after sending ...gdb path...--version, response: (nothing)"
I don't see the error dialogs I mentioned above when running GDB from a CMD shell, but it's pretty clear that it's the same missing-DLL problem happening here.

Sorry I can't provide screenshots to make this more clear.

Re: GDB issue with ESP32-C3 and esp-idf-tools 2.9 beta 6

Posted: Mon Jun 14, 2021 2:25 am
by mschultz
Here's another issue I discovered that might be relevant to the problems I mentioned in my previous post.

When doing a clean build of a esp32c3-targeted project, the following warning is printed on the console output:

Code: Select all

CMake Warning at D:/ESP/esp-idf/tools/cmake/crosstool_version_check.cmake:28 (message):
  Xtensa toolchain
  D:/ESP/.espressif/tools/riscv32-esp-elf/1.24.0.123_64eb9ff-8.4.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc.exe
  crosstool-ng version 1.24.0.123_64eb9ff doesn't match supported version
  esp-2020r3.  Check Getting Started documentation or proceed at own risk.
Call Stack (most recent call first):
  D:/ESP/esp-idf/components/esp_common/project_include.cmake:6 (crosstool_version_check)
  D:/ESP/esp-idf/tools/cmake/build.cmake:318 (include)
  D:/ESP/esp-idf/tools/cmake/build.cmake:533 (__build_process_project_includes)
  D:/ESP/esp-idf/tools/cmake/project.cmake:361 (idf_build_process)
  CMakeLists.txt:6 (project)
Note that projects built for the -C3 with this warning issued will load and run on a (rev 3) ESP32C3 DevKit.

Re: GDB issue with ESP32-C3 and esp-idf-tools 2.9 beta 6 [IDFGH-5410]

Posted: Wed Jun 16, 2021 3:12 am
by ESP_Alvin
Moderator's note: edit the topic title for issue tracking, thanks for reporting.

Re: GDB issue with ESP32-C3 and esp-idf-tools 2.9 beta 6 [IDFGH-5410]

Posted: Fri Jul 02, 2021 4:26 pm
by BrianP
mschultz

Did you ever solve this issue? I was working (with issues) with riscv32-esp-elf-gdb and got into a box so I decided to try a clean install. All of a sudden I got the same issue. I suspect that I had done an install which included the dlls, those got copied, but when I cleaned my system and used the master branch they got nuked.


EDIT

In case somebody else has this problem I discovered that copying
C:\msys64\mingw64\bin\libwinpthread-1.dll, libgcc_s_seh-1.dll, and libstdc++-6.dll

to the riscv32-esp-elf\bin directory allowed me to run debug.

Of course, there are numerous other issues with Eclipse, ESP32-C3, and debugging but at least that is a workaround for this one.

Hopefully the team will correct the problem in future releases.

Re: GDB issue with ESP32-C3 and esp-idf-tools 2.9 beta 6 [IDFGH-5410]

Posted: Sat Aug 14, 2021 7:09 am
by Ken4750
ESP_Alvin wrote:
Wed Jun 16, 2021 3:12 am
Moderator's note: edit the topic title for issue tracking, thanks for reporting.
Has the problem resolved?

Re: GDB issue with ESP32-C3 and esp-idf-tools 2.9 beta 6 [IDFGH-5410]

Posted: Mon Aug 16, 2021 8:49 am
by ESP_Alvin
Hi Ken4750 and mschultz,

The fix is available https://github.com/espressif/esp-idf/co ... 4da0dbf69a, sorry for slow turnaround.

Alvin