Unable to start debugging. Unexpected GDB output from command "- interpreter-exec console "target remote:3333""

kobybens
Posts: 1
Joined: Thu Mar 31, 2022 12:31 pm

Unable to start debugging. Unexpected GDB output from command "- interpreter-exec console "target remote:3333""

Postby kobybens » Thu Mar 31, 2022 5:49 pm

Hi,
I am new with the ESP and i am trying to work with VSCode and use the debugger, the setup is:
- ESP32-S3 -DevKitC1
- espressif-idf ver 1.4
- IDF 4.4
- blink example

I'm working by the documentation and the YouTube guide as reference (https://www.youtube.com/watch?v=uq93H7T7cOQ)
configure the launch.json as:
{
"version": "0.2.0",
"configurations": [
{
"preLaunchTask": "preRun",
"type": "cppdbg",
"name": "Esp32OpenOcd",
"request": "launch",
"cwd":"${workspaceFolder}/build",
"program": "${workspaceRoot}/build/${command:espIdf.getProjectName}.elf",
"miDebuggerPath": "${command:espIdf.getXtensaGdb}",
"setupCommands": [
{"text":"target remote :3333"},
{"text":"set remote hardware-watchpoint-limit 2"},
{"text":"monitor reset halt"},
{"text":"flushregs"},
{"text":"thb app_main"},
],
}
]
}
and the tasks.json as:
{
"version": "2.0.0",
"tasks": [
{
"label": "preRun",
"type": "shell",
"windows": {
"command": "clear '&' start openocd -c \"set ESP_RTOS none\" -f board/esp32s3-builtin.cfg '&' exit"
}
}
]
}

It look that it start when i try to connect manually:

openocd -f board/esp32s3-builtin.cfg
Open On-Chip Debugger v0.11.0-esp32-20211220 (2021-12-20-15:43)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
Warn : Transport "jtag" was already selected
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : esp_usb_jtag: Device found. Base speed 40000KHz, div range 1 to 255
Info : clock speed 40000 kHz
Info : JTAG tap: esp32s3.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32s3.cpu0: Target halted, PC=0x40000400, debug_reason=00000001
Info : esp32s3.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
Info : starting gdb server for esp32s3.cpu0 on 3333
Info : Listening on port 3333 for gdb connections

but when i use the launch.json - the dbg fail, it look that it fail to parse => Unable to start debugging. Unexpected GDB output from command "- interpreter-exec console "target remote:3333"" .:3333 (undocumented errno138)

Anyone have any idea how to solve that ?

Thanks

crnewton
Posts: 6
Joined: Mon Nov 07, 2022 9:58 am

Re: Unable to start debugging. Unexpected GDB output from command "- interpreter-exec console "target remote:3333""

Postby crnewton » Thu Dec 08, 2022 1:04 pm

Did you resolve this issue?

I have the same issue, also using ESP32-S3. (following the same video guide)

I need this because:
Debugging using the configuration from the ESP-IDF extension in VSCode doesn't allow me to place logpoints.
When hovering over the breakpoint in the debug menu it shows: "Breakpoints of this type are not supported by the debugger"

User avatar
evanescent_nacho
Posts: 10
Joined: Thu Nov 17, 2022 10:58 pm

Re: Unable to start debugging. Unexpected GDB output from command "- interpreter-exec console "target remote:3333""

Postby evanescent_nacho » Tue Jan 17, 2023 4:01 pm

I'm stuck with the same issue. I had a different issue before, but after resolving that, I got stuck with this. Here is a link to that thread: viewtopic.php?f=13&t=30661.

I've used the command line successfully with OpenOCD / GDB, set a breakpoint and investigated a variable, but I have not gotten VSCode to launch and integrate with OpenOCB / GDB. It seems that something is not right with how VSCode hooks into GDB or OpenOCD.

User avatar
evanescent_nacho
Posts: 10
Joined: Thu Nov 17, 2022 10:58 pm

Re: Unable to start debugging. Unexpected GDB output from command "- interpreter-exec console "target remote:3333""

Postby evanescent_nacho » Fri Jan 20, 2023 3:39 pm

I've been able to get it working, but I have to launch OpenOCD externally in a terminal. I type on the command line "openocd -c "set ESP_RTOS none" -f board/esp32c3-builtin.cfg". I need the folder above 'board' to be part of PATH. That is 'PATH_TO_SDK'\tools\openocd-esp32\v0.11.0-esp32-20220411\openocd-esp32\share\openocd\scripts in case you need that. I run that and leave the window open, then launch debugging. I have the preLaunchTask commented out in lauch.json. Sometimes is does drop the connection after it's done some connecting. I had it doe that after each partition while programming until it had programmed all 3 partitions. For now I have programming commented out in the setup commands. I also start the monitor first, so I get logs and I can reprogram before that step if I wish.

User avatar
evanescent_nacho
Posts: 10
Joined: Thu Nov 17, 2022 10:58 pm

Re: Unable to start debugging. Unexpected GDB output from command "- interpreter-exec console "target remote:3333""

Postby evanescent_nacho » Fri Jan 20, 2023 3:51 pm

