vscode-esp-idf-extension: [Bug Report]: "Failed to init Debug Adapter!" at ESP32-S3-DevKit C-1 with FT232H (VSC-813)

Pre Bug Report Checklist

  • Make sure you have searched for existing bugs and features request before you post an issue.
  • This is a bug report for the ESP-IDF Visual Studio Code extension and not an ESP-IDF bug report.
  • I’ve read the docs and found no information that could have helped solving the issue.

Describe the bug

“Failed to init Debug Adapter!” at ESP32-S3-DevKit C-1 with FT232H

Environment (please complete the following information):

  • OS win32 x64 10.0.19043

  • Visual Studio Code version 1.63.2

  • ESP-IDF Extension version 1.3.0

  • ESP-IDF Version: release/v4.4 (release branch)

  • Python version 3.8.7

  • Hardware

  • Using example project “blink”.

  • Additional context

    • “ESP-IDF:build, Flash snd start a monitor on your device” is working collectly.
    • GDB debugging from the command line is working at same environment.
    • Debugging with Eclipse and Espressif IDF Plugin for Eclipse is working at same environment.

launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "espidf",
      "name": "Launch",
      "request": "launch"
    }
  ]
} 

and attached ESP-IDF_Doctor_command_output.txt ESP-IDF_Doctor_command_output.txt

To Reproduce

  • install, make “blink” project from example, some configrations and test with commandline GDB. and press F5.

Output

ESP-IDF Debug Adapter

DEBUG_ADAPTER_STARTED
2022-01-05 00:27:59,483 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_STARTED
DEBUG_ADAPTER_READY2CONNECT
2022-01-05 00:27:59,483 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_READY2CONNECT
DEBUG_ADAPTER_STOPPED
2022-01-05 00:27:59,565 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_STOPPED
[Stopped] : ESP-IDF Debug Adapter

OpenOCD

Open On-Chip Debugger  v0.10.0-esp32-20211111 (2021-11-10-21:40)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
debug_level: 2

adapter speed: 20000 kHz

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
❌ Error: no device found
❌ Error: unable to open ftdi device with vid 0403, pid 6010, description '*', serial '*' at bus location '*'
❌ Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 20000 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=0x42017E26, debug_reason=00000001
Info : esp32s3.cpu1: Target halted, PC=0x42017E26, debug_reason=00000000
Info : Listening on port 3333 for gdb connections

Extension Configuration settings

Preferences: Open Settings (JSON)

{
    "idf.adapterTargetName": "esp32s3",
    "idf.gitPath": "C:\\Users\\kaminosono\\.espressif\\tools\\idf-git\\2.30.1\\cmd\\git.exe",
    "idf.espIdfPathWin": "C:\\Users\\kaminosono\\esp\\esp-idf",
    "idf.pythonBinPathWin": "C:\\Users\\kaminosono\\.espressif\\python_env\\idf4.4_py3.8_env\\Scripts\\python.exe",
    "idf.toolsPathWin": "C:\\Users\\kaminosono\\.espressif",
    "idf.customExtraPaths": "C:\\Users\\kaminosono\\.espressif\\tools\\xtensa-esp32-elf\\esp-2021r2-8.4.0\\xtensa-esp32-elf\\bin;C:\\Users\\kaminosono\\.espressif\\tools\\xtensa-esp32s2-elf\\esp-2021r2-8.4.0\\xtensa-esp32s2-elf\\bin;C:\\Users\\kaminosono\\.espressif\\tools\\xtensa-esp32s3-elf\\esp-2021r2-8.4.0\\xtensa-esp32s3-elf\\bin;C:\\Users\\kaminosono\\.espressif\\tools\\riscv32-esp-elf\\esp-2021r2-8.4.0\\riscv32-esp-elf\\bin;C:\\Users\\kaminosono\\.espressif\\tools\\esp32ulp-elf\\2.28.51-esp-20191205\\esp32ulp-elf-binutils\\bin;C:\\Users\\kaminosono\\.espressif\\tools\\esp32s2ulp-elf\\2.28.51-esp-20191205\\esp32s2ulp-elf-binutils\\bin;C:\\Users\\kaminosono\\.espressif\\tools\\cmake\\3.20.3\\bin;C:\\Users\\kaminosono\\.espressif\\tools\\openocd-esp32\\v0.10.0-esp32-20211111\\openocd-esp32\\bin;C:\\Users\\kaminosono\\.espressif\\tools\\ninja\\1.10.2;C:\\Users\\kaminosono\\.espressif\\tools\\idf-exe\\1.0.3;C:\\Users\\kaminosono\\.espressif\\tools\\ccache\\4.3\\ccache-4.3-windows-64;C:\\Users\\kaminosono\\.espressif\\tools\\dfu-util\\0.9\\dfu-util-0.9-win64",
    "idf.customExtraVars": "{\"OPENOCD_SCRIPTS\":\"C:\\\\Users\\\\kaminosono\\\\.espressif\\\\tools\\\\openocd-esp32\\\\v0.10.0-esp32-20211111/openocd-esp32/share/openocd/scripts\",\"IDF_CCACHE_ENABLE\":\"1\"}",
    "idf.openOcdConfigs": [
        "interface/ftdi/esp32_devkitj_v1.cfg",
        "target/esp32s3.cfg"
    ],
    "idf.portWin": "COM3",
    "idf.flashType": "UART",
    "cmake.configureOnOpen": true,
    "extensions.ignoreRecommendations": true
}

Screenshots

  • img1_work collectly with build flash and monitor.png img1_work collectly with build flash and monitor
  • img2_work collectly with command line GDB.png img2_work collectly with command line GDB
  • img3_work collectly with eclipse.png img3_work collectly with eclipse
  • img4_NOT work with vscode extention.png img4_NOT work with vscode extention

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16

Most upvoted comments

Could you change

"idf.openOcdConfigs": [
        "interface/ftdi/esp32_devkitj_v1.cfg",
        "target/esp32s3.cfg"
    ],

to

"idf.openOcdConfigs": [
        "board/esp32s3-ftdi.cfg"
    ],

The issue seems to be starting openOCD from Visual Studio Code since openOCD config files don’t match the ones you are using in the command line.

 Error: no device found
❌ Error: unable to open ftdi device with vid 0403, pid 6010, description '*', serial '*' at bus location '*'
❌ Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED

Follow the troubleshooting information so we can understand what is happening in your setup.

In the launch.json change the logLevel to 4 and share the former and the openOCD output in the ESP-IDF Output channel.

Hi @brianignacio5 ,

I was able to confirm that VScode debugging works using the vsix installer that you introduced. Thank you very much for your help. If there is any information that I should check and share on my end for you, please let me know.

Thank you for the information. I have not been able to try yet. I will check next week and report back.

Sorry for late reply @TakuyaAtMono

Could you try this vsix installer and see if it is better ? We added some fixes in debug adapter in #617