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-gccusers, its compiler include path should be included first. It differes in each system. Use the verbosearm-none-eabi-gcc -vflag 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 | sortThen 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!
Is it necessary to list out all the system includes and defines still? Passing in the compiler arguments as part of
compilerPathis supposed to handle that for you.