question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug Report]: ESP32-C3 cannot flash with JTAG(built-in USB-JTAG) (VSC-692)

See original GitHub issue

Pre Bug Report Checklist Before reporting any bug please make sure of these points.

  • 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 Recently I tried to use this extension to flash the FW with JTAG, but it failed. the error information as below:

Info : accepting 'tcl' connection on tcp/6666
Info : dropped 'tcl' connection
Info : accepting 'tcl' connection on tcp/6666
Flashing f:/BLE_WIFI/Espressif/SDK/blink/blink/build/partition_table/partition-table.bin at 0x8000
Info : JTAG tap: esp32c3.cpu tap/device found: 0x00005c25 (mfg: 0x612 (Espressif Systems), part: 0x0005, ver: 0x0)
** Flashing Failed **
-1

To Reproduce

I clicked the button the following plot highlighted if using JTAG, it failed. image

Note: everything is working well when using the UART.

Expected behavior ESP32-C3 can flash with JTAG with this extension

Screenshots pls refer to the Describe the bug I mentioned above

Environment (please complete the following information):

  • OS Name & Version: win10
  • VSCode Version: 1.57
  • ESP-IDF Version: 4.4
  • Python Version: 3.9

NOTE: You can use the ESP-IDF: Doctor command to generate a report of your configuration.

