]> granicus.if.org Git - esp-idf/blob - README.md
components/bt: Disable BR/EDR GATT
[esp-idf] / README.md
1 # Espressif IoT Development Framework
2
3 * [中文版](./README_CN.md)
4
5 [![Documentation Status](https://readthedocs.com/projects/espressif-esp-idf/badge/?version=latest)](https://docs.espressif.com/projects/esp-idf/en/latest/?badge=latest)
6
7 ESP-IDF is the official development framework for the [ESP32](https://espressif.com/en/products/hardware/esp32/overview) chip.
8
9 # Developing With ESP-IDF
10
11 ## Setting Up ESP-IDF
12
13 See setup guides for detailed instructions to set up the ESP-IDF:
14
15 * [Getting Started Guide for the stable ESP-IDF version](https://docs.espressif.com/projects/esp-idf/en/stable/get-started/)
16 * [Getting Started Guide for the latest (master branch) ESP-IDF version](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/)
17
18 ### Non-GitHub forks
19
20 ESP-IDF uses relative locations as its submodules URLs ([.gitmodules](.gitmodules)). So they link to GitHub.
21 If ESP-IDF is forked to a Git repository which is not on GitHub, you will need to run the script
22 [tools/set-submodules-to-github.sh](tools/set-submodules-to-github.sh) after git clone.
23 The script sets absolute URLs for all submodules, allowing `git submodule update --init --recursive` to complete.
24 If cloning ESP-IDF from GitHub, this step is not needed.
25
26 ## Finding a Project
27
28 As 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.
29
30 Once you've found the project you want to work with, change to its directory and you can configure and build it.
31
32 To start your own project based on an example, copy the example project directory outside of the ESP-IDF directory.
33
34 # Quick Reference
35
36 See 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:
37
38 ## Setup Build Environment
39
40 (See Getting Started guide for a full list of required steps with details.)
41
42 * Install host build dependencies mentioned in Getting Started guide.
43 * Add `tools/` directory to the PATH
44 * Run `python -m pip install -r requirements.txt` to install Python dependencies
45
46 ## Configuring the Project
47
48 `idf.py menuconfig`
49
50 * Opens a text-based configuration menu for the project.
51 * Use up & down arrow keys to navigate the menu.
52 * Use Enter key to go into a submenu, Escape key to go out or to exit.
53 * Type `?` to see a help screen. Enter key exits the help screen.
54 * Use Space key, or `Y` and `N` keys to enable (Yes) and disable (No) configuration items with checkboxes "`[*]`"
55 * Pressing `?` while highlighting a configuration item displays help about that item.
56 * Type `/` to search the configuration items.
57
58 Once done configuring, press Escape multiple times to exit and say "Yes" to save the new configuration when prompted.
59
60 ## Compiling the Project
61
62 `idf.py build`
63
64 ... will compile app, bootloader and generate a partition table based on the config.
65
66 ## Flashing the Project
67
68 When 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:
69
70 `idf.py -p PORT flash`
71
72 Replace 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.
73
74 This 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`.
75
76 You don't need to run `idf.py build` before running `idf.py flash`, `idf.py flash` will automatically rebuild anything which needs it.
77
78 ## Viewing Serial Output
79
80 The `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 the ESP32. 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).
81
82 Exit the monitor by typing Ctrl-].
83
84 To build, flash and monitor output in one pass, you can run:
85
86 `idf.py flash monitor`
87
88 ## Compiling & Flashing Only the App
89
90 After the initial flash, you may just want to build and flash just your app, not the bootloader and partition table:
91
92 * `idf.py app` - build just the app.
93 * `idf.py app-flash` - flash just the app.
94
95 `idf.py app-flash` will automatically rebuild the app if any source files have changed.
96
97 (In normal development there's no downside to reflashing the bootloader and partition table each time, if they haven't changed.)
98
99 ## Erasing Flash
100
101 The `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`.
102
103 This 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.
104
105 # Resources
106
107 * Documentation for the latest version: https://docs.espressif.com/projects/esp-idf/. This documentation is built from the [docs directory](docs) of this repository.
108
109 * The [esp32.com forum](https://esp32.com/) is a place to ask questions and find community resources.
110
111 * [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.
112
113 * 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).
114
115