-
idf.py fullclean 工程清除
-
idf.py -D IDF_TOOLCHAIN=clang reconfigure 设置编译器为clang,生成compile_commands.json
-
idf.py build 重新编译
-
配置clangd
- 在.vscode -> settings.json,中添加"--compile-commands-dir=${workspaceFolder}/build", "--background-index"
- 在根目录下新建.clangd文件,添加如下图
Diagnostics:UnusedIncludes: None
- 在.vscode -> settings.json,中添加"--compile-commands-dir=${workspaceFolder}/build", "--background-index"
-
add 先要install esp-clang: python.exe idf_tools.py install esp-clang