---------------------------------------------- ESP-IDF Extension for Visual Studio Code report --------------------------------------------- OS win32 x64 10.0.19042 System environment variable PATH D:\Python39\Scripts;D:\Python39;%ALLEGRO_BRD2ODB%\nv\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;c:\Program Files (x86)\HP\HP Performance Advisor;D:\PuTTY;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;C:\Program Files\IVI Foundation\VISA\Win64\Bin;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;D:\Git\cmd;C:\Program Files (x86)\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility;C:\Program Files (x86)\IVI Foundation\IVI\bin;C:\Program Files\IVI Foundation\IVI\bin;D:\CMake\bin;C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin;D:\doxygen\bin;D:\Mscgen;D:\stlink-1.3.0-win64\bin;C:\Program Files (x86)\Intel\Intel® Management Engine Components\DAL;C:\Program Files\Intel\Intel® Management Engine Components\DAL;C:\Users\wireless_tech\AppData\Local\Microsoft\WindowsApps;D:\Microsoft VS Code\bin Visual Studio Code version 1.57.0 Visual Studio Code language en Visual Studio Code shell C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe ESP-IDF Extension version 1.1.0 ---------------------------------------------------- Extension configuration settings ------------------------------------------------------ ESP-ADF Path (idf.espAdfPath) ${env:ADF_PATH} ESP-IDF Path (idf.espIdfPath) F:\BLE_WIFI\Espressif\SDK\esp-idf-c3 ESP-MDF Path (idf.espMdfPath) ${env:MDF_PATH} Custom extra paths (idf.customExtraPaths) F:\Tools\Espressif\IDF_Tools.espressif\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin;F:\Tools\Espressif\IDF_Tools.espressif\tools\xtensa-esp32s2-elf\esp-2020r3-8.4.0\xtensa-esp32s2-elf\bin;F:\Tools\Espressif\IDF_Tools.espressif\tools\xtensa-esp32s3-elf\esp-2020r3-8.4.0\xtensa-esp32s3-elf\bin;F:\Tools\Espressif\IDF_Tools.espressif\tools\riscv32-esp-elf\1.24.0.123_64eb9ff-8.4.0\riscv32-esp-elf\bin;F:\Tools\Espressif\IDF_Tools.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin;F:\Tools\Espressif\IDF_Tools.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin;F:\Tools\Espressif\IDF_Tools.espressif\tools\cmake\3.16.4\bin;F:\Tools\Espressif\IDF_Tools.espressif\tools\openocd-esp32\v0.10.0-esp32-20210401\openocd-esp32\bin;F:\Tools\Espressif\IDF_Tools.espressif\tools\ninja\1.10.2;F:\Tools\Espressif\IDF_Tools.espressif\tools\idf-exe\1.0.1;F:\Tools\Espressif\IDF_Tools.espressif\tools\ccache\3.7;F:\Tools\Espressif\IDF_Tools.espressif\tools\dfu-util\0.9\dfu-util-0.9-win64 Custom extra vars (idf.customExtraVars) {“OPENOCD_SCRIPTS”:“F:/Tools/Espressif/IDF_Tools/.espressif/tools/openocd-esp32/v0.10.0-esp32-20210401/openocd-esp32/share/openocd/scripts”,“IDF_CCACHE_ENABLE”:“1”} Virtual env Python Path (idf.pythonBinPath) F:\Tools\Espressif\IDF_Tools.espressif\python_env\idf4.4_py3.9_env\Scripts\python.exe Serial port (idf.port) COM36 OpenOCD Configs (idf.openOcdConfigs) board/esp32c3-builtin.cfg ESP-IDF Tools Path (idf.toolsPath) ${env:IDF_TOOLS_PATH} Git Path (idf.gitPath) git -------------------------------------------------------- Configurations access ------------------------------------------------------------- Access to ESP-ADF Path (idf.espIdfPath) false Access to ESP-IDF Path (idf.espIdfPath) true Access to ESP-MDF Path (idf.espIdfPath) false Access to ESP-IDF Custom extra paths Access to F:\Tools\Espressif\IDF_Tools.espressif\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin: true Access to F:\Tools\Espressif\IDF_Tools.espressif\tools\xtensa-esp32s2-elf\esp-2020r3-8.4.0\xtensa-esp32s2-elf\bin: true Access to F:\Tools\Espressif\IDF_Tools.espressif\tools\xtensa-esp32s3-elf\esp-2020r3-8.4.0\xtensa-esp32s3-elf\bin: true Access to F:\Tools\Espressif\IDF_Tools.espressif\tools\riscv32-esp-elf\1.24.0.123_64eb9ff-8.4.0\riscv32-esp-elf\bin: true Access to F:\Tools\Espressif\IDF_Tools.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin: true Access to F:\Tools\Espressif\IDF_Tools.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin: true Access to F:\Tools\Espressif\IDF_Tools.espressif\tools\cmake\3.16.4\bin: true Access to F:\Tools\Espressif\IDF_Tools.espressif\tools\openocd-esp32\v0.10.0-esp32-20210401\openocd-esp32\bin: true Access to F:\Tools\Espressif\IDF_Tools.espressif\tools\ninja\1.10.2: true Access to F:\Tools\Espressif\IDF_Tools.espressif\tools\idf-exe\1.0.1: true Access to F:\Tools\Espressif\IDF_Tools.espressif\tools\ccache\3.7: true Access to F:\Tools\Espressif\IDF_Tools.espressif\tools\dfu-util\0.9\dfu-util-0.9-win64: true Access to Virtual env Python Path (idf.pythonBinPath) true Access to CMake in environment PATH undefined Access to Ninja in environment PATH undefined Access to ESP-IDF Tools Path (idf.toolsPath) false ----------------------------------------------------------- Executables Versions ----------------------------------------------------------- Git version 2.30.0.windows.1 ESP-IDF version 4.4 Python version 3.9.1 Python’s pip version 20.2.3 -------------------------------------------------- Python packages in idf.pythonBinPath ---------------------------------------------------- bitstring version: 3.1.7 Brotli version: 1.0.9 certifi version: 2021.5.30 cffi version: 1.14.5 chardet version: 4.0.0 click version: 8.0.1 colorama version: 0.4.4 construct version: 2.10.54 contextlib2 version: 0.6.0.post1 cryptography version: 3.4.7 ecdsa version: 0.17.0 esp-windows-curses version: 0.1 Flask version: 0.12.5 Flask-Compress version: 1.9.0 Flask-SocketIO version: 2.9.6 future version: 0.18.2 gcovr version: 4.2 gdbgui version: 0.13.2.0 gevent version: 1.5.0 greenlet version: 1.1.0 idf-component-manager version: 0.2.1a1 idna version: 2.10 itsdangerous version: 2.0.1 Jinja2 version: 3.0.1 kconfiglib version: 13.7.1 lxml version: 4.6.3 MarkupSafe version: 2.0.1 pip version: 20.2.3 psutil version: 5.8.0 pycparser version: 2.20 pyelftools version: 0.27 pygdbmi version: 0.9.0.2 Pygments version: 2.9.0 pyparsing version: 2.3.1 pyserial version: 3.5 python-engineio version: 3.14.2 python-socketio version: 4.6.1 pywin32 version: 301 PyYAML version: 5.4.1 reedsolo version: 1.5.4 requests version: 2.25.1 requests-toolbelt version: 0.9.1 schema version: 0.7.4 semantic-version version: 2.8.5 setuptools version: 49.2.1 six version: 1.16.0 tqdm version: 4.61.0 urllib3 version: 1.26.5 websocket-client version: 1.0.1 Werkzeug version: 0.16.1 wheel version: 0.36.2 windows-curses version: 2.2.0 xmlrunner version: 1.7.7 ---------------------------------------------------- Check ESP-IDF python requirements.txt ------------------------------------------------- Check ESP-IDF Python packages Python requirements from F:\BLE_WIFI\Espressif\SDK\esp-idf-c3\requirements.txt are satisfied. ---------------------------------------------------- Check extension requirements.txt ------------------------------------------------------ Check Extension Python packages Python requirements from c:\Users\wireless_tech.vscode\extensions\espressif.esp-idf-extension-1.1.0\requirements.txt are satisfied. ---------------------------------------------------- Check ESP-IDF debug adapter requirements.txt ------------------------------------------ Check Debug AdapterPython packages Python requirements from c:\Users\wireless_tech.vscode\extensions\espressif.esp-idf-extension-1.1.0\esp_debug_adapter\requirements.txt are satisfied. ---------------------------------------------------- Visual Studio Code launch.json -------------------------------------------------------- { “version”: “0.2.0”, “configurations”: [ { “name”: “GDB”, “type”: “cppdbg”, “request”: “launch”, “MIMode”: “gdb”, “miDebuggerPath”: “${command:espIdf.getXtensaGdb}”, “program”: “${workspaceFolder}/build/${command:espIdf.getProjectName}.elf”, “windows”: { “program”: “${workspaceFolder}\build\${command:espIdf.getProjectName}.elf” }, “cwd”: “${workspaceFolder}”, “environment”: [{ “name”: “PATH”, “value”: “${config:idf.customExtraPaths}” }], “setupCommands”: [ { “text”: “target remote :3333” }, { “text”: “mon reset halt” }, { “text”: “thb app_main” }, { “text”: “flushregs” } ], “externalConsole”: false, “logging”: { “engineLogging”: true } } ] } ---------------------------------------------------- Visual Studio Code c_cpp_properties.json ---------------------------------------------- { “configurations”: [ { “name”: “ESP-IDF”, “compilerPath”: “F:\Tools\Espressif\IDF_Tools\.espressif\tools\riscv32-esp-elf\1.24.0.123_64eb9ff-8.4.0\riscv32-esp-elf\bin\riscv32-esp-elf-gcc.exe”, “cStandard”: “c11”, “cppStandard”: “c++17”, “compileCommands”: “${workspaceFolder}/build/compile_commands.json”, “includePath”: [ “${config:idf.espIdfPath}/components/", "${config:idf.espIdfPathWin}/components/”, “${config:idf.espAdfPath}/components/", "${config:idf.espAdfPathWin}/components/”, “${workspaceFolder}/" ], “browse”: { “path”: [ “${config:idf.espIdfPath}/components”, “${config:idf.espIdfPathWin}/components”, "${config:idf.espAdfPath}/components/”, “${config:idf.espAdfPathWin}/components/**”, “${workspaceFolder}” ], “limitSymbolsToIncludedHeaders”: false } } ], “version”: 4 }


Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:26 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
xiaolongbacommented, Jul 28, 2021

What is the content of gdbinit ?

image

Are you running openOCD in other terminal with the right config file ?

yes, I started running openOCD in the vscode already, and it works well and the led becomes green

openocd -f board/esp32c3-builtin.cfg

I configured it in the setting.json, as below: image

If OpenOCD doesn’t start properly then debug adapter would fail before even starting. What is openOCD output ? regarding the output, I will provide it to you later as the board I left it at home.

I tested and found that the root is caused by the instructions we are talking about are invalid in window os, while it is ok in Linux os. you can easy to duplicate it when using the Windows OS

0reactions
xiaolongbacommented, Jul 28, 2021

This last issue is better to report in openOCD repository instead.

got it. the ticket about it has been submitted in openOCD repository already

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while flashing ESP32-C3-DevKitM-1 via builtin JTAG ...
It looks OK since the board is recognized as a COM port, so I can flash it using idf.py -p COMx flash monitor....
Read more >
Configure ESP32-C3 built-in JTAG Interface - Espressif Systems
ESP32-C3 has a built-in JTAG circuitry and can be debugged without any additional chip. Only an USB cable connected to the D+/D- pins...
Read more >
ESP32-C3 Mini Devkit: Configure for Built in USB JTAG?
When I try and compile "helloworld" for the C3 I either get toos not found or some other error in Eclipse. I am...
Read more >
DEBUGGING your ESP-IDF code using JTAG [VS CODE]
How to DEBUG your ESP32 IDF application inside Visual Studio Code using an external debugger tool. We'll be using the ESP-PROG, a JTAG...
Read more >
Working With ESP-C3-32S-Kit Dev Board - Steve Branam
This section describes interactive debugging on a board. The ESP32-C3 chip includes a built-in USB-to-JTAG interface (diagram from Debugging the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found