If you installed C/C++ extension for Visual Studio Code but using GNU Arm Embedded Toolchain for ARM Cortex M series MCU target, VS Code will keep prompt "Configuring includePath for better IntelliSense results". You wil need a special c_cpp_properties.json
for the ARM toolchain.
This works on both Linux and Windows.
-
For
arm-none-eabi-gcc
users, its compiler include path should be included first. It differes in each system. Use the verbosearm-none-eabi-gcc -v
flag to see include list. change"includePath"
and"browse"."path"
for your system. -
VS Code currently don't detect internal GCC definitions. We need to manually include them. This is why OP's problem occurs. To see the GCC's definitions use (for ARM Coretex M4 with hard FP):
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -E -dM - < /dev/null | sort
Then you need to add all definitions printed to "defines"
. Note that you also need to convert #define DEFINE VALUE
to DEFINE=VALUE
format. The definitions list is very long but it should be quite easy to convert the format using VS Code!
There is also
"compilerArgs"
inc_cpp_properties.json
that you can use for the compiler arguments. You should also be able to remove the"browse"
section as the extension should be adding the same thing automatically when you don't specify it.Cheers!