missing include paths for vscode - using sample applications

Hi,

created a new sample (let's say blinky) application from nrf sdk 2.6.0

the SDK generates a sample application located outside of the SDK folder.

sample builds and runs okay.

expected to browse around the diffrent APIs that sample uses, and learn more around the API with documentation within API headers.

actual - VSCODE is unaware of the paths for the include directories, cannot browse around.

#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio.h>
are unknown..
solution:
i needed to add manually into c_cpp_properties.json the location of the includes in-order to browser around.
should be: auto generate with the nRF connect extension vscode.
or am i using SDK wrong?
thanks.
c_cpp_properties.json
    "configurations": [
        {
            "name": "Win32",
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE",
                "__GNUC__"
            ],
            "windowsSdkVersion": "10.0.22621.0",
            "compilerPath": "cl.exe",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "windows-msvc-x64",
            "includePath": [
                "${workspaceFolder}/**",
                "C:\\dev\\ncs\\v2.6.0\\zephyr\\**",
                "C:\\dev\\ncs\\v2.6.0\\zephyr\\include",
                "C:\\dev\\ncs\\v2.6.0\\zephyr\\include\\zephyr",
                "C:\\dev\\ncs\\v2.6.0\\zephyr",
                "C:\\dev\\ncs\\v2.6.0\\zephyr\\subsys\\testsuite\\ztest\\include\\zephyr"
            ]
        }
    ],
    "version": 4
}

Parents Reply
  • Hi,

    Appreciate your time and reply.

    I generated a sample with "nrf connect" extension, and it offered to save sample in directory next to the SDK folder location.

    my point is - recommend this should just work out of the box.. (not different then how the sample code succeeds to build in this location, this means the CMAKE knows where the SDK is.)  a new user should not need to read documentation on how  to set up includes folders.

    thanks!

Children
No Data
Related