• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

.github/11-Mar-2024-234174

.gitlab/11-Mar-2024-237202

components/11-Mar-2024-1,380,687894,804

docs/11-Mar-2024-87,80960,312

examples/11-Mar-2024-282,810228,116

make/11-Mar-2024-1,465833

tools/11-Mar-2024-467,527445,238

west/11-Mar-2024-11376

zephyr/11-Mar-2024-6,0044,146

.editorconfigD11-Mar-2024735 4433

.flake8D11-Mar-20248.7 KiB166156

.gitignoreD11-Mar-20241.3 KiB9168

.gitlab-ci.ymlD11-Mar-20244.8 KiB13386

.gitmodulesD11-Mar-2024754 1915

.pre-commit-config.yamlD11-Mar-20242.7 KiB7868

.pylintrcD11-Mar-202418.3 KiB604454

.readthedocs.ymlD11-Mar-2024538 2210

CMakeLists.txtD11-Mar-20244.8 KiB129108

CONTRIBUTING.rstD11-Mar-20242.5 KiB6338

KconfigD11-Mar-202416.2 KiB403317

LICENSED11-Mar-202411.1 KiB203169

README.mdD11-Mar-20245.9 KiB10959

README_CN.mdD11-Mar-20245.9 KiB11664

SUPPORT_POLICY.mdD11-Mar-20243.5 KiB8462

SUPPORT_POLICY_CN.mdD11-Mar-20243.2 KiB5635

add_path.shD11-Mar-2024721 1910

export.batD11-Mar-20242 KiB7159

export.fishD11-Mar-20242.2 KiB7359

export.ps1D11-Mar-20242.7 KiB7551

export.shD11-Mar-20245.3 KiB159115

install.batD11-Mar-2024529 2318

install.fishD11-Mar-2024435 2012

install.ps1D11-Mar-2024520 1811

install.shD11-Mar-2024463 2214

requirements.txtD11-Mar-20241.5 KiB3933

sdkconfig.renameD11-Mar-20241.9 KiB2926

README.md

