Dtynin
Dtynin
DIIDevHeads IoT Integration Server
Created by Sterling on 7/14/2024 in #firmware-and-baremetal
Resolving stdio.h and FPU Instruction Errors in STM32F103 Project with clangd and Neovim
@Sterling For stdio.h not found, add the ARM toolchain include path to compile_commands.json:
{
"directory": "/path/to/project",
"command": "arm-none-eabi-gcc -I/path/to/arm-none-eabi/include -o file.o -c file.c",
"file": "file.c"
}
{
"directory": "/path/to/project",
"command": "arm-none-eabi-gcc -I/path/to/arm-none-eabi/include -o file.o -c file.c",
"file": "file.c"
}
For FPU instructions, ensure the target CPU is specified:
{
"directory": "/path/to/project",
"command": "arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -o file.o -c file.c",
"file": "file.c"
}
{
"directory": "/path/to/project",
"command": "arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -o file.o -c file.c",
"file": "file.c"
}
Update your Makefile:
MCU = -mcpu=cortex-m3 -mthumb
MCU = -mcpu=cortex-m3 -mthumb
Alternatively, try installing ccls as an LSP:
sudo apt install ccls
sudo apt install ccls
Then configure Neovim to use ccls.
3 replies