Buid issue in VS Code

thoraz
Posts: 27
Joined: Tue Jan 28, 2020 4:02 pm

Buid issue in VS Code

Postby thoraz » Wed May 05, 2021 12:16 pm

I've installed the Espressif IDF extension in Visual Studio Code following the offiacial tutorial

https://github.com/espressif/vscode-esp ... install.md

but when I try to build the blink example project I get an error. The Doctor Command output is

Code: Select all

---------------------------------------------- ESP-IDF Extension for Visual Studio Code report ---------------------------------------------
OS win32 x64 10.0.19042 
System environment variable PATH 
 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\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Microchip\xc16\v1.50\bin;C:\Program Files (x86)\Microchip\xc32\v2.30\bin;C:\Program Files (x86)\National Instruments\Shared\LabVIEW CLI;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\;C:\Program Files\IVI Foundation\VISA\Win64\Bin\;C:\Program Files (x86)\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microchip\xc16\v1.50\bin;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files\Microchip\xc8\v2.20\bin;C:\Program Files (x86)\IVI Foundation\IVI\bin;C:\Program Files\IVI Foundation\IVI\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Gpg4win\..\GnuPG\bin;C:\Program Files\Polyspace\R2020a\runtime\win64;C:\Program Files\Polyspace\R2020a\bin;C:\Qwt-6.1.5\lib;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\dotnet\;C:\Program Files\PuTTY\;C:\Program Files\Git\cmd;C:\Users\Andrea\.espressif\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin;C:\Users\Andrea\.espressif\tools\xtensa-esp32s2-elf\esp-2020r3-8.4.0\xtensa-esp32s2-elf\bin;C:\Users\Andrea\.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin;C:\Users\Andrea\.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin;C:\Users\Andrea\.espressif\tools\cmake\3.16.4\bin;C:\Users\Andrea\.espressif\tools\openocd-esp32\v0.10.0-esp32-20200709\openocd-esp32\bin;C:\Users\Andrea\.espressif\tools\ninja\1.10.0\;C:\Users\Andrea\.espressif\tools\idf-exe\1.0.1\;C:\Users\Andrea\.espressif\tools\ccache\3.7\;C:\Users\Andrea\.espressif\tools\dfu-util\0.9\dfu-util-0.9-win64;C:\Users\Andrea\.espressif\python_env\idf4.2_py3.9_env\Scripts;C:\Users\Andrea\esp\esp-idf\tools;;C:\Users\Andrea\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\Andrea\AppData\Local\Programs\Python\Python39\;C:\Cadence\SPB_16.6\tools\pcb\bin;C:\Cadence\SPB_16.6\tools\fet\bin;C:\Cadence\SPB_16.6\openaccess\bin\win32\opt;C:\Cadence\SPB_16.6\tools\bin;C:\Cadence\SPB_16.6\tools\capture;C:\Cadence\SPB_16.6\tools\pspice;C:\Users\Andrea\AppData\Local\Microsoft\WindowsApps;C:\Flutter-SDK\bin;C:\Users\Andrea\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Andrea\.dotnet\tools; 
