Setting up OpenOCD debugger for IDF VS Code?

MikeLemon
Posts: 45
Joined: Tue Feb 02, 2021 5:55 pm

Setting up OpenOCD debugger for IDF VS Code?

Postby MikeLemon » Sun Feb 07, 2021 7:28 pm

Hi I've followed this guide: https://github.com/Adam-U/ESP32_VSCode_Debug
on how to setup the OCD debugger with VS code using msys32 (which for some reason doesn't seem right and unnecessery but what ever...) and when I come to debug my code with "Native debug" extention it spits out this error:

Code: Select all

Running executable
:3333: The system tried to join a drive to a directory on a joined drive.
"monitor" command not supported by this target.
Register cache flushed.
No hardware breakpoint support in the target.
The program is not being run.
which according to my guess indicates that I have probably setup the file launch.json wrong like that:

Code: Select all

{
  "version": "0.2.0",
  "configurations": 
  [
      {
          "type": "gdb",
          "request": "launch",
          "name": "Launch Program",
          "target": "./build/${workspaceFolderBasename}.elf",
          "cwd": "${workspaceFolder}",
          "gdbpath": "C:/msys32/opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb",
          "autorun": 
          [
              "target remote :3333",
              "mon reset halt",
              "flushregs",
              "thb app_main",
              "c"
          ],
          "preLaunchTask": "openocd"
      }
  ]
}
What are the possible options to fix this? I've went over the ESPressif official PDF on debugging but not much organized info there about the different debugging options...

I'm using the following hardware:

ESP-Prog
esp32 dev kit V1

OllieK
Posts: 58
Joined: Mon Jan 18, 2016 8:08 am
Location: USA, PA
Contact:

Re: Setting up OpenOCD debugger for IDF VS Code?

Postby OllieK » Sun Feb 14, 2021 3:40 am

@MikeLemon,

There seems to be quite little debugger related communication in this forum. I have been lucky to get ESP-Prog and FT2232HL to work with my ESP32 and ESP32-S2 boards on v4.1 and v4.2 without any extra effort. Just install and configure the Espressif IDF extension on vsCode and start the debugger with F5.

There has been and still are unexplained snafus which are slowing me down or completely stopping me. The latest was related to an error message that I need to update the OpenOCD version and I haven't find a way how to do it.

In Eclipse, I did send several hours to modify all different kind of JTAG setting files. I was so pleased that with vsCode when none of that was required.

Keep fighting 8-)

PS. I am waiting my ESP32-PICO-DEVKITM-2 boards from Mouser in few weeks. They are quite close to the "ideal" Espressif board for my projects. It is possible that there will be later some ESP32-S3 boards that would be even better. We are living interesting times indeed. :geek:

User avatar
ESP_Roland
Posts: 257
Joined: Tue Oct 09, 2018 10:28 am

Re: Setting up OpenOCD debugger for IDF VS Code?

Postby ESP_Roland » Mon Feb 15, 2021 8:08 am

Please follow this guide https://github.com/espressif/vscode-esp ... BUGGING.md and if you have still issues then report it in this repo.

OllieK
Posts: 58
Joined: Mon Jan 18, 2016 8:08 am
Location: USA, PA
Contact:

Re: Setting up OpenOCD debugger for IDF VS Code?

Postby OllieK » Tue Feb 16, 2021 1:18 am

My expectation is that a normal user of vsCode with Esp-Prog doesn't need to dive into these configuration details. It should be enough just to install Expressif Extension for vsCode and start the debugger with F5. This has worked for me many times, but not always.

MikeLemon
Posts: 45
Joined: Tue Feb 02, 2021 5:55 pm

Re: Setting up OpenOCD debugger for IDF VS Code?

Postby MikeLemon » Mon Mar 15, 2021 1:01 pm

ESP_Roland wrote:
Mon Feb 15, 2021 8:08 am
Please follow this guide https://github.com/espressif/vscode-esp ... BUGGING.md and if you have still issues then report it in this repo.
This just seem to complicate things and doesn't realy work saying it couldn't find "espidf.getXtensaGdb"

probably some extension function I don't have sins I just use plain vanila esp idf setup.

I have managed to make this work with this simple reference:

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

Good luck debugging to everyone~

Who is online

Users browsing this forum: Google [Bot] and 100 guests