Moving to 2.9.0 from 2.7.0

In 2.7.0 in file c_cpp_properties.json I had direct path to compiler. Now moving I need to change the path.

AI suggested to use ${nrf-connect.toolchain} for compiler and ${nrf-connect.sdk} for sdk.

Unlike launch.json where it works, in c_cpp_properties.json there is no way to let accect and resolve this

path.

Please do you have any suggestion?

Best Regards

Parents
  • Hi, 

    Could you proivde a bit background knowledge about your setup? Like the following:

    Is c_cpp_properties.json made by your own or located in NCS?

    How c_cpp_properties.json is used by the compiler?

    Best regards

    Charlie

  • Hello Charlie, my project starts from a Nordik sample.

    It is located in C:\ncs, where by default the create new application suggests to put.

    I am working in C++. When edit the program I had a lot of squiggles and AI suggested

    to modify the c_cpp_properties.json. And indeed it works. I add the direct path.

    Now I have moved to 2.9.0, and direct path of compiler and sdk is obviously changed,

    so I decided to put a relative path.

    I modify the settings.json and add

    "nrf-connect.topdir": "c:/ncs"

    "nrf-connect.toolchain": "c:/ncs/toolchains/b620d30767"

    "nrf-connect.sdk": "c:/ncs/v2.9.0"

    and then I modified the c_cpp_properties.json for example

    "compilerPath": "${config:nrf-connect.toolchain}/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe",

    or 

    "includePath": [


    "${workspaceFolder}/**",


    "${config:nrf-connect.sdk}/zephyr/include",


    "${config:nrf-connect.sdk}/zephyr/include/zephyr",


    "${config:nrf-connect.sdk}/nrfxlib"

    }

    Does not work. No reload window, no clear build, no delete build directory

    On one PC seems to work but squiggles the instruction strlen or strcmp.

    On another it does not work at all. Intellisense got crazy. And if i point on uint32_t it jumps me 

    to strange declaration!

    I could jump back to absolute path. But this behaviour strongly confuse me.

    Best Regards

  • It works only with absolute path (2.0.9 ), but not for all the instruction. It compiles but intellisense does not work well.

    I go back to 2.7.0

    There everything OK.

  • It looks like that including this

    #include <tfm/tfm_ioctl_api.h> in a file causes intellisense not to recognize uint32_t anymore.
    I am programming in C++
  • Hi Fortunato,

    Sorry about the arbitrary changes regarding who is helping you here on this case. 

    I remember there being a lot of cases about intellisense placing red squiggles everywhere in the past, but it has been a while since I've seen this problem.

    Could you show me the c_cpp_properties.json file?

    Marbro1965 said:
    I am programming in C++

    Are you not seeing this problem when using C?

    Marbro1965 said:
    but not for all the instruction. It compiles but intellisense does not work well.

    Could you show me this difference in what it reacts on?

    Regards,

    Elfving

  • Hi,

    there are some images of the error and the c_cpp_properties.json.

    In the last image there are highlighted the libraries which drive intellisense crazy))).

    Thanks very much

    {
        "configurations": [
            {
                "name": "Win32",
                "includePath": [
                    "${workspaceFolder}/**",
                    "${config:nrf-connect.toolchain}/opt/zephyr-sdk/arm-zephyr-eabi/bin",
                    "${config:nrf-connect.toolchain}/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/include",
                    "${config:nrf-connect.toolchain}/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/include/c++/12.2.0",
                    "${config:nrf-connect.toolchain}/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/include/c++/12.2.0/arm-zephyr-eabi",
                    "${config:nrf-connect.toolchain}/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/include/c++/12.2.0/backward",
                    "${config:nrf-connect.toolchain}/opt/zephyr-sdk/arm-zephyr-eabi/lib/gcc/arm-zephyr-eabi/12.2.0/include",
                    "${config:nrf-connect.toolchain}/opt/zephyr-sdk/arm-zephyr-eabi/lib/gcc/arm-zephyr-eabi/12.2.0/include-fixed",
                    "c:/ncs/v2.7.0/zephyr/include",
                    "c:/ncs/v2.7.0/zephyr/include/zephyr",
                    "c:/ncs/v2.7.0/nrfxlib",
                    "c:/ncs/v2.7.0/zephyr/include/zephyr/drivers",
                    "c:/ncs/v2.7.0/zephyr/include/zephyr/kernel",
                    "c:/ncs/v2.7.0/zephyr/include/zephyr/usb",
                    "c:/ncs/v2.7.0/zephyr/arch",
                    "c:/ncs/v2.7.0/nrfxlib/nrf_modem/include",
                    "c:/ncs/v2.7.0/nrf/include",
                    "c:/ncs/v2.7.0/nrf/include/modem",
                    "c:/ncs/v2.7.0/zephyr/drivers",
                    "c:/ncs/v2.7.0/zephyr/kernel",
                    "c:/ncs/v2.7.0/modules/lib/cjson",
                    "c:/ncs/v2.7.0/modules/fs/fatfs/include",
                    "c:/ncs/v2.7.0/modules/hal/nordic/nrfx",
                    "c:/ncs/v2.7.0/modules/hal/nordic/nrfx/mdk"
                ],
                "defines": [
                    "_DEBUG",
                    "UNICODE",
                    "_UNICODE",
                    "CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000",
                    "ARCH_STACK_PTR_ALIGN=4"
                ],
                "configurationProvider": "nordic-semiconductor.nrf-connect",
                "compilerPath": "${config:nrf-connect.toolchain}/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe",
                "cppStandard": "gnu++11",
                "cStandard": "gnu11"
            }
        ],
        "version": 4
    }

  • Could you try adding "intelliSenseMode": "windows-gcc-arm"? And if that doesn't help, could you try setting the configurationProvider to "nrf-connect"? I see there is conflicting advice regarding that last one.

    Marbro1965 said:

    It works only with absolute path (2.0.9 ), but not for all the instruction. It compiles but intellisense does not work well.

    I go back to 2.7.0

    So it doesn't work perfectly with direct path either then. I guess it could be that AI was mistaken about eg. "nrf-connect.toolchain" working in c_cpp_properties.json. Though that a direct path doesn't work either makes this more interesting. What sort of instructions does it not work on?

    Regards,

    Elfving

Reply
  • Could you try adding "intelliSenseMode": "windows-gcc-arm"? And if that doesn't help, could you try setting the configurationProvider to "nrf-connect"? I see there is conflicting advice regarding that last one.

    Marbro1965 said:

    It works only with absolute path (2.0.9 ), but not for all the instruction. It compiles but intellisense does not work well.

    I go back to 2.7.0

    So it doesn't work perfectly with direct path either then. I guess it could be that AI was mistaken about eg. "nrf-connect.toolchain" working in c_cpp_properties.json. Though that a direct path doesn't work either makes this more interesting. What sort of instructions does it not work on?

    Regards,

    Elfving

Children
No Data
Related