-
Notifications
You must be signed in to change notification settings - Fork 319
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
Debugging problems in vscode for esp32c6 (devkit) (IDFGH-12122) (VSC-1297) #1138
Comments
The second problem was solved after update to show configuration
This GDB was configured as follows:
configure --host=x86_64-w64-mingw32 --target=riscv32-esp-elf
--with-auto-load-dir=$debugdir:$datadir/auto-load
--with-auto-load-safe-path=$debugdir:$datadir/auto-load
--with-expat
--with-gdb-datadir=//share/gdb (relocatable)
--with-jit-reader-dir=//lib/gdb (relocatable)
--without-libunwind-ia64
--without-lzma
--without-babeltrace
--without-intel-pt
--without-mpfr
--without-xxhash
--without-python
--with-python-libdir=/opt/python-x86_64-w64-mingw32-3.12.0/lib
--without-debuginfod
--without-guile
--disable-source-highlight
--with-separate-debug-dir=//lib/debug (relocatable) But to use The first problem is still there. Is File "C:\Program Files\Python312\Lib\threading.py", line 992, in start
_start_new_thread(self._bootstrap, ()) part weird? Shouldn't it use python from virtualenv ( |
Hi @vandy, It does look strange, my first thought is that the VS Code extension is misconfigured. Can you please run the "Doctor Command" from VS Code's Command Palette and paste the output from your clipboard here, so we can take a look at VS Code configuration? |
Hi, @radurentea. It looks like it's ok. I played with forward and backward slashes in ---------------------------------------------- ESP-IDF Extension for Visual Studio Code report ---------------------------------------------
OS win32 x64 10.0.19045
System environment variable IDF_PYTHON_ENV_PATH
undefined
System environment variable PATH
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Python312\Scripts\;C:\Program Files\Python312\;C:\Program Files\Git\cmd;C:<HOMEPATH>\AppData\Local\Microsoft\WindowsApps;C:<HOMEPATH>\AppData\Local\Programs\Microsoft VS Code\bin;C:<HOMEPATH>\.dotnet\tools;
System environment variable PYTHON
undefined
Visual Studio Code version 1.86.2
Visual Studio Code language en
Visual Studio Code shell C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
ESP-IDF Extension version 1.7.0
Workspace folder d:\dev\project\firmware
---------------------------------------------------- Extension configuration settings ------------------------------------------------------
ESP-ADF Path (idf.espAdfPath) ${env:ADF_PATH}
ESP-IDF Path (idf.espIdfPath) D:\dev\github.com\esp-idf
ESP-MDF Path (idf.espMdfPath) ${env:MDF_PATH}
ESP-Matter Path (idf.espMatterPath) ${env:ESP_MATTER_PATH}
Custom extra paths (idf.customExtraPaths) C:/Users/user/.espressif/idf5.2/tools/ccache/4.8/ccache-4.8-windows-x86_64;C:/Users/user/.espressif/idf5.2/tools/cmake/3.24.0/bin;C:/Users/user/.espressif/idf5.2/tools/dfu-util/0.11/dfu-util-0.11-win64;C:/Users/user/.espressif/idf5.2/tools/esp-rom-elfs/20230320;C:/Users/user/.espressif/idf5.2/tools/idf-exe/1.0.3;C:/Users/user/.espressif/idf5.2/tools/ninja/1.11.1;C:/Users/user/.espressif/idf5.2/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin;C:/Users/user/.espressif/idf5.2/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin;C:/Users/user/.espressif/idf5.2/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin;C:/Users/user/.espressif/idf5.2/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin;C:/Users/user/.espressif/idf5.2/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin;C:/Users/user/.espressif/idf5.2/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin
Custom extra vars (idf.customExtraVars)
OPENOCD_SCRIPTS: C:<HOMEPATH>\.espressif\idf5.2\tools\openocd-esp32\v0.12.0-esp32-20230921\openocd-esp32\share\openocd\scripts
ESP_ROM_ELF_DIR: C:/Users/user/.espressif/idf5.2/tools/esp-rom-elfs/20230320
Virtual env Python Path (idf.pythonBinPath) C:<HOMEPATH>\.espressif\idf5.2\python_env\idf5.2_py3.12_env\Scripts\python.exe
Serial port (idf.port) COM5
OpenOCD Configs (idf.openOcdConfigs) board/esp32c6-builtin.cfg
ESP-IDF Tools Path (idf.toolsPath) C:<HOMEPATH>\.espressif\idf5.2
Git Path (idf.gitPath) C:\Program Files\Git\cmd\git.exe
Notification Mode (idf.notificationMode) All
-------------------------------------------------------- Configurations access -------------------------------------------------------------
Access to ESP-ADF Path (idf.espAdfPath) false
Access to ESP-IDF Path (idf.espIdfPath) true
Access to ESP-MDF Path (idf.espMdfPath) false
Access to ESP-Matter Path (idf.espMatterPath) false
Access to ESP-IDF Custom extra paths
Access to C:/Users/user/.espressif/idf5.2/tools/ccache/4.8/ccache-4.8-windows-x86_64: true
Access to C:/Users/user/.espressif/idf5.2/tools/cmake/3.24.0/bin: true
Access to C:/Users/user/.espressif/idf5.2/tools/dfu-util/0.11/dfu-util-0.11-win64: true
Access to C:/Users/user/.espressif/idf5.2/tools/esp-rom-elfs/20230320: true
Access to C:/Users/user/.espressif/idf5.2/tools/idf-exe/1.0.3: true
Access to C:/Users/user/.espressif/idf5.2/tools/ninja/1.11.1: true
Access to C:/Users/user/.espressif/idf5.2/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin: true
Access to C:/Users/user/.espressif/idf5.2/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin: true
Access to C:/Users/user/.espressif/idf5.2/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin: true
Access to C:/Users/user/.espressif/idf5.2/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin: true
Access to C:/Users/user/.espressif/idf5.2/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin: true
Access to C:/Users/user/.espressif/idf5.2/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin: true
Access to Virtual env Python Path (idf.pythonBinPath) true
Access to CMake in environment PATH undefined
Access to Ninja in environment PATH undefined
Access to ESP-IDF Tools Path (idf.toolsPath) true
-------------------------------------------------------- Configurations has spaces -------------------------------------------------------------
Spaces in system environment Path true
Spaces in ESP-ADF Path (idf.espAdfPath) false
Spaces in ESP-IDF Path (idf.espIdfPath) false
Spaces in ESP-MDF Path (idf.espMdfPath) false
Spaces in ESP-Matter Path (idf.espMatterPath) false
Spaces in ESP-IDF Custom extra paths
Spaces in C:/Users/user/.espressif/idf5.2/tools/ccache/4.8/ccache-4.8-windows-x86_64: false
Spaces in C:/Users/user/.espressif/idf5.2/tools/cmake/3.24.0/bin: false
Spaces in C:/Users/user/.espressif/idf5.2/tools/dfu-util/0.11/dfu-util-0.11-win64: false
Spaces in C:/Users/user/.espressif/idf5.2/tools/esp-rom-elfs/20230320: false
Spaces in C:/Users/user/.espressif/idf5.2/tools/idf-exe/1.0.3: false
Spaces in C:/Users/user/.espressif/idf5.2/tools/ninja/1.11.1: false
Spaces in C:/Users/user/.espressif/idf5.2/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin: false
Spaces in C:/Users/user/.espressif/idf5.2/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin: false
Spaces in C:/Users/user/.espressif/idf5.2/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin: false
Spaces in C:/Users/user/.espressif/idf5.2/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin: false
Spaces in C:/Users/user/.espressif/idf5.2/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin: false
Spaces in C:/Users/user/.espressif/idf5.2/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin: false
Spaces in Virtual env Python Path (idf.pythonBinPath) false
Spaces in ESP-IDF Tools Path (idf.toolsPath) false
----------------------------------------------------------- Executables Versions -----------------------------------------------------------
Git version 2.43.0.windows.1
ESP-IDF version 5.2.0
Python version 3.12.1
Python's pip version 24.0
-------------------------------------------------- Project configuration settings ----------------------------------------------------------
-------------------------------------------------- Python packages in idf.pythonBinPath ----------------------------------------------------
bitarray version: 2.9.2
bitstring version: 4.1.4
CacheControl version: 0.14.0
certifi version: 2024.2.2
cffi version: 1.16.0
charset-normalizer version: 3.3.2
click version: 8.1.7
colorama version: 0.4.6
construct version: 2.10.70
contextlib2 version: 21.6.0
cryptography version: 41.0.7
ecdsa version: 0.18.0
esp-coredump version: 1.10.0
esp-debug-backend version: 1.0.3
esp-idf-kconfig version: 1.4.2
esp-idf-monitor version: 1.4.0
esp-idf-panic-decoder version: 1.0.1
esp-idf-size version: 1.1.1
esptool version: 4.7.0
filelock version: 3.13.1
freertos-gdb version: 1.0.2
idf-component-manager version: 1.5.1
idna version: 3.6
intelhex version: 2.3.0
kconfiglib version: 14.1.0
markdown-it-py version: 3.0.0
mdurl version: 0.1.2
msgpack version: 1.0.7
packaging version: 23.2
pip version: 24.0
pyclang version: 0.4.2
pycparser version: 2.21
pyelftools version: 0.30
pygdbmi version: 0.11.0.0
Pygments version: 2.17.2
pyparsing version: 3.1.1
pyserial version: 3.5
pywin32 version: 306
PyYAML version: 6.0.1
reedsolo version: 1.7.0
requests version: 2.31.0
requests-file version: 1.5.1
requests-toolbelt version: 1.0.0
rich version: 13.7.0
schema version: 0.7.5
setuptools version: 69.1.0
six version: 1.16.0
tqdm version: 4.66.2
urllib3 version: 1.26.18
windows-curses version: 2.3.2
---------------------------------------------------- Check ESP-IDF python requirements.txt -------------------------------------------------
Check ESP-IDF Python packages Python requirements are satisfied.
---------------------------------------------------- Check ESP-IDF debug adapter requirements.txt ------------------------------------------
Check Debug AdapterPython packages Python requirements are satisfied.
---------------------------------------------------- Visual Studio Code launch.json --------------------------------------------------------
{
"version": "0.2.0",
"configurations": [
{
"type": "espidf",
"name": "Launch",
"request": "launch",
"logLevel": 4,
"initGdbCommands": [
"target extended-remote :3333",
"set remote hardware-watchpoint-limit 2",
"mon reset halt",
"maintenance flush register-cache",
"thb app_main",
"c",
],
},
{
"name": "Launch GDB ESP32",
"type": "cppdbg",
"request": "launch",
"cwd": "${workspaceFolder}/build",
"program": "${workspaceFolder}/build/gwfirmware.elf",
"miDebuggerPath": "${command:espIdf.getXtensaGdb}",
"setupCommands": [
{ "text": "target extended-remote :3333" },
{ "text": "set remote hardware-watchpoint-limit 2"},
{ "text": "mon reset halt" },
{ "text": "maintenance flush register-cache" },
{ "text": "thb app_main" },
]
}
]
}
---------------------------------------------------- Visual Studio Code c_cpp_properties.json ----------------------------------------------
{
"configurations": [
{
"name": "ESP-IDF",
"compilerPath": "${config:idf.toolsPathWin}/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc.exe",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"includePath": [
"${config:idf.espIdfPath}/components/**",
"${config:idf.espIdfPathWin}/components/**",
"${config:idf.espAdfPath}/components/**",
"${config:idf.espAdfPathWin}/components/**",
"${workspaceFolder}/**"
],
"browse": {
"path": [
"${config:idf.espIdfPath}/components",
"${config:idf.espIdfPathWin}/components",
"${config:idf.espAdfPath}/components/**",
"${config:idf.espAdfPathWin}/components/**",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": false
}
}
],
"version": 4
}
-------------------------------------------------------------------------------------------------------------------------------------------- |
Could you share the debug.log file content or the ESP-IDF Output related to debug adapter to see what is the error ? |
I've used app_trace basic example from esp-idf with modified app_main: void app_main(void) {
ESP_LOGI(TAG, "Waiting for OpenOCD connection");
// while (!esp_apptrace_host_is_connected(ESP_APPTRACE_DEST_JTAG)) {
// vTaskDelay(1);
// }
ESP_LOGI(TAG, "Sending example data to the host...");
for (unsigned int cnt = 1; cnt < 51; ++cnt) {
char buf[32] = {0};
snprintf(buf, sizeof(buf), "Apptrace test data[%d]:%d\n", cnt, cnt * cnt);
esp_err_t res = esp_apptrace_write(ESP_APPTRACE_DEST_JTAG, buf, strlen(buf), ESP_APPTRACE_TMO_INFINITE);
if (res != ESP_OK) {
ESP_LOGE(TAG, "Failed to write data to host [0x%x] (%s)", res, esp_err_to_name(res));
}
esp_apptrace_flush(ESP_APPTRACE_DEST_JTAG, 1000);
vTaskDelay(50 / portTICK_PERIOD_MS);
}
while (1) {
ESP_LOGI(TAG, "Loop");
vTaskDelay(250 / portTICK_PERIOD_MS);
}
ESP_LOGI(TAG, "Done!");
} |
This issue has been marked as |
Hi, @brianignacio5, I've shared the debug.log. |
This issue has been marked as |
We are working on migrating to a new debug adapter that is more stable that our current python one in this PR: You are welcome to test it with the PR vsix installer if you like. |
This issue has been marked as |
Answers checklist.
General issue report
I've installed
vscode
(Windows 10), clonedesp-idf
repository (v5.1.2), installed tools to%userProfile%
withinstall.bat
, installed extension for vscode, set everything up. I can build, flash and monitor my firmware.Wanted to setup debugging via usb-jtag and faced some problems.
esp-idf debug adapter
(https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/DEBUGGING.md#use-the-esp-idf-debug-adapter). When I run the Launch (in debug tab), the program stops atapp_main
(which is expected). I can use Step over (or other steps) to proceed. But I can't use Continue (F5) to break at the next breakpoint (to jump from line 9 to line 15 at once). There are errors in the console:But if I use command line approach (https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/api-guides/jtag-debugging/debugging-examples.html#command-line), everything is fine. I can step or continue to jump to the next breakpoint.
Also, using
"type": "cppdbg"
in launch.json with specified gdb binary (from .espressif tools) works ok, I can use Continue to jump between breakpoints.freertos-gdb
python package. The package is installed. But riscv-...-gdb (from .espressif tools) says that# Python scripting is not supported in this copy of GDB.
I just cannot import the python package in gdb session.Should I obtain riscv-...-gdb another way?
Example:
The text was updated successfully, but these errors were encountered: