并且按照官方文档的提建议我把get_idf作为一个激活指令,而不是把export.sh加入环境变量。
于是乎,我想着在vs c插件里配置使用已经搭建好的idf,然而进入 Advance 选择存在的idf(/opt/esp/esp-idf-v4.4/)、idf/tool(/opt/esp/esp-idf-v4.4/tools/)、py虚拟环境(/home/kearney/.espressif/python_env/idf4.4_py3.10_env/bin/python)之后Install,vsc提示command fail,内容如下
Code: Select all
/home/kearney/.espressif/python_env/idf4.4_py3.10_env/bin/python /opt/esp/esp-idf-v4.4/tools/idf_tools.py install-python-env ERROR: This script was called from a virtual environment, can not create a virtual environment again
Code: Select all
/bin/sh:行1: esp32s2ulp-elf-as:未找到命令
Command failed: esp32s2ulp-elf-as --version
/bin/sh:行1: esp32s2ulp-elf-as:未找到命令
Error checking esp32s2ulp-elf version
Error: Command failed: esp32s2ulp-elf-as --version
/bin/sh:行1: esp32s2ulp-elf-as:未找到命令
/bin/sh:行1: esp32ulp-elf-as:未找到命令
Command failed: esp32ulp-elf-as --version
/bin/sh:行1: esp32ulp-elf-as:未找到命令
Error checking esp32ulp-elf version
Error: Command failed: esp32ulp-elf-as --version
/bin/sh:行1: esp32ulp-elf-as:未找到命令
/bin/sh:行1: riscv32-esp-elf-gcc:未找到命令
Command failed: riscv32-esp-elf-gcc --version
/bin/sh:行1: riscv32-esp-elf-gcc:未找到命令
Error checking riscv32-esp-elf version
Error: Command failed: riscv32-esp-elf-gcc --version
/bin/sh:行1: riscv32-esp-elf-gcc:未找到命令
/bin/sh:行1: xtensa-esp32s3-elf-gcc:未找到命令
Command failed: xtensa-esp32s3-elf-gcc --version
/bin/sh:行1: xtensa-esp32s3-elf-gcc:未找到命令
Error checking xtensa-esp32s3-elf version
Error: Command failed: xtensa-esp32s3-elf-gcc --version
/bin/sh:行1: xtensa-esp32s3-elf-gcc:未找到命令
/bin/sh:行1: xtensa-esp32s2-elf-gcc:未找到命令
Command failed: xtensa-esp32s2-elf-gcc --version
/bin/sh:行1: xtensa-esp32s2-elf-gcc:未找到命令
Error checking xtensa-esp32s2-elf version
Error: Command failed: xtensa-esp32s2-elf-gcc --version
/bin/sh:行1: xtensa-esp32s2-elf-gcc:未找到命令
/bin/sh:行1: xtensa-esp32-elf-gcc:未找到命令
Command failed: xtensa-esp32-elf-gcc --version
/bin/sh:行1: xtensa-esp32-elf-gcc:未找到命令
Error checking xtensa-esp32-elf version
Error: Command failed: xtensa-esp32-elf-gcc --version
/bin/sh:行1: xtensa-esp32-elf-gcc:未找到命令
/bin/sh:行1: openocd:未找到命令
Command failed: openocd --version
/bin/sh:行1: openocd:未找到命令
Error checking openocd-esp32 version
Error: Command failed: openocd --version
/bin/sh:行1: openocd:未找到命令
Error: read ECONNRESET
at TLSWrap.onStreamRead (internal/stream_base_commons.js:209:20)
Error opening esp-idf version list file. HTTP/HTTPS Request error https://dl.espressif.com/dl/esp-idf/idf_versions.txt
/bin/sh:行1: esp32s2ulp-elf-as:未找到命令
Command failed: esp32s2ulp-elf-as --version
/bin/sh:行1: esp32s2ulp-elf-as:未找到命令
Error checking esp32s2ulp-elf version
Error: Command failed: esp32s2ulp-elf-as --version
/bin/sh:行1: esp32s2ulp-elf-as:未找到命令
/bin/sh:行1: esp32ulp-elf-as:未找到命令
Command failed: esp32ulp-elf-as --version
/bin/sh:行1: esp32ulp-elf-as:未找到命令
Error checking esp32ulp-elf version
Error: Command failed: esp32ulp-elf-as --version
/bin/sh:行1: esp32ulp-elf-as:未找到命令
/bin/sh:行1: riscv32-esp-elf-gcc:未找到命令
Command failed: riscv32-esp-elf-gcc --version
/bin/sh:行1: riscv32-esp-elf-gcc:未找到命令
Error checking riscv32-esp-elf version
Error: Command failed: riscv32-esp-elf-gcc --version
/bin/sh:行1: riscv32-esp-elf-gcc:未找到命令
/bin/sh:行1: xtensa-esp32s3-elf-gcc:未找到命令
Command failed: xtensa-esp32s3-elf-gcc --version
/bin/sh:行1: xtensa-esp32s3-elf-gcc:未找到命令
Error checking xtensa-esp32s3-elf version
Error: Command failed: xtensa-esp32s3-elf-gcc --version
/bin/sh:行1: xtensa-esp32s3-elf-gcc:未找到命令
/bin/sh:行1: xtensa-esp32s2-elf-gcc:未找到命令
Command failed: xtensa-esp32s2-elf-gcc --version
/bin/sh:行1: xtensa-esp32s2-elf-gcc:未找到命令
Error checking xtensa-esp32s2-elf version
Error: Command failed: xtensa-esp32s2-elf-gcc --version
/bin/sh:行1: xtensa-esp32s2-elf-gcc:未找到命令
/bin/sh:行1: xtensa-esp32-elf-gcc:未找到命令
Command failed: xtensa-esp32-elf-gcc --version
/bin/sh:行1: xtensa-esp32-elf-gcc:未找到命令
Error checking xtensa-esp32-elf version
Error: Command failed: xtensa-esp32-elf-gcc --version
/bin/sh:行1: xtensa-esp32-elf-gcc:未找到命令
/bin/sh:行1: openocd:未找到命令
Command failed: openocd --version
/bin/sh:行1: openocd:未找到命令
Error checking openocd-esp32 version
Error: Command failed: openocd --version
/bin/sh:行1: openocd:未找到命令
ERROR: This script was called from a virtual environment, can not create a virtual environment again
Command failed: /home/kearney/.espressif/python_env/idf4.4_py3.10_env/bin/python /opt/esp/esp-idf-v4.4/tools/idf_tools.py install-python-env
ERROR: This script was called from a virtual environment, can not create a virtual environment again
Command failed: /home/kearney/.espressif/python_env/idf4.4_py3.10_env/bin/python /opt/esp/esp-idf-v4.4/tools/idf_tools.py install-python-env
ERROR: This script was called from a virtual environment, can not create a virtual environment again
ERROR: This script was called from a virtual environment, can not create a virtual environment again
Command failed: /home/kearney/.espressif/python_env/idf4.4_py3.10_env/bin/python /opt/esp/esp-idf-v4.4/tools/idf_tools.py install-python-env
ERROR: This script was called from a virtual environment, can not create a virtual environment again
Command failed: /home/kearney/.espressif/python_env/idf4.4_py3.10_env/bin/python /opt/esp/esp-idf-v4.4/tools/idf_tools.py install-python-env
ERROR: This script was called from a virtual environment, can not create a virtual environment again
这里不建议您直接将 export.sh 添加到 shell 的配置文件。因为这会导致在每个终端会话中都激活 IDF 虚拟环境(包括无需使用 IDF 的情况),从而破坏使用虚拟环境的目的,并可能影响其他软件的使用。”。那么我是否可以从idf插件配置中加入这些参数呢?
Code: Select all
$ getidf
Setting IDF_PATH to '/opt/esp/esp-idf-v4.4'
Detecting the Python interpreter
Checking "python" ...
Python 3.10.1
"python" has been detected
Adding ESP-IDF tools to PATH...
Using Python interpreter in /home/kearney/.espressif/python_env/idf4.4_py3.10_env/bin/python
Checking if Python packages are up to date...
Python requirements from /opt/esp/esp-idf-v4.4/requirements.txt are satisfied.
Added the following directories to PATH:
/opt/esp/esp-idf-v4.4/components/esptool_py/esptool
/opt/esp/esp-idf-v4.4/components/espcoredump
/opt/esp/esp-idf-v4.4/components/partition_table
/opt/esp/esp-idf-v4.4/components/app_update
/home/kearney/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin
/home/kearney/.espressif/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin
/home/kearney/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-8.4.0/xtensa-esp32s3-elf/bin
/home/kearney/.espressif/tools/riscv32-esp-elf/esp-2021r2-8.4.0/riscv32-esp-elf/bin
/home/kearney/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin
/home/kearney/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin
/home/kearney/.espressif/tools/openocd-esp32/v0.11.0-esp32-20211220/openocd-esp32/bin
/home/kearney/.espressif/python_env/idf4.4_py3.10_env/bin
/opt/esp/esp-idf-v4.4/tools
Done! You can now compile ESP-IDF projects.
Go to the project directory and run:
idf.py build
$ xtensa-esp32s2-elf-gcc
xtensa-esp32s2-elf-gcc: fatal error: no input files
$ esp32s2ulp-elf-as --version
GNU assembler (GNU Binutils) 2.28.51-esp-20191205
Copyright (C) 2017 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `esp32s2ulp-elf'.
已经在bing、github issus、本论坛里搜索并阅读相关帖子,其中比较有用的有这个viewtopic.php?f=25&t=25479