Cant get debugger working

espdebugger
Posts: 2
Joined: Tue Sep 17, 2024 7:46 am

Cant get debugger working

Postby espdebugger » Tue Sep 17, 2024 9:22 am

Hi
I have a ESP-S3-devkit, witch I cant debug or flash(uart) via esspressif ide. I can flash it via UART in vs code but not debug.

To rule out everything on my PC I installed a fresh IDE(esp-idf v5.3) on a virtual machine using the windows installer.

I'm trying to get the "hello-word" example to run and debug.
The esp32s3 is found and my com port is linked to target esp32-s3.

I have three launch configurations and get these errors:
hello_world.elf
"Error with command: gdb --version"

hello_world
"Error with command: gdb --version"

hello_world configuration
First it gave me GDB timeout, increased the timeout to 500 and now I get Error: Failed to start algorithm (-4)!

I'm totally lost, should it not work with a clean install and an official dev-board?

Any help appreciated

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

Re: Cant get debugger working

Postby ESP_bignacio » Wed Sep 18, 2024 1:14 am

Could you share the troubleshooting information ?

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

What is your launch.json configuration ? Did you modify the default one?

Based on what you say it seems OpenOCD has issue connecting to your board before debug session start. what is the openOCD output? (Check troubleshoot information)

Are you using the partition table at offset 0x8000 or is your application image not at 0x10000 ? you might need to specify the new appimage_offset in your settings.json with

Code: Select all

{
  "idf.openOcdLaunchArgs": [
    "-c",
    "init",
    "-c",
    "reset halt",
    "-c",
    "esp appimage_offset 0x20000"
  ]
}
and replace 0x20000 with the application image offset as shown in the build directory flasher_args.json. Again, if it is the default 0x10000 don't need to update this.

espdebugger
Posts: 2
Joined: Tue Sep 17, 2024 7:46 am

Re: Cant get debugger working

Postby espdebugger » Mon Sep 23, 2024 8:52 am

Hi sorry for the late reply, I got it working on the IDE with bilnk example.
I had to choose the OpenOCD configuration and then when pressing debug also click on the small arrow next to it, and select the same configuration( this was not obvious, I just pressed the debug icon before).
I also use a high end USB cable and skipped the virtual machine since it was unstable when debugging.

Now I'm trying to get the debugger working in VS code with my real project.
I have been trying different things without success, here is how my laounch.json looks like:

Code: Select all

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "ESP32-S3 GDB",
      "type": "cppdbg",
      "request": "launch",
      "program": "C:/MYPROJECTPATH/project.elf",
      "stopAtEntry": false,
      "cwd": "C:/MYPROJECTPATH/",
      "environment": [],
      "externalConsole": false,
      "MIMode": "gdb",
      "setupCommands": [
        {
          "description": "Enable pretty-printing for gdb",
          "text": "-enable-pretty-printing",
          "ignoreFailures": true
        }
      ],
      //"miDebuggerPath": "C:/Users/user/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/binxtensa-esp32-elf-gcc.exe",
      //"miDebuggerPath": "C:/Users/user/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc.exe",
      //"targetArchitecture": "xtensa",
      "serverLaunchTimeout": 10000,
      "filterStderr": true,
      "filterStdout": true,
      "logging": {
        "engineLogging": true,
        "trace": true
      },
      "debugServerPath": "C:/Users/user/.espressif/tools/openocd-esp32/v0.12.0-esp32-20240318/openocd-esp32/bin",
      "debugServerArgs": "-f board/esp32s3.cfg",
      "serverStarted": "Info : 2nd stage startup",
      "launchCompleteCommand": "exec-run",
      "sourceFileMap": {
        "/build/": "C:/MYPROJECTPATH/build"
      },
      "visualizerFile": "C:/MYPROJECTPATH/tools/esp32s3.natvis"
    }
  ]
}

Who is online

Users browsing this forum: No registered users and 25 guests