espressif / vscode-esp-idf-extension

Visual Studio Code extension for ESP-IDF projects
Apache License 2.0
1.03k stars 301 forks source link

[Question]: Minimum OpenOCD version error message when trying to flash with JTAG (VSC-543) #289

Closed ihouses closed 3 years ago

ihouses commented 3 years ago

I have downloaded the tool chain and everything with the visual studio extension. I can compile and flash with no problem with the UART but if I try to flash with the JTAG I get this meesage:

Minimum OpenOCD version v0.10.0-esp32-20201125 is required while you have v0.10.0-esp32-20200709 version installed

The version that the tool installed is the v0.10.0-esp32-20200709 stored in C:\esp\tools.espressif\tools\openocd-esp32

How can I change or update the OpenOCD version??

OS Name & Version: Windows 10 VSCode Version: 1.52.1 ESP-IDF Version: 0.6.0 Python Version: 3.9.0

Content of the JSON config file:

{
    "C_Cpp.updateChannel": "Insiders",
    "gitlens.views.repositories.location": "scm",
    "gitlens.views.fileHistory.location": "scm",
    "gitlens.views.lineHistory.location": "scm",
    "gitlens.views.compare.location": "scm",
    "gitlens.views.search.location": "scm",
    "git.autofetch": true,
    "cmake.configureOnOpen": true,
    "files.autoSave": "afterDelay",
    "workbench.iconTheme": "vscode-icons",
    "idf.showOnboardingOnInit": true,
    "idf.espIdfPathWin": "c:\\esp\\esp-idf",
    "idf.espAdfPathWin": "c:\\esp\\esp-adf",
    "idf.customExtraPaths": "c:\\esp\\tools\\.espressif\\tools\\xtensa-esp32-elf\\esp-2020r3-8.4.0\\xtensa-esp32-elf\\bin;c:\\esp\\tools\\.espressif\\tools\\xtensa-esp32s2-elf\\esp-2020r3-8.4.0\\xtensa-esp32s2-elf\\bin;c:\\esp\\tools\\.espressif\\tools\\esp32ulp-elf\\2.28.51-esp-20191205\\esp32ulp-elf-binutils\\bin;c:\\esp\\tools\\.espressif\\tools\\esp32s2ulp-elf\\2.28.51-esp-20191205\\esp32s2ulp-elf-binutils\\bin;c:\\esp\\tools\\.espressif\\tools\\cmake\\3.16.4\\bin;c:\\esp\\tools\\.espressif\\tools\\openocd-esp32\\v0.10.0-esp32-20200709\\openocd-esp32\\bin;c:\\esp\\tools\\.espressif\\tools\\ninja\\1.10.0;c:\\esp\\tools\\.espressif\\tools\\idf-exe\\1.0.1;c:\\esp\\tools\\.espressif\\tools\\ccache\\3.7;c:\\esp\\tools\\.espressif\\tools\\dfu-util\\0.9\\dfu-util-0.9-win64",
    "idf.toolsPathWin": "c:\\esp\\tools\\.espressif",
    "idf.pythonBinPath": "PYTHON_INTERPRETER",
    "idf.customExtraVars": "{\"OPENOCD_SCRIPTS\":\"c:\\\\esp\\\\tools\\\\.espressif\\\\tools\\\\openocd-esp32\\\\v0.10.0-esp32-20200709/openocd-esp32/share/openocd/scripts\",\"IDF_CCACHE_ENABLE\":\"1\"}",
    "idf.pythonBinPathWin": "c:\\esp\\tools\\.espressif\\python_env\\idf4.2_py3.9_env\\Scripts\\python.exe",
    "idf.espIdfPath": "c:\\esp\\esp-idf",
    "idf.espAdfPath": "c:\\esp\\esp-adf",
    "emmet.excludeLanguages": [

        "markdown"
    ],
    "window.zoomLevel": 1
}
brianignacio5 commented 3 years ago

Yes the thing is, some changes were implemented on openOCD to allow Visual Studio Code to perform JTAG flashing from this version.

If you want to replace openOCD, just get one of the latest openOCD releases and replace c:\\esp\\tools\\.espressif\\tools\\openocd-esp32\\v0.10.0-esp32-20200709\\openocd-esp32\\bin in your idf.customExtraPaths for the bin directory of your chosen release version, for example c:\\esp\\tools\\.espressif\\tools\\openocd-esp32\\v0.10.0-esp32-20201202\\openocd-esp32\\bin if you extract this version on your .espressif/tools directory. Also update idf.customExtraVars OPENOCD_SCRIPTS to new OpenOCD Scripts folder path.

brianignacio5 commented 3 years ago

I'm closing this issue since answer to question is provided. Please comment here if this solution doesn't fix your issue.

jmporter34 commented 3 years ago

Newb question regarding "replace XXX with YYY in your idf.customExtraPaths" - what is the file name that has to be edited ? Same question for "Also update idf.customExtraVars OPENOCD_SCRIPTS to new OpenOCD Scripts folder path.". And where is it/are they located ? Thanks

brianignacio5 commented 3 years ago

@jmporter34

Command Palette (F1 or View Menu -> Command Palette) and type Preferences: Open Settings (UI) or Command Palette (F1 or View Menu -> Command Palette) and type Preferences: Open Settings (JSON) or in your project .vscode/settings.json.

This is described in SETUP JSON Manual Configuration documentation.

sriccardi-invn commented 3 years ago

Hi, I had the same issue. I updated OpenOCD to v0.10.0-esp32-20210902 and I still have the issue: 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: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1) Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1) Info : esp32: Target halted, PC=0x4008FBA3, debug_reason=00000001 Info : Listening on port 3333 for gdb connections Info : accepting 'tcl' connection on tcp/6666 Info : dropped 'tcl' connection Info : accepting 'tcl' connection on tcp/6666 invalid command name "program_esp_bins" Info : accepting 'tcl' connection on tcp/6666 Info : dropped 'tcl' connection Info : accepting 'tcl' connection on tcp/6666 invalid command name "program_esp_bins"