当前位置: 首页 > news >正文

[ESP32]VSCODE+ESP-IDF环境搭建及blink例程尝试(win10 win11均配置成功)

ps:这是你为了点灯最繁琐的一次

1.软件下载

  • vscode下载地址:Documentation for Visual Studio Code
  • esp_idf下载地址:https://dl.espressif.cn/dl/esp-idf/?idf=4.4 (从上往下第三)

2.软件安装

  • 可以均默认安装,但建议不要放在C盘,记住安装路径

3.vscode插件安装

4.环境pip和工具pip安装更新(关键)

  • 管理员运行终端(管理员应该是必须的)
  • 找到工具python地址
  • 设置国内镜像
D:\Espressif\tools\idf-python\3.11.2 \python -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
空格前替换为自己的路径 然后删除空格 如果返回结果如下 C:\Windows\System32>D:\Espressif\tools\idf-python\3.11
.2\python -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple D:\Espressif\tools\idf-python\3.11.2\python.exe: No module named pip
则说明没安装pip 先跳到下面的命令安装pip
  • 安装工具pip
D:\Espressif\tools\idf-python\3.11.2 \python.exe -m ensurepip
空格前替换为自己的路径 然后删除空格 如果返回结果如下 C:\Windows\System32>D:\Espressif\tools\idf-python\3.11.2\python.exe -m ensurepip Looking in links: c:\Users\10035\AppData\Local\Temp\tmpex20y7k1 Processing c:\users\10035\appdata\local\temp\tmpex20y7k1\setuptools-65.5.0-py3-none-any.whl Processing c:\users\10035\appdata\local\temp\tmpex20y7k1\pip-22.3.1-py3-none-any.whl Installing collected packages: setuptools, pip WARNING: The scripts pip3.11.exe and pip3.exe are installed in 'D:\Espressif\tools\idf-python\3.11.2\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed pip-22.3.1 setuptools-65.5.0
则说明安装成功 但没添加环境变量 这一步之后返回上一步 设置国内镜像 方便下载 C:\Windows\System32>D:\Espressif\tools\idf-python\3.11.2\python -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
Writing to C:\Users\10035\AppData\Roaming\pip\pip.ini 这个返回说明设置好了
  • 添加系统环境变量(不确定是否必须)
  • 升级pip版本
D:\Espressif\tools\idf-python\3.11.2 \python.exe -m pip install --upgrade pip
空格前替换为自己的路径 然后删除空格 如果返回结果如下 C:\Windows\System32>D:\Espressif\tools\idf-python\3.11.2\python.exe -m pip install --upgrade pip Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Requirement already satisfied: pip in d:\espressif\tools\idf-python\3.11.2\lib\site-packages (22.3.1) Collecting pip Downloading https://pypi.tuna.tsinghua.edu.cn/packages/29/a2/d40fb2460e883eca5199c62cfc2463fd261f760556ae6290f88488c362c0/pip-25.1.1-py3-none-any.whl (1.8 MB) ---------------------------------------- 1.8/1.8 MB 182.4 kB/s eta 0:00:00 Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 22.3.1 Uninstalling pip-22.3.1: Successfully uninstalled pip-22.3.1 WARNING: The scripts pip.exe, pip3.11.exe and pip3.exe are installed in 'D:\Espressif\tools\idf-python\3.11.2\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed pip-25.1.1 则说明更新成功
  • 安装更新环境pip,换路径上面的流程再来一遍
D:\Espressif\python_env\idf5.4_py3.11_env\Scripts 类似这个路径

5.配置IDF插件

  • 打开vscode 在搜索栏输入>configesp 选择配置esp_idf扩展 选择ADVANCED
  • 修改下面两个路径 (一般会自动识别路径)
  • 选择使用现用工具 并保存
  • 等待下载完成,完成页面如下 到这环境已经完成配置

6.烧录第一个例程(点灯)

  • 选择例程 选择文件夹后例程会自动生成
  • 选择芯片和端口 选择ESP32S3之后会出现三个选项 对应三种下载模式 USB JTAG(内置 USB 调试与下载)PROG(GPIO0下载模式) PROG-2(GPIO2下载模式) 这里直接选择最常用的PROG模式
  • 修改你硬件对应的IO口 点下面图标打开idf 终端 然后输入idf.py 通过键盘修改配置
(修改后直接改变的是sdkconfig 而sdkconfig.h是编译后生成的 所以先编译即可 sdkconfig.s3这是对应芯片的备份 用于切换芯片时直接拷贝到sdkconfig 所以实际起作用的还是sdkconfig)
  • 左下工具栏构建 烧录 监视 一步到位 第一次编译会慢一点 之后修改再编译就快了 编译后选择下载方式 直接选UART下载
  • 最终的效果就是一个1s间隔闪烁的LED 这大概是过程最繁琐的点灯了吧。
http://www.dtcms.com/a/270106.html

相关文章:

  • vscode打开stm32CubeIDE的项目的注释问题
  • 从分层训练到一步生成:Kaiming He 的生成模型进化之路—CVPR2025演讲小结
  • 网络--初级
  • springboot单体项目的发布生产优化
  • DMA(直接内存访问)是什么?
  • 第2章,[标签 Win32] :匈牙利标记法
  • 13届蓝桥杯省赛程序设计试题
  • 字符串大小比较的方式|函数的多返回值
  • 作业03-SparkSQL开发
  • 数字化校园升级:传统网络架构与SD-WAN智能方案对比详解
  • 汽车功能安全-软件单元验证 (Software Unit Verification)【定义、目的、要求建议】6
  • 【数据分析】基于 HRS 数据的多变量相关性分析与可视化
  • uniapp b树
  • C++笔记之使用bitset对uint32_t类型变量对位状态判断
  • 2025年深圳杉川机器人性格测评和Verify测评SHL题库高分攻略
  • 论文略读:Parameter-efficient transfer learning for NLP
  • InstructBLIP:迈向具备指令微调能力的通用视觉语言模型
  • Go语言标识符命名规则详解:工程化实践
  • Spring的依赖注入(xml)
  • RISC-V:开源芯浪潮下的技术突围与职业新赛道 (一)为什么RISC-V是颠覆性创新?
  • 安装 asciidoctor-vscode 最新版
  • 针对 SSD 固态硬盘的安全擦除 Secure Erase
  • Kotlin协程中的Job详解
  • 如何用Python编程计算权重?
  • Anolis OS 23 架构支持家族新成员:Anolis OS 23.3 版本及 RISC-V 预览版发布
  • 数据库设计精要:完整性和范式理论
  • 去掉长按遥控器power键后提示关机、飞行模式的弹窗
  • 数据提取之lxml模块与xpath工具
  • 基于Java+SpringBoot 协同过滤算法私人诊所管理系统
  • 系统架构设计师论文分享-论系统安全设计