当前位置:网站首页>Vscode builds ESP32-C3 development environment
Vscode builds ESP32-C3 development environment
2022-07-29 13:57:00 【water ridge】
简介
ESP-IDF 是乐鑫官方的物联网开发框架,适用于 ESP32、ESP32-S 和 ESP32-C 系列 SoC.它基于 C/C++ 语言提供了一个自给自足的 SDK,方便用户在这些平台上开发通用应用程序.ESP-IDF 目前已服务支持数以亿计的物联网设备,并已开发构建了多种物联网产品,例如照明、消费电子大小家电、支付终端、工控等各类物联网设备.
工具安装
官网链接:esp32 c3快速入门
环境准备
- esp32-c3开发板
- 编译工具链
- 编译构建工具cmake和Ninja
- ESP-IDF软件开发框架
- 编辑器安装
IDE安装
安装教程:esp-idf
- 直接在vscode扩展里搜索Espressif IDF安装即可.
- 插件配置,按ctrl shift p输入:Configure ESP-IDF extension,Pay attention to the progress in the lower right corner,The configuration is explained later
其他工具安装
ESP-IDF 需要安装一些必备工具,才能围绕 ESP32-C3 构建固件,包括 Python、Git、交叉编译器、CMake 和 Ninja 编译工具等.
Click on Quick Start:ESP-IDF 工具安装器
This will install the following:
关于工具的安装,Here is a direct reference to the official documentation of the link,采用离线安装,这里不记录
使用命令提示符
在后续步骤中,我们将使用 Windows command prompt to operate.
ESP-IDF A tool installer is available at “开始”菜单中,创建一个打开 ESP-IDF A shortcut to the Command Prompt window.This shortcut can be opened Windows 命令提示符(即 cmd.exe),并运行 export.bat script to set various environment variables(比如 PATH,IDF_PATH 等).此外,You can still pass Windows Command Prompt uses various installed tools.
注意,This shortcut is only applicable ESP-IDF specified in the tool installer ESP-IDF 路径.If there are more than one on your computer ESP-IDF 路径(For example you need a different version ESP-IDF),You have the following two workarounds:
- 为 ESP-IDF The shortcut created by the tool installer creates a copy,and place the new shortcut ESP-IDF The working path is specified as you wish to use ESP-IDF 路径.
- 或者,您可以运行 cmd.exe,and switch to the one you wish to use ESP-IDF 目录,然后运行 export.bat.注意,这种方法要求 PATH 中存在 Python 和 Git.If you encounter it while using it“找不到 Python 或 Git”的错误信息,请使用第一种方法.
基本使用
首先下载examples,I recommend your own repository hereesp32-idf,Because the original repository download is slow.
官方命令–安装简单
- 拷贝examplesThe routines in the directory go to a certain directory
- 配置工程
idf.py set-target esp32c3 #设置“目标”芯片,此操作将清除并初始化项目之前的编译和配置(如有)
idf.py menuconfig #进行配置,There are default configurations in the sample code that can be ignored
idf.py build #Compile the project to compile the application and ESP-IDF 组件,Generate the bootloader、分区表和应用程序二进制文件
idf.py menuconfig --help #显示帮助信息
- 烧录程序
idf.py -p PORT [-b BAUD] flash
- 监视输出
idf.py -p PORT monitor
Ctrl+],退出 IDF 监视器
VScode编译下载–安装复杂
- 首先安装esp-idf插件,进行配置(搜索esp-idf configure),The installation package will be downloaded here,But we have already installed it offlineesp-idf开发工具包,Here we do not install,直接指定路径,What we have installed is not detected here,我们点击advancedSpecify the directory manually
- 使用vscode打开examples中的工程(esp-idf\examples\get-started\hello_world)
- 插件安装完成后,The serial port can be selected at the bottom
- Set the programming method,快捷方式"ctrl+ ,"
- 创建工程,Select chip type and engineering,This place might get stuck waiting a bit
- 编译工程,The problem of slow compilation will be solved in a later article
- 烧录,选择串口,进行烧录
- 打开log监控,It's completely over here
注意事项
- 请注意 ESP-IDF 和 ESP-IDF 工具的安装路径不能超过 90 个字符,Long installation paths may cause build failures
- Python 或 ESP-IDF must not contain spaces or parentheses in the installation path.
- Unless the operating system is configured to support it Unicode UTF-8,否则 Python 或 ESP-IDF cannot include special characters in the installation path(非 ASCII 码字符)
问题列表
cmake路径不在环境变量中
[Error: non zero exit code 2
ESP-IDF v4.3.3
'cmake' must be available on the PATH to use idf.py
at ChildProcess.<anonymous> (\dist\extension.js:1:4499)
at ChildProcess.emit (node:events:390:28)
at ChildProcess.emit (node:domain:475:12)
at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)]
添加环境变量即可
编辑不通过
删除工程目录下的build目录试试
边栏推荐
猜你喜欢
随机推荐
PAT 甲级 A1021 Deepest Root
还在开发短信验证码登录?试试(本机号码一键登录)
Sql file import database - nanny level tutorial
轻松学Pytorch-Pytorch可视化
Py之eli5:eli5库的简介、安装、使用方法之详细攻略
即时通讯移动端开发之网络连接优化
每日优鲜解散疑云:生鲜电商们苦渡生死劫
IJCAI 2022 outstanding papers published, China won two draft in 298 the first author
来自 Qt 官网的呐喊
微信小程序的登录
了解 AQS 底层原理
Leetcode65. 有效数字
JS_删除数组里的无效数据 0 undefined ‘‘ null false NaN
"Industrial flaw detection depth study method" the latest 2022 research were reviewed
阿里云官方 Redis 开发规范!
How to set the explosion rate of legendary humanoid?Humanoid increase tutorial
简单了解单例模式
企业代码安全防护分类
企业如何走出固定资产管理的困境?
Project Manager: Not bad!The SSO single sign-on code is written, and the sequence diagram is also drawn?