日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

小明分享|基于VSCode Espress IDF软件环境搭建

發布時間:2024/10/14 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 小明分享|基于VSCode Espress IDF软件环境搭建 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

VS code下載網址: ——現版本安裝包大小大約60M左右,是一個輕量級但功能強大的源代碼編輯器,適用于Windows、macOS和Linux。支持安裝擴展各類應用插件。
https://code.visualstudio.com/docs/?dv=win

需以管理員模式運行VS code(Python下載文件時可能會出現以下錯誤:Cache entry deserialization
failed, entry ignored)
下載espress IDF插件:

下載完插件后,按下Ctrl+Shift+p輸入: espidf configure extension,回車,即可進行IDF插件的配置界面
以上提示: 1. 需要提前裝好Git與Python應用(如果你的電腦已經安裝過git或者Python則不用重新安裝,
VScode會自動找到用戶軟件安裝路徑,前提你沒有安裝后修改軟件目錄)
2. 是否每次開機時打開這個畫面
3. 配置保存在哪里
其中Python版本要求:Python 3.7+,Git無版本限制,安裝Python時記得勾選生效全局變量文件,忘
記勾選也可以在全局變量PATH中新增:
Python\Python39\ Python\Python39\Scripts,這兩項。
隨后點擊START,即可進行工具鏈目錄配置,當然前提是你的PC端已經安裝好Git/Python,及ESP_IDF依賴包進入Python路徑選擇界面,之前我下載過其他版本的Python,VScode將安裝的路徑都一一羅列,可以到‘我的電腦’查看是否存在該路徑并確認Python版本號。

這里我選擇了D盤的Python3.6.4版本(錯誤示范),選擇完畢,點擊配置ESP-IDF。

隨后進入的是ESP-IDF依賴包工具配置界面,此處的配置有兩種方法:
一. 在線下載,選擇你所要安裝的版本,選擇下載目錄,隨后點擊‘Click here to download’即可開始下
載安裝,不過由于是外網下載可能很慢,所以以下提供ESP-IDF百度云鏈接,可以通過方法二進行配置安裝。

二. 離線下載,選擇‘在系統中查詢ESP-IDF版本’,隨后找到全部解壓后的ESP-IDF路徑中的esp-idf v4.1文件夾,最后點擊‘Click here to check if is valid’驗證路徑中是否存在ESP-IDF。

驗證成功將出現路徑的版本信息與idf.py工具存在。最后點擊’ESP-IDP Tools setup’,進行ESP-IDF工具依賴安裝。
此處無論你是使用離線下載或者在線下載的方式,都需要選擇’Download ESP-IDF Tools’。另一個選項為跳過安裝直接進入工具鏈環境安裝驗證。

如果你是離線下載好的工具鏈則選擇工具鏈文件夾的上一級目錄,但注意不要選擇工具鏈文件夾內,它的下載規則是在指定目錄新建文件夾并下載工具鏈,如果已經存在對應文件就將跳過下載。如果你是在線下載的只需選擇下載路徑,點擊Download,接下來只需等待下載安裝。

解析到對應下載文件后,其會把對應壓縮包解壓安裝,接下來進行等待工具鏈安裝完畢即可。


此處可能會要求你進行環境變量添加,此處還沒驗證不添加有何錯誤:

工具鏈安裝編譯日志:

