Written by
Niels Moseley
on
on
Clangd setup for embedded ARM
The version of clangd shipped with Debian 13 is not new enough to support relative include paths, AFAIK.
You need to change the paths to your local configuration.
My .clangd file for use with the STM32F103 looks like the following:
CompileFlags:
Compiler: /opt/arm14/bin/arm-none-eabi-g++
CompilationDatabase: "build"
Add:
- --target=arm-none-eabi
- -mcpu=cortex-m3
- -mthumb
- -std=c++20
- -mfloat-abi=soft
- -I/opt/arm14/arm-none-eabi/include
- -I/opt/arm14/arm-none-eabi/include/bits
- -I/opt/arm14/arm-none-eabi/include/newlib-nano
- -I/opt/arm14/arm-none-eabi/lib/gcc/arm-none-eabi/14.2.1/include
- -I/opt/arm14/arm-none-eabi/lib/gcc/arm-none-eabi/14.2.1/include-fixed
- -I/opt/arm14/arm-none-eabi/include/c++/14.2.1/
- -I/opt/arm14/arm-none-eabi/include/c++/14.2.1/arm-none-eabi