Visual Studio Code version 1.55.2 
Visual Studio Code language en 
Visual Studio Code shell C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe 
ESP-IDF Extension version 1.0.3 
---------------------------------------------------- Extension configuration settings ------------------------------------------------------
ESP-IDF Path (idf.espIdfPath) C:\Users\Andrea\esp\esp-idf
Custom extra paths (idf.customExtraPaths) C:\Users\Andrea\.espressif\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin;C:\Users\Andrea\.espressif\tools\xtensa-esp32s2-elf\esp-2020r3-8.4.0\xtensa-esp32s2-elf\bin;C:\Users\Andrea\.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin;C:\Users\Andrea\.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin;C:\Users\Andrea\.espressif\tools\cmake\3.16.4\bin;C:\Users\Andrea\.espressif\tools\openocd-esp32\v0.10.0-esp32-20200709\openocd-esp32\bin;C:\Users\Andrea\.espressif\tools\ninja\1.10.0;C:\Users\Andrea\.espressif\tools\idf-exe\1.0.1;C:\Users\Andrea\.espressif\tools\ccache\3.7;C:\Users\Andrea\.espressif\tools\dfu-util\0.9\dfu-util-0.9-win64
Custom extra vars (idf.customExtraVars) {"OPENOCD_SCRIPTS":"C:\\Users\\Andrea\\.espressif\\tools\\openocd-esp32\\v0.10.0-esp32-20200709/openocd-esp32/share/openocd/scripts","IDF_CCACHE_ENABLE":"1"}
Virtual env Python Path (idf.pythonBinPath) C:\Users\Andrea\.espressif\python_env\idf4.2_py3.9_env\Scripts\python.exe
Serial port (idf.port) /dev/ttyUSB1
OpenOCD Configs (idf.openOcdConfigs) interface/ftdi/esp32_devkitj_v1.cfg,target/esp32.cfg
ESP-IDF Tools Path (idf.toolsPath) ${env:IDF_TOOLS_PATH}
-------------------------------------------------------- Configurations access -------------------------------------------------------------
Access to ESP-IDF Path (idf.espIdfPath) true
Access to ESP-IDF Custom extra paths
Access to C:\Users\Andrea\.espressif\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin: true
Access to C:\Users\Andrea\.espressif\tools\xtensa-esp32s2-elf\esp-2020r3-8.4.0\xtensa-esp32s2-elf\bin: true
Access to C:\Users\Andrea\.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin: true
Access to C:\Users\Andrea\.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin: true
Access to C:\Users\Andrea\.espressif\tools\cmake\3.16.4\bin: true
Access to C:\Users\Andrea\.espressif\tools\openocd-esp32\v0.10.0-esp32-20200709\openocd-esp32\bin: true
Access to C:\Users\Andrea\.espressif\tools\ninja\1.10.0: true
Access to C:\Users\Andrea\.espressif\tools\idf-exe\1.0.1: true
Access to C:\Users\Andrea\.espressif\tools\ccache\3.7: true
Access to C:\Users\Andrea\.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.31.1.windows.1
ESP-IDF version 4.2.1
Python version 3.9.4
Python's pip version 20.2.3
-------------------------------------------------- Python packages in idf.pythonBinPath ----------------------------------------------------
bidict version: 0.21.2
bitstring version: 3.1.7
Brotli version: 1.0.9
certifi version: 2020.12.5
cffi version: 1.14.5
chardet version: 4.0.0
click version: 7.1.2
contextlib2 version: 0.6.0.post1
cryptography version: 3.4.7
ecdsa version: 0.16.1
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.0.0
idf-component-manager version: 0.2.1a1
idna version: 2.10
itsdangerous version: 1.1.0
Jinja2 version: 2.11.3
lxml version: 4.6.3
MarkupSafe version: 1.1.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: 4.1.0
python-socketio version: 5.2.1
pywin32 version: 300
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.15.0
tqdm version: 4.60.0
urllib3 version: 1.26.4
websocket-client version: 0.59.0
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 C:\Users\Andrea\esp\esp-idf\requirements.txt are satisfied.
---------------------------------------------------- Check extension requirements.txt ------------------------------------------------------
Check Extension Python packages Python requirements from c:\Users\Andrea\.vscode\extensions\espressif.esp-idf-extension-1.0.3\requirements.txt are satisfied.
---------------------------------------------------- Check ESP-IDF debug adapter requirements.txt ------------------------------------------
Check Debug AdapterPython packages Python requirements from c:\Users\Andrea\.vscode\extensions\espressif.esp-idf-extension-1.0.3\esp_debug_adapter\requirements.txt are satisfied.
---------------------------------------------------- Visual Studio Code launch.json --------------------------------------------------------
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "espidf",
            "name": "Launch",
            "request": "launch",
        }
    ]
}
 
