ESP-IDF V5.4 + Clang +Clangd

509 阅读1分钟
  1. idf.py fullclean 工程清除

  2. idf.py -D IDF_TOOLCHAIN=clang reconfigure 设置编译器为clang,生成compile_commands.json

  3. idf.py build 重新编译

  4. 配置clangd

    1. 在.vscode -> settings.json,中添加"--compile-commands-dir=${workspaceFolder}/build", "--background-index"image.png
    2. 在根目录下新建.clangd文件,添加如下图 Diagnostics:UnusedIncludes: Noneimage.png
  5. add 先要install esp-clang: python.exe idf_tools.py install esp-clang