这是我学习ESP IDF的笔记,不一定正确。如果有错误请不吝指正。
-
每次切换idf分支,最好运行
git submodule update --init --recursive
更新模块 -
获取idf分支信息:
git describe --tags
-
对于idf v3.3即以前的版本:
3.1 需要使用版本号为5.2.0的交叉编译工具链
3.2 配置命令:make menuconfing
3.3 烧写并打开串口监视器命令:make -j4 flash monitor
-
最新的idf master分支:
4.1 需要2019r1版本的交叉编译工具链
4.2 配置命令:idf.py menuconfing
4.3 烧写并打开串口监视器命令:idf.py flash monitor
或者idf.py -p PORT [-b BAUD] flash
4.4 如果要引入多个源文件,需要修改CMakeLists.txt
, 其中COMPONENT_SRCS
是用空格分隔的源文件列表(.c,.cpp,.cc,.S),里面所有的源文件都将会编译进组件库中。当然还有其他方法,比如做成组件的形式。 -
Issue 提交模板:
esp-idf/issue_template.md at master · espressif/esp-idf
Environment
Development Kit:
Module or chip used:
IDF version (run git describe --tags to find it):
Build System:
Compiler version:
Operating System:
Power Supply:
Problem Description:
Expected Behavior
Actual Behavior
Steps to repropduce
Code to reproduce this issue
Debug Logs
main/Kconfig.projbuild
: 项目设置参考:
如上图的设置代码如下
menu "Example Configuration"
config ESP_WIFI_SSID
string "WiFi SSID"
default "myssid"
help
SSID (network name) for the example to connect to.
config ESP_WIFI_PASSWORD
string "WiFi Password"
default "mypassword"
help
WiFi password (WPA or WPA2) for the example to use.
config ESP_MAXIMUM_RETRY
int "Maximum retry"
default 5
help
Set the Maximum retry to avoid station reconnecting to the AP unlimited when the AP is really inexistent.
config XCLK_FREQ
int "XCLK Frequency"
default "20000000"
help
The XCLK Frequency in Herz.
menu "Pin Configuration"
config D0
int "D0"
default "5"
config D1
int "D1"
default "18"
config D2
int "D2"
default "19"
config D3
int "D3"
default "21"
config D4
int "D4"
default "36"
config D5
int "D5"
default "39"
config D6
int "D6"
default "34"
config D7
int "D7"
default "35"
config XCLK
int "XCLK"
default "0"
config PCLK
int "PCLK"
default "22"
config VSYNC
int "VSYNC"
default "25"
config HREF
int "HREF"
default "23"
config SDA
int "SDA"
default "26"
config SCL
int "SCL"
default "27"
config RESET
int "RESET"
default "32"
endmenu
endmenu
- ESP IDF快速入门(v4.0-dev-1287-gd7e659df2):
快速入门(CMake) — ESP-IDF 编程指南 v4.0-dev-1287-gd7e659df2 文档