Page 1 of 1

Issues with JTAG Debugging Tool Chain

Posted: Thu Jul 28, 2022 8:14 pm
by mingesp256
Hi all, I'm having issues getting debugging over JTAG using esp prog board to work using VS Code, GBD and OpenOCD.

I have followed all the steps from the Espressif docs and tried this tutorial https://www.youtube.com/watch?v=uq93H7T7cOQ

I am getting the following error when I try to run the debugger
gbd error.PNG
gbd error.PNG (6.89 KiB) Viewed 1312 times
I am able to run openOCD with the command line and have been able to connect to the esp prog board successfully however I am unable to get the entire tool chain working in VS Code. So my guess is that there is something wrong with OpenOCD or GBD, not the esp prog hardware.

Any suggestions or potential fixes would be greatly appreciated.

Here are the launch.json and tasks.json files that I am trying to run in VS Code
Tasks.json

Code: Select all

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "preRun",
            "type": "shell",
            "windows":{
                "command": [
                    "C:/Espressif/tools/openocd-esp32/v0.11.0-esp32-20211220/openocd-esp32/bin/openocd.exe -f C:/Espressif/tools/openocd-esp32/v0.11.0-esp32-20211220/openocd-esp32/share/openocd/scripts/board/esp32s2-kaluga-1.cfg"
                ]
            }
        }
    ]
}
Launch.json

Code: Select all

{
    "version": "0.2.0",
    "configurations": [
        {
            "name" : "ESP32 OpenOCD",
            "type" : "cppdbg",
            "request": "launch",
            "cwd": "${workspaceFolder}/build",
            "program": "${workspaceFolder}/build/debugtest.elf",
            "miDebuggerPath": "C:\\Espressif\\tools\\xtensa-esp32s2-elf\\esp-2021r2-patch2-8.4.0\\xtensa-esp32s2-elf\\bin\\xtensa-esp32s2-elf-gdb.exe",
            "setupCommands": [
                {"text": "target remote 127.0.0.1:3333"},
                {"text": "set remote hardware-watchpoint-limit 2"},
                {"text": "monitor reset halt"},
                {"text": "flushregs"}
            ]
        }
    ]
}

Re: Issues with JTAG Debugging Tool Chain

Posted: Thu Aug 04, 2022 11:14 am
by ESP_bignacio
Could you change the cwd in launch.json to "cwd": "${workspaceFolder}" Also what is the output of the openOCD task ?

You could also try our Visual Studio Code extension for ESP-IDF