idf_versions.txt has (1) KB idf_versions.txt progress: 100.00% (0.08 / 0.08) KB Saving D:\Anaconda\python.exe to create python virtual environment. Downloading Toolchain for Xtensa (ESP32) based on GCC xtensa-esp32-elf-gcc8_2_0-esp-2020r2-win64.zip has (104009) KB xtensa-esp32-elf-gcc8_2_0-esp-2020r2-win64.zip progress: 0.02% (15.64 / 104008.97) KB xtensa-esp32-elf-gcc8_2_0-esp-2020r2-win64.zip progress: 0.03% (31.64 / 104008.97) KB … xtensa-esp32-elf-gcc8_2_0-esp-2020r2-win64.zip progress: 100.00% (104008.97 / 104008.97) KB Downloading Toolchain for Xtensa (ESP32-S2) based on GCC xtensa-esp32s2-elf-gcc8_2_0-esp-2020r2-win64.zip has (104360) KB xtensa-esp32s2-elf-gcc8_2_0-esp-2020r2-win64.zip progress: 0.01% (15.64 / 104359.95) KB xtensa-esp32s2-elf-gcc8_2_0-esp-2020r2-win64.zip progress: 0.03% (31.64 / 104359.95) KB … xtensa-esp32s2-elf-gcc8_2_0-esp-2020r2-win64.zip progress: 100.00% (104359.95 / 104359.95) KB Downloading Toolchain for ESP32 ULP coprocessor Failed download. Retrying… Error: HTTP/HTTPS Request error https://github.com/espressif/binutils- esp32ulp/releases/download/v2.28.51-esp-20191205/binutils-esp32ulp-win32- 2.28.51-esp-20191205.zip Waiting 8 seconds… Failed download. Retrying…
Error: HTTP/HTTPS Request error https://github.com/espressif/binutils- esp32ulp/releases/download/v2.28.51-esp-20191205/binutils-esp32ulp-win32- 2.28.51-esp-20191205.zip Waiting 16 seconds… Failed download. Retrying… Error: HTTP/HTTPS Request error https://github.com/espressif/binutils- esp32ulp/releases/download/v2.28.51-esp-20191205/binutils-esp32ulp-win32- 2.28.51-esp-20191205.zip false Downloading Toolchain for Xtensa (ESP32) based on GCC Found xtensa-esp32-elf in f:\espidf_vs\dist Downloading Toolchain for Xtensa (ESP32-S2) based on GCC Found xtensa-esp32s2-elf in f:\espidf_vs\dist Downloading Toolchain for ESP32 ULP coprocessor Found esp32ulp-elf in f:\espidf_vs\dist Downloading Toolchain for ESP32-S2 ULP coprocessor Found esp32s2ulp-elf in f:\espidf_vs\dist Downloading CMake build system Found cmake in f:\espidf_vs\dist Downloading OpenOCD for ESP32 Found openocd-esp32 in f:\espidf_vs\dist Downloading Ninja build system Found ninja in f:\espidf_vs\dist Downloading IDF wrapper tool for Windows Found idf-exe in f:\espidf_vs\dist Downloading Ccache (compiler cache) Found ccache in f:\espidf_vs\dist Installing package Toolchain for Xtensa (ESP32) based on GCC Installing zip package Toolchain for Xtensa (ESP32) based on GCC Installing package Toolchain for Xtensa (ESP32-S2) based on GCC Installing zip package Toolchain for Xtensa (ESP32-S2) based on GCC Installing package Toolchain for ESP32 ULP coprocessor Installing zip package Toolchain for ESP32 ULP coprocessor Installing package Toolchain for ESP32-S2 ULP coprocessor Installing zip package Toolchain for ESP32-S2 ULP coprocessor Installing package CMake build system Installing zip package CMake build system Installing package OpenOCD for ESP32 Installing zip package OpenOCD for ESP32 Installing package Ninja build system Installing zip package Ninja build system Installing package IDF wrapper tool for Windows Installing zip package IDF wrapper tool for Windows Installing package Ccache (compiler cache) Installing zip package Ccache (compiler cache) Installing python virtualenv and ESP-IDF python requirements… Creating a new Python environment in f:\espidf_vs\python_env\idf4.1_py3.6_env … Collecting wheel Downloading https://files.pythonhosted.org/packages/a7/00/3df031b3ecd5444d572141321537080b40 c1c25e1caa3d86cdd12e5e919c/wheel-0.35.1-py2.py3-none-any.whl Installing collected packages: wheel Successfully installed wheel-0.35.1 Cache entry deserialization failed, entry ignored
Cache entry deserialization failed, entry ignored Collecting wheel Downloading https://files.pythonhosted.org/packages/a7/00/3df031b3ecd5444d572141321537080b40 c1c25e1caa3d86cdd12e5e919c/wheel-0.35.1-py2.py3-none-any.whl Installing collected packages: wheel Successfully installed wheel-0.35.1 Cache entry deserialization failed, entry ignored Cache entry deserialization failed, entry ignored Processing \${idf_path}\tools\kconfig_new\esp-windows-curses Exception: Traceback (most recent call last): File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\basecommand.py”, line 215, in main status = self.run(options, args) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\commands\install.py”, line 335, in run wb.build(autobuilding=True) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\wheel.py”, line 749, in build self.requirement_set.prepare_files(self.finder) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\req\req_set.py”, line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\req\req_set.py”, line 620, in prepare_file session=self.session, hashes=hashes) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\download.py”, line 809, in unpack_url unpack_file_url(link, location, download_dir, hashes=hashes) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\download.py”, line 715, in unpack_file_url unpack_file(from_path, location, content_type, link) File "f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\utils_init.py", line 602, in unpack_file tarfile.is_tarfile(filename) or File “D:\Anaconda\lib\tarfile.py”, line 2447, in is_tarfile t = open(name) File “D:\Anaconda\lib\tarfile.py”, line 1568, in open return func(name, “r”, fileobj, **kwargs) File “D:\Anaconda\lib\tarfile.py”, line 1633, in gzopen fileobj = gzip.GzipFile(name, mode + “b”, compresslevel, fileobj) File “D:\Anaconda\lib\gzip.py”, line 163, in init fileobj = self.myfileobj = builtins.open(filename, mode or ‘rb’) FileNotFoundError: [Errno 2] No such file or directory: ‘\\${IDF_PATH}\tools\kconfig_new\esp-windows-curses’ Cache entry deserialization failed, entry ignored Cache entry deserialization failed, entry ignored You are using pip version 9.0.1, however version 20.2.4 is available. You should consider upgrading via the ‘python -m pip install --upgrade pip’ command. Command failed: “f:\espidf_vs\python_env\idf4.1_py3.6_env\Scripts\python.exe” -m pip install -r “f:\espidf_vs\esp-idf-v4.1\requirements.txt” Exception: Traceback (most recent call last): File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\basecommand.py”, line 215, in main
status = self.run(options, args) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\commands\install.py”, line 335, in run wb.build(autobuilding=True) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\wheel.py”, line 749, in build self.requirement_set.prepare_files(self.finder) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\req\req_set.py”, line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\req\req_set.py”, line 620, in prepare_file session=self.session, hashes=hashes) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\download.py”, line 809, in unpack_url unpack_file_url(link, location, download_dir, hashes=hashes) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\download.py”, line 715, in unpack_file_url unpack_file(from_path, location, content_type, link) File "f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\utils_init.py", line 602, in unpack_file tarfile.is_tarfile(filename) or File “D:\Anaconda\lib\tarfile.py”, line 2447, in is_tarfile t = open(name) File “D:\Anaconda\lib\tarfile.py”, line 1568, in open return func(name, “r”, fileobj, **kwargs) File “D:\Anaconda\lib\tarfile.py”, line 1633, in gzopen fileobj = gzip.GzipFile(name, mode + “b”, compresslevel, fileobj) File “D:\Anaconda\lib\gzip.py”, line 163, in init fileobj = self.myfileobj = builtins.open(filename, mode or ‘rb’) FileNotFoundError: [Errno 2] No such file or directory: ‘\\${IDF_PATH}\tools\kconfig_new\esp-windows-curses’ Cache entry deserialization failed, entry ignored Cache entry deserialization failed, entry ignored You are using pip version 9.0.1, however version 20.2.4 is available. You should consider upgrading via the ‘python -m pip install --upgrade pip’ command. Command failed: “f:\espidf_vs\python_env\idf4.1_py3.6_env\Scripts\python.exe” -m pip install -r “f:\espidf_vs\esp-idf-v4.1\requirements.txt” Exception: Traceback (most recent call last): File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\basecommand.py”, line 215, in main status = self.run(options, args) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\commands\install.py”, line 335, in run wb.build(autobuilding=True) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\wheel.py”, line 749, in build self.requirement_set.prepare_files(self.finder) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\req\req_set.py”, line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\req\req_set.py”, line 620, in prepare_file session=self.session, hashes=hashes) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\download.py”, line 809, in unpack_url
unpack_file_url(link, location, download_dir, hashes=hashes) File “f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\download.py”, line 715, in unpack_file_url unpack_file(from_path, location, content_type, link) File "f:\espidf_vs\python_env\idf4.1_py3.6_env\lib\site- packages\pip\utils_init.py", line 602, in unpack_file tarfile.is_tarfile(filename) or File “D:\Anaconda\lib\tarfile.py”, line 2447, in is_tarfile t = open(name) File “D:\Anaconda\lib\tarfile.py”, line 1568, in open return func(name, “r”, fileobj, **kwargs) File “D:\Anaconda\lib\tarfile.py”, line 1633, in gzopen fileobj = gzip.GzipFile(name, mode + “b”, compresslevel, fileobj) File “D:\Anaconda\lib\gzip.py”, line 163, in init fileobj = self.myfileobj = builtins.open(filename, mode or ‘rb’) FileNotFoundError: [Errno 2] No such file or directory: ‘\\${IDF_PATH}\tools\kconfig_new\esp-windows-curses’ Cache entry deserialization failed, entry ignored Cache entry deserialization failed, entry ignored You are using pip version 9.0.1, however version 20.2.4 is available. You should consider upgrading via the ‘python -m pip install --upgrade pip’ command. The following paths should be added to env PATH .;D:\Anaconda;f:\espidf_vs\tools\xtensa-esp32-elf\esp-2020r2-8.2.0\xtensa-esp32- elf\bin;f:\espidf_vs\tools\xtensa-esp32s2-elf\esp-2020r2-8.2.0\xtensa-esp32s2- elf\bin;f:\espidf_vs\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf- binutils\bin;f:\espidf_vs\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp- elf-binutils\bin;f:\espidf_vs\tools\cmake\3.13.4\bin;f:\espidf_vs\tools\openocd- esp32\v0.10.0-esp32-20191114\openocd- esp32\bin;f:\espidf_vs\tools\ninja\1.9.0;f:\espidf_vs\tools\idf- exe\1.0.1;f:\espidf_vs\tools\ccache\3.7


