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!
@bobbrow this gist is now outdated, your solution from microsoft/vscode-cpptools#1484 (comment) works
important is
"intelliSenseMode"
,"compilerPath"
and"compilerArgs"
, adjust to your needs.Here is my simplified
c_cpp_properties.json
Edit: modifications according to following comment , thanks @bobbrow !