I've posted what worked for me here. Basically the preLaunchTask is not working for me to OpenOCD does not start. I have to start that in a terminal before starting a debug session, even though I followed the example for the preLaunchTask. Here is the other thread where I talk about it a little more: https://esp32.com/viewtopic.php?f=40&t= ... 77#p108677.

Jimis1
Posts: 35
Joined: Wed May 03, 2023 6:20 am

Re: Unable to start debugging. Unexpected GDB output from command "- interpreter-exec console "target remote:3333""

Postby Jimis1 » Mon Nov 20, 2023 7:36 am

Hi,
Has anyone managed to properly debug ESP32-S3 DevKitC-1. It's been over a year and I don't see a solution anywhere.
I followed the same example by Yuri-R video posted above for the ESP32-S2 but I also get the same problem shown in the screenshot.

I use VScode and esspresif extension + esp-idf latest versions.

If those step by step instructions and videos don't work for you or you miss a turn somewhere you usually end up in a loop where you waste too much time with no result. This is one, there is no step by step for this specific dev board and I don't really know what the problem is.

I can't help but to complain that we are 2023 and we type commands in command prompt like MS DOS. Instead of going forward we are going backwards. VScode might be a nice environment for combining many platforms but it's a nightmare to setup. I miss the specific compiler IDEs like Atmel Studio,Codevision etc. where you could debug easily. I'm tired of all those json files setup every time I do something, I wonder if I ditch VScode and try Eclipse if I could debug the dev kit. Has anyone tried that ?

Sorry for my complains prbly the wrong forum but I just wanted to get it out of me :)
Attachments
Screenshot_1.jpg
Screenshot_1.jpg (13.12 KiB) Viewed 93862 times

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: Unable to start debugging. Unexpected GDB output from command "- interpreter-exec console "target remote:3333""

Postby ESP_bignacio » Mon Nov 20, 2023 10:43 am

Have you followed our setup tutorial here:

https://github.com/espressif/vscode-esp ... install.md

And our debug tutorial:

https://github.com/espressif/vscode-esp ... bugging.md

If you have any problems share the troubleshooting information with us to understand better the problem:

https://github.com/espressif/vscode-esp ... leshooting

Jimis1
Posts: 35
Joined: Wed May 03, 2023 6:20 am

Re: Unable to start debugging. Unexpected GDB output from command "- interpreter-exec console "target remote:3333""

Postby Jimis1 » Mon Nov 20, 2023 5:00 pm

Thx for your answer ESP_bignacio,

I have already used the links you sent. After I press F5 to debug I get the error
Screenshot_2.jpg
Screenshot_2.jpg (99.69 KiB) Viewed 93773 times
I select the USB-JTAG builtin option and I use the com port that says UART on the board (not the USB one)

Here is my settings.json.

Code: Select all

{
    "idf.adapterTargetName": "esp32s3",
    "idf.openOcdConfigs": [
        "board/esp32s3-builtin.cfg"
    ],
    "idf.portWin": "COM7",
    "idf.flashType": "UART",
    "C_Cpp.default.compilerPath": "c:\\Applications\\Programming\\ESP\\Tools/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc.exe"
}
Here is my launch.json

Code: Select all

    "version": "0.2.0",
    "configurations": [
        {
            "name": "ESP32 OpenOCD",
            "type": "cppdbg",
            "request": "launch",
            "cwd": "${workspaceRoot}/build",
            "program": "${workspaceRoot}/build/SmartHome.elf",
            "miDebuggerPath": "c:/Applications/Programming/ESP/tools/tools/xtensa-esp-elf-gdb/12.1_20221002/xtensa-esp-elf-gdb/bin/xtensa-esp32s3-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"}
            ]
        }
    ]
1.png
1.png (58.97 KiB) Viewed 93771 times

ESP_radurentea
Posts: 18
Joined: Thu Mar 09, 2023 8:30 am

Re: Unable to start debugging. Unexpected GDB output from command "- interpreter-exec console "target remote:3333""

Postby ESP_radurentea » Wed Nov 22, 2023 10:20 am

Hi Jimis1,

Please follow the steps from the link https://github.com/espressif/vscode-esp ... leshooting Brian provided and attach the output of the Doctor's Command here, as well as the %USERPROFILE%\.vscode\extensions\espressif.esp-idf-extension-VERSION\esp_idf_vsc_ext.log file, after you've set the following:
NOTE: Use idf.openOcdDebugLevel configuration setting to 3 or more to show debug logging in OpenOCD server output.

NOTE: Use logLevel in your /.vscode/launch.json to 3 or more to show more debug adapter output.

Jimis1
Posts: 35
Joined: Wed May 03, 2023 6:20 am

Re: Unable to start debugging. Unexpected GDB output from command "- interpreter-exec console "target remote:3333""

Postby Jimis1 » Wed Nov 22, 2023 5:39 pm

Attaching the files
Attachments
esp_idf_vsc_ext.log
(117.34 KiB) Downloaded 5932 times
DoctorsCommand.txt
(12.04 KiB) Downloaded 5750 times

Who is online

Users browsing this forum: No registered users and 38 guests