[VSCODE+ESP32H2] OpenOCD do not see correct script?

parf.nick
Posts: 5
Joined: Tue Aug 29, 2023 11:40 pm

[VSCODE+ESP32H2] OpenOCD do not see correct script?

Postby parf.nick » Tue Oct 03, 2023 10:20 pm

Hello.
I try to use VS Code with Espressif IDF plugin for ESP32-H2-DevKitM1.

When use launch(debug) settings(file settings.json) like this:
  1. {
  2.   "C_Cpp.intelliSenseEngine": "Tag Parser",
  3.   "idf.adapterTargetName": "esp32h2",
  4.   "cmake.configureOnOpen": false,
  5.   "idf.openOcdConfigs": [
  6.     "board/esp32h2-builtin.cfg"
  7.   ]
  8. }
openocd give me error, like this:
  1. [OpenOCD]
  2. ❌ Error: unable to open ftdi de ice with description '*', serial '*' at bus location '*'
  3. C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20230419/openocd-esp32/share/openocd/scripts/target/esp_common.cfg:4: Error:
  4. at file "C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20230419/openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 4
I have same error, when launch openocd from command line, like this (pass ftdi-script):
openocd.exe -f board\esp32h2-ftdi.cfg

As i think, plugin do not pass board/esp32h2-builtin.cfg builtin script correctly to open ocd.

What's wrong?
Thank you.

parf.nick
Posts: 5
Joined: Tue Aug 29, 2023 11:40 pm

Re: [VSCODE+ESP32H2] OpenOCD do not see correct script?

Postby parf.nick » Wed Oct 04, 2023 7:19 pm

Found other feature:

If idf.openOcdConfigs config field do not contain reference to interface script, openocd automatically use wrong VIN/PID and can not found the device.

With VS Code config like this:
  1. {
  2.   "C_Cpp.intelliSenseEngine": "Tag Parser",
  3.   "idf.adapterTargetName": "custom",
  4.   "idf.customAdapterTargetName": "esp32h2",
  5.   "idf.flashType": "JTAG",
  6.   "idf.portWin": "COM7",
  7.   "idf.openOcdDebugLevel": 4,
  8.   "idf.openOcdLaunchArgs": ["-l openocd_log.txt"],
  9.   "cmake.configureOnOpen": false,
  10.   "idf.openOcdConfigs": [
  11.     "board/esp32h2-builtin.cfg"
  12.   ]
  13. }
OpenOCD output is:
...
Debug: 23 12 command.c:152 script_debug(): command - espusbjtag vid_pid 0x303a 0x1002
Info : 24 12 esp_usb_jtag.c:894 esp_usb_jtag_vid_pid(): esp_usb_jtag: VID set to 0x303a and PID to 0x1002
Debug: 25 12 command.c:152 script_debug(): command - espusbjtag caps_descriptor 0x030A
.....
Error: 119 1463 esp_usb_jtag.c:646 esp_usb_jtag_init(): esp_usb_jtag: could not find or open device!


But, for Espressif IDE with same script file (board/esp32h2-builtin.cfg) for OpenOCD, output is:

Info : only one transport option; autoselecting 'jtag'
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
...
Info : esp_usb_jtag: serial (48:31:B7:C0:2A:E1)
Info : esp_usb_jtag: Device found. Base speed 24000KHz, div range 1 to 255


To find device correctly, type interface script explicitely:
  1. {
  2.    ...
  3.   "idf.openOcdConfigs": [
  4.     "[b]interface/esp_usb_jtag.cfg[/b]",
  5.     "board/esp32h2-builtin.cfg"
  6.   ]
  7. }
PS: Despite device found, debug session can't start correctly. Dont know why, this is next episodes;)

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

Re: [VSCODE+ESP32H2] OpenOCD do not see correct script?

Postby ESP_radurentea » Thu Oct 05, 2023 1:19 pm

Hi,

Can you run the "ESP-IDF: Doctor Command" (from Command Palette) and provide me with the output? It will be copied to the clip board

parf.nick
Posts: 5
Joined: Tue Aug 29, 2023 11:40 pm

Re: [VSCODE+ESP32H2] OpenOCD do not see correct script?

Postby parf.nick » Fri Oct 06, 2023 4:22 pm

Hi.
report.txt
(11.26 KiB) Downloaded 173 times

parf.nick
Posts: 5
Joined: Tue Aug 29, 2023 11:40 pm

Re: [VSCODE+ESP32H2] OpenOCD do not see correct script?

Postby parf.nick » Fri Oct 06, 2023 4:29 pm

This is openocd log file, when device detected, but debug session can't start:
openocd_log.zip
(4.85 MiB) Downloaded 263 times

Who is online

Users browsing this forum: No registered users and 89 guests