Page 1 of 1

已配置idf-4.4的前提下安装配置vsc 的esp-idf插件关于环境变量的问题求助

Posted: Mon Jan 31, 2022 3:21 am
by kearney
我已经吧esp-idf v4.4整好了(依赖、配置、构建、烧录、监听等均已测试)。过程记录如https://backmountaindevil.github.io/#/h ... p32/espidf

并且按照官方文档的提建议我把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
同时vcs输出如下

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
但是,这些输出里的东西,我随便拿一个去尝试,都是没问题的,差别在哪里呢?就在于这个getidf,因为我没有把export.sh加入环境变量。原因官方文档也说了“现在您可以在任何终端窗口中运行 get_idf 来设置或刷新 esp-idf 环境。
这里不建议您直接将 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'.
在idf插件的 Idf: Custom Extra Paths(Paths to be appended to PATH)我试过加入getidf或者 “/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” 但是并么有什么用。请求技术之处

已经在bing、github issus、本论坛里搜索并阅读相关帖子,其中比较有用的有这个viewtopic.php?f=25&t=25479

Re: 已配置idf-4.4的前提下安装配置vsc 的esp-idf插件关于环境变量的问题求助

Posted: Tue Feb 15, 2022 7:40 am
by kearney
终止深究,终端方式用着还行