以上報錯信息原因可能在于Python版本或者無Python全局路徑錯誤-------當前錯誤解決方法:切換為
Python3.7以上版本問題解決;另外最好運行win+R,輸入cmd進入命令行,輸入python檢查當前PC的python工具鏈是否已經加入系統變量,無則在系統變量PATH加xxx:\Python&xxx:\Python\Scripts,假如彈出win商店可參考以下該問題解決方法:

輸入python打開windows store: 原因在于環境變量“C:\Users\xxx\AppData\Local\Microsoft\WindowsApps”的優先級高于python 環境變量優先級 解決辦法: 1.刪除windows應用商店環境變量 2.將Python的環境變量放在前面 輸入python依然打開windows store: 記得重新打開終端測試

下載完畢,Python提示requirements has been installed,提示可前往’Go to next step’下一步進行工具鏈驗證

默認參數是配置好的,只需點擊驗證:

成功安裝界面:

以下為ESP-IDF編譯工程步驟: 一. 點擊上述’View ESP-IDF project examples’ 或者 Shift+ctrl+P - 在上述彈出框輸入 ESP-IDF:展示

二.選擇其中一個工程,然后點擊‘Create project using example blink’,選擇工程文件生成目錄



1.串口選擇 2.工程配置,類似Ubuntu idf.py menuconfig配置界面,配置下載&串口波特率等 3.編譯 4.下載 5.串口選擇 6.一鍵編譯&下載
一. 首先點擊編譯3:點擊終端-選擇‘顯示正在運行的任務’,即可顯示編譯信息。

二. 隨后點擊工程配置選項2:搜索baud 找到波特率配置選項,調試串口‘Serial flasher config’不需要修改,Common ESP-related下載波特率可修改為官方默認支持’921600’,提升下載速率。點擊保存。

三.插入目標板,點擊串口選擇1,在面板上欄彈出串口列表,選中對應串口號。

四.點擊下載4,即可燒錄程序進入目標機

五.打開串口5,觀察調試信息。

總結

以上是生活随笔為你收集整理的小明分享|基于VSCode Espress IDF软件环境搭建的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。