---------------------------------------------------- Visual Studio Code c_cpp_properties.json ----------------------------------------------
{
    "configurations": [
        {
            "name": "ESP-IDF",
            "compilerPath": "",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "includePath": [
                "${config:idf.espIdfPath}/components/**",
                "${config:idf.espIdfPathWin}/components/**",
                "${workspaceFolder}/**"
            ],
            "browse": {
                "path": [
                    "${config:idf.espIdfPath}/components",
                    "${config:idf.espIdfPathWin}/components",
                    "${workspaceFolder}"
                ],
                "limitSymbolsToIncludedHeaders": false
            },
            "compileCommands": "${workspaceFolder}/build/compile_commands.json"
        }
    ],
    "version": 4
} 
--------------------------------------------------------------------------------------------------------------------------------------------
and the log in the \.vscode\extensions\espressif.esp-idf-extension-1.0.3\esp_idf_vsc_ext.log is

Code: Select all

{"message":"Cannot access filePath: cmake","level":"error","timestamp":"2021-05-05T12:02:56.395Z"}
{"message":"Cannot access filePath: ninja","level":"error","timestamp":"2021-05-05T12:02:56.400Z"}
{"user":true,"message":"Something went wrong while trying to build the project","stack":"Error: CMake or Ninja executables not found\n\tat d.<anonymous> (c:\\Users\\Andrea\\.vscode\\extensions\\espressif.esp-idf-extension-1.0.3\\dist\\extension.js:1:110335)\n\tat Generator.next (<anonymous>)\n\tat s (c:\\Users\\Andrea\\.vscode\\extensions\\espressif.esp-idf-extension-1.0.3\\dist\\extension.js:1:109368)\n\tat processTicksAndRejections (internal/process/task_queues.js:97:5)","level":"error","timestamp":"2021-05-05T12:02:56.401Z"}
Why the two errors about founding the cmake and ninja?

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

Re: Buid issue in VS Code

Postby ESP_bignacio » Thu May 06, 2021 8:14 am

What is the build output ?

Those errors might had happened before the extension setup.

thoraz
Posts: 27
Joined: Tue Jan 28, 2020 4:02 pm

Re: Buid issue in VS Code

Postby thoraz » Thu May 06, 2021 9:15 am

ESP_bignacio wrote:
Thu May 06, 2021 8:14 am
What is the build output ?

Those errors might had happened before the extension setup.
If you mean the ESP-IDF Output tab in VS Code, it returns nothing:

Image

thoraz
Posts: 27
Joined: Tue Jan 28, 2020 4:02 pm

Re: Buid issue in VS Code

Postby thoraz » Thu May 06, 2021 9:25 am

I want point out that I had to add the environment variables manually. I set them in the User scope

Code: Select all

// New variable
IDF_PATH --> C:\Users\Andrea\esp\esp-idf

// New variable
IDF_TOOLS_PATH --> C:\Users\Andrea\.espressif

// New variable to use cause the Path reach the 2048 character limit
IDF_TOOLS_PATH_ALL
%IDF_TOOLS_PATH%\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin;
%IDF_TOOLS_PATH%\tools\xtensa-esp32s2-elf\esp-2020r3-8.4.0\xtensa-esp32s2-elf\bin;
%IDF_TOOLS_PATH%\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin;
%IDF_TOOLS_PATH%\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin;
%IDF_TOOLS_PATH%\tools\cmake\3.16.4\bin;
%IDF_TOOLS_PATH%\tools\openocd-esp32\v0.10.0-esp32-20200709\openocd-esp32\bin;
%IDF_TOOLS_PATH%\tools\ninja\1.10.0\;
%IDF_TOOLS_PATH%\tools\idf-exe\1.0.1\;
%IDF_TOOLS_PATH%\tools\ccache\3.7\;
%IDF_TOOLS_PATH%\tools\dfu-util\0.9\dfu-util-0.9-win64;
C:\Users\Andrea\.espressif\python_env\idf4.2_py3.9_env\Scripts;%IDF_PATH%\tools;
%IDF_TOOLS_PATH%\tools;

// In the Path variable I've added
%IDF_TOOLS_PATH_ALL%
The ESP-IDF extension can find the ESP environment. I had to use the IDF_TOOLS_PATH_ALL variable cause I can't add all those lines in Path cause windows give me error for maximum characters reached.

Who is online

Users browsing this forum: No registered users and 20 guests