1# Espressif IoT Development Framework
2
3* [中文版](./README_CN.md)
4
5ESP-IDF is the official development framework for the **ESP32** and **ESP32-S** Series SoCs provided for Windows, Linux and macOS.
6
7# Developing With ESP-IDF
8
9## Setting Up ESP-IDF
10
11See setup guides for detailed instructions to set up the ESP-IDF:
12
13| Chip | Getting Started Guides for ESP-IDF |
14|:----:|:----|
15| <img src="docs/_static/chip-esp32.svg" height="85" alt="ESP32"> |  <ul><li>[stable](https://docs.espressif.com/projects/esp-idf/en/stable/get-started/) version</li><li>[latest (master branch)](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/) version</li></ul> |
16| <img src="docs/_static/chip-esp32-s2.svg" height="100" alt="ESP32-S2"> | <ul><li>[latest (master branch)](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/get-started/) version</li></ul> |
17
18**Note:** Each ESP-IDF release has its own documentation. Please see Section [Versions](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/versions.html) how to find documentation and how to checkout specific release of ESP-IDF.
19
20### Non-GitHub forks
21
22ESP-IDF uses relative locations as its submodules URLs ([.gitmodules](.gitmodules)). So they link to GitHub.
23If ESP-IDF is forked to a Git repository which is not on GitHub, you will need to run the script
24[tools/set-submodules-to-github.sh](tools/set-submodules-to-github.sh) after git clone.
25The script sets absolute URLs for all submodules, allowing `git submodule update --init --recursive` to complete.
26If cloning ESP-IDF from GitHub, this step is not needed.
27
28## Finding a Project
29
30As well as the [esp-idf-template](https://github.com/espressif/esp-idf-template) project mentioned in Getting Started, ESP-IDF comes with some example projects in the [examples](examples) directory.
31
32Once you've found the project you want to work with, change to its directory and you can configure and build it.
33
34To start your own project based on an example, copy the example project directory outside of the ESP-IDF directory.
35
36# Quick Reference
37
38See the Getting Started guide links above for a detailed setup guide. This is a quick reference for common commands when working with ESP-IDF projects:
39
40## Setup Build Environment
41
42(See the Getting Started guide listed above for a full list of required steps with more details.)
43
44* Install host build dependencies mentioned in the Getting Started guide.
45* Run the install script to set up the build environment. The options include `install.bat` or `install.ps1` for Windows, and `install.sh` or `install.fish` for Unix shells.
46* Run the export script on Windows (`export.bat`) or source it on Unix (`source export.sh`) in every shell environment before using ESP-IDF.
47
48## Configuring the Project
49
50* `idf.py set-target <chip_name>` sets the target of the project to `<chip_name>`. Run `idf.py set-target` without any arguments to see a list of supported targets.
51* `idf.py menuconfig` opens a text-based configuration menu where you can configure the project.
52
53## Compiling the Project
54
55`idf.py build`
56
57... will compile app, bootloader and generate a partition table based on the config.
58
59## Flashing the Project
60
61When the build finishes, it will print a command line to use esptool.py to flash the chip. However you can also do this automatically by running:
62
63`idf.py -p PORT flash`
64
65Replace PORT with the name of your serial port (like `COM3` on Windows, `/dev/ttyUSB0` on Linux, or `/dev/cu.usbserial-X` on MacOS. If the `-p` option is left out, `idf.py flash` will try to flash the first available serial port.
66
67This will flash the entire project (app, bootloader and partition table) to a new chip. The settings for serial port flashing can be configured with `idf.py menuconfig`.
68
69You don't need to run `idf.py build` before running `idf.py flash`, `idf.py flash` will automatically rebuild anything which needs it.
70
71## Viewing Serial Output
72
73The `idf.py monitor` target uses the [idf_monitor tool](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/idf-monitor.html) to display serial output from ESP32 or ESP32-S Series SoCs. idf_monitor also has a range of features to decode crash output and interact with the device. [Check the documentation page for details](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/idf-monitor.html).
74
75Exit the monitor by typing Ctrl-].
76
77To build, flash and monitor output in one pass, you can run:
78
79`idf.py flash monitor`
80
81## Compiling & Flashing Only the App
82
83After the initial flash, you may just want to build and flash just your app, not the bootloader and partition table:
84
85* `idf.py app` - build just the app.
86* `idf.py app-flash` - flash just the app.
87
88`idf.py app-flash` will automatically rebuild the app if any source files have changed.
89
90(In normal development there's no downside to reflashing the bootloader and partition table each time, if they haven't changed.)
91
92## Erasing Flash
93
94The `idf.py flash` target does not erase the entire flash contents. However it is sometimes useful to set the device back to a totally erased state, particularly when making partition table changes or OTA app updates. To erase the entire flash, run `idf.py erase_flash`.
95
96This can be combined with other targets, ie `idf.py -p PORT erase_flash flash` will erase everything and then re-flash the new app, bootloader and partition table.
97
98# Resources
99
100* Documentation for the latest version: https://docs.espressif.com/projects/esp-idf/. This documentation is built from the [docs directory](docs) of this repository.
101
102* The [esp32.com forum](https://esp32.com/) is a place to ask questions and find community resources.
103
104* [Check the Issues section on github](https://github.com/espressif/esp-idf/issues) if you find a bug or have a feature request. Please check existing Issues before opening a new one.
105
106* If you're interested in contributing to ESP-IDF, please check the [Contributions Guide](https://docs.espressif.com/projects/esp-idf/en/latest/contribute/index.html).
107
108
109

README_CN.md

1# Espressif 物联网开发框架
2
3* [English Version](./README.md)
4
5ESP-IDF 是由乐鑫官方推出的针对 **ESP32** 和 **ESP32-S2** 系列芯片的开发框架。
6
7# 使用 ESP-IDF 进行开发
8
9## 搭建 ESP-IDF 开发环境
10
11请参阅如下指南搭建 ESP-IDF 的开发环境:
12
13| 芯片 | ESP-IDF 入门指南 |
14|:----:|:----|
15| <img src="docs/_static/chip-esp32.svg" height="85" alt="ESP32"> | <ul><li>[稳定](https://docs.espressif.com/projects/esp-idf/zh_CN/stable/get-started/) 版</li><li>[最新(master 分支)](https://docs.espressif.com/projects/esp-idf/zh_CN/latest/get-started/) 版本</li></ul> |
16| <img src="docs/_static/chip-esp32-s2.svg" height="100" alt="ESP32-S2"> | <ul><li>[最新(master 分支)](https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32s2/get-started/) 版本</li></ul> |
17
18**注意:** 每个 ESP-IDF 版本都有其对应的文档。 请参阅 [版本](https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/versions.html) 部分,如何查找文档以及如何检出ESP-IDF的特定发行版。
19
20
21### 非 GitHub 分叉的 ESP-IDF 项目
22
23ESP-IDF 中的子模块采用相对路径([详见 .gitmodules 文件](.gitmodules)),所以它们会指向 GitHub。
24如果 ESP-IDF 被分叉到的仓库不在 GitHub 上,那么你需要在克隆结束后运行该[脚本](tools/set-submodules-to-github.sh)。它会为所有的子模块设置绝对路径,接着可以通过 `git submodule update --init --recursive` 完成子模块的更新。
25如果 ESP-IDF 是从 GitHub 上克隆得到,则不需要此步骤。
26
27## 寻找项目
28
29除了入门指南中提到的 [esp-idf 模板项目](https://github.com/espressif/esp-idf-template),ESP-IDF 的 [examples](examples) 目录下还带有很多其它示例项目。
30
31一旦找到了需要的项目,便可以进入该目录,执行配置和构建操作。
32
33如果要基于示例工程开始你自己的项目,请将示例工程复制到 ESP-IDF 目录之外。
34
35# 快速参考
36
37详细的使用方法请参考上面入门指南的链接,这里仅仅列举一些 ESP-IDF 项目开发中常用的命令:
38
39## 设置构建环境
40
41(请参考入门指南中列出的详细步骤。)
42* 在主机中安装入门指南中提到的构建所依赖的工具。
43* 将 ESP-IDF 中的 `tools/` 目录加入 PATH 环境变量中。
44* 运行 `python -m pip install -r requirements.txt` 安装 Python 依赖库。
45
46## 配置项目
47
48`idf.py menuconfig`
49
50* 打开项目的文本配置菜单。
51* 使用上下键浏览菜单。
52* 使用回车键进入子菜单,退出键返回上一级菜单或者退出配置。
53* 输入 `?` 查看帮助界面,按下回车键可以退出帮助界面。
54* 使用空格键或者 `Y` 和 `N` 按键来启用和禁用带复选框“`[*]`”的配置项。
55* 高亮某个配置项的同时按下 `?` 键可以显示该选项的帮助文档。
56* 输入 `/` 可以搜索指定的配置项。
57
58一旦配置完成,请按下退出键多次以退出配置界面,当提示是否保存新的的配置时,选择 “Yes”。
59
60## 编译项目
61
62`idf.py build`
63
64编译应用程序,引导程序,并根据配置生成分区表。
65
66## 烧写项目
67
68当构建结束,终端会打印出一条命令行,告知如何使用 esptool.py 工具烧写项目到芯片中。但是你还可以运行下面这条命令来自动烧写:
69
70`idf.py -p PORT flash`
71
72将其中的 PORT 替换为系统中实际串口的名字(比如 Windows 下的 `COM3`,Linux 下的 `/dev/ttyUSB0`,或者 MacOS 下的 `/dev/cu.usbserial-X`。如果省略 `-p` 选项,`idf.py flash` 会尝试使用第一个可用的串口进行烧写。
73
74这会烧写整个项目(包括应用程序,引导程序和分区表)到芯片中,此外还可以使用 `idf.py menuconfig` 来调整串口烧写相关的配置。
75
76你也不必先运行 `idf.py build`,再运行 `idf.py flash`,`idf.py flash` 会根据需要自动重新构建项目。
77
78## 观察串口输入
79
80`idf.py monitor` 会调用 [idf_monitor 工具](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/idf-monitor.html)来显示 ESP32 和 ESP32-S2 的串口输出。`idf_monitor` 还包含一系列的功能来解析程序崩溃后的输出结果并与设备进行交互。更多详细内容,请参阅[文档](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/idf-monitor.html).
81
82输入 `Ctrl-]` 可退出监视器。
83
84想要一次性执行构建,烧写和监视,可以运行如下命令:
85
86`idf.py flash monitor`
87
88## 仅编译并烧写应用程序
89
90在第一次烧写过后,你可能只想构建并烧写你的应用程序,不包括引导程序和分区表:
91
92* `idf.py app` - 仅构建应用程序。
93* `idf.py app-flash` - 仅烧写应用程序。
94
95`idf.py app-flash` 会自动判断是否有源文件发生了改变而后重新构建应用程序。
96
97(在正常的开发中,即使引导程序和分区表没有发生变化,每次都重新烧写它们并不会带来什么危害。)
98
99## 擦除 Flash
100
101`idf.py flash` 并不会擦除 Flash 上所有的内容,但是有时候我们需要设备恢复到完全擦除的状态,尤其是分区表发生了变化或者 OTA 应用升级。要擦除整块 Flash 请运行 `idf.py erase_flash`。
102
103这条命令还可以和其余命令整合在一起,`idf.py -p PORT erase_flash flash` 会擦除一切然后重新烧写新的应用程序,引导程序和分区表。
104
105# 其它参考资源
106
107* 最新版的文档:https://docs.espressif.com/projects/esp-idf/ ,该文档是由本仓库 [docs 目录](docs) 构建得到。
108
109* 可以前往 [esp32.com 论坛](https://esp32.com/) 提问,挖掘社区资源。
110
111* 如果你在使用中发现了错误或者需要新的功能,请先[查看 GitHub Issues](https://github.com/espressif/esp-idf/issues),确保该问题不会被重复提交。
112
113* 如果你有兴趣为 ESP-IDF 作贡献,请先阅读[贡献指南](https://docs.espressif.com/projects/esp-idf/en/latest/contribute/index.html)114
115
116