Got it running after a full reinstallation of ESP-IDF plus driver...
To get the debugger working i need to add some code files to my .vscode folder. I oriented myself at the following video series
https://www.youtube.com/@YuriR/videos
Here are my code files for .vscode folder.
launch.json
Code: Select all
{
"version": "0.2.0",
"configurations": [
{
"preLaunchTask": "preRun",
"name": "ESP32-C6 OpenOCD",
"type": "cppdbg",
"request": "launch",
"cwd": "${workspaceFolder}/build",
"program": "${workspaceFolder}/build/wifi_softAP.elf", // Change path to {project}.elf
// For the following lines of code take a look at
// https://docs.espressif.com/projects/esp-idf/en/latest/esp32c6/api-guides/jtag-debugging/using-debugger.html#jtag-debugging-using-debugger-command-line
"miDebuggerPath": "C:/Espressif/tools/riscv32-esp-elf-gdb/12.1_20221002/riscv32-esp-elf-gdb/bin/riscv32-esp-elf-gdb.exe",
"setupCommands": [
{"text": "target remote :3333"},
{"text": "set remote hardware-watchpoint-limit 2"},
{"text": "mon reset halt"},
{"text": "maintenance flush register-cache"},
{"text": "thb app_main"}
]
}
]
}
settings.json adding arguments to "args":
Code: Select all
// Add the following arguments to open the ESP-IDF in VSCode Terminal
"args": [
"/k",
"C:/Espressif/idf_cmd_init.bat esp-idf-320ad5a1f7f1ffa6c2d9808f7d43bb34"
],
tasks.json
Code: Select all
{
"version": "2.0.0",
"tasks": [
{
"label": "preRun",
"type": "shell",
"windows": {
"command": "clear & start openocd -c \"set ESP_RTOS none\" -f board/esp32c6-builtin.cfg & exit"
}
}
]
}
This code files will start automatically OpenOCD and the debugger session when pressing F5 or Run -> Start Debugging in VSCode.