NCS toolchain path missing in VSCode

I followed the directions/videos to install the nRF development environment for VSCode on a Windows machine: https://www.youtube.com/playlist?list=PLx_tBuQ_KSqEt7NK-H7Lu78lT2OijwIMl

I created the Blinky example and it compiled and ran on the nRF52840 Development Kit.

I then tried to build the peripheral_lbs example and ran into errors.

The path in the VSCode Terminal doesn't include all the paths for the nRF toolchain. This is what I find in VSCode Terminal:

C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin\

If I go to Toolchain Manger::nRF Connect SDK v2.10::Open command prompt. This is what I get:

C:\Depot\Source\Library\ncs\toolchains\v2.1.0
C:\Depot\Source\Library\ncs\toolchains\v2.1.0\mingw64\bin
C:\Depot\Source\Library\ncs\toolchains\v2.1.0\bin
C:\Depot\Source\Library\ncs\toolchains\v2.1.0\opt\bin
C:\Depot\Source\Library\ncs\toolchains\v2.1.0\opt\bin\Scripts
C:\Depot\Source\Library\ncs\toolchains\v2.1.0\nanopb\generator-bin
C:\Depot\Source\Library\ncs\toolchains\v2.1.0\opt\zephyr-sdk\arm-zephyr-eabi\bin
Q: How do I fix the nRF Connect VSCode environment to have the same path as that from the Toolchain Manager?
  • I didn't dismissed or ignored any prompts. I re-installed VSCode using Toolchain manager as suggested and it didn't fix the issue.

    The reason the CMake extension is saying this is that the build environment is not able to find the NCS one because the environment isn't setup properly which is the issue I need your help to fix.

  • Hi,

    From the Toolchain Manager, click on the Open VS Code button to install the nRF Connect Extension Pack. You will see a list of any missing extensions that need to be installed.

    Click Install missing extensions. Relaunch both the Toolchain Manager and nRF Connect for Desktop to see if any remaining tools still need to be installed.

    It will show on the right down corner to ask switch to the nordic extension. Please press YES. You also could Open the nRF Connect extension by clicking its icon or pressing Ctrl+Alt+N.

    -Amanda 

  • Thank for the new suggestion and continuing to help.

    I followed your instructions and there were no missing extensions to install.

    I looked in the VSCode extension list and I see "nRF Connect for VS Code Extension Pack" with no errors or any issues.

    VSCode had no notifications either.

  • Do you see any notification after relaunching VScode or building the peripheral_lbs?

    Do you still got the same error log while building peripheral_lbs? Try to delete the build folder and build again. Please provide the error log if it still has the issue.

    Thanks,
    Amanda H.

  • I'm not getting any build errors after I deleted the build configuration. Restarted VSCode. Recreated the build configuration and redid the build.

    But on startup, I still get:
    [{
        "resource": "/C:/Depot/Source/Library/ncs/v2.1.0/zephyr/cmake/modules/extensions.cmake",
        "owner": "cmake-configure-diags",
        "severity": 8,
        "message": "CMake Error at C:/Depot/Source/Library/ncs/v2.1.0/zephyr/cmake/modules/extensions.cmake:2398 (message):BOARD is not being defined on the CMake command-line in the environment or\nby the app.",
        "source": "CMake (message)",
        "startLineNumber": 2398,
        "startColumn": 1,
        "endLineNumber": 2398,
        "endColumn": 10000,
        "relatedInformation": [
            {
                "startLineNumber": 52,
                "startColumn": 1,
                "endLineNumber": 52,
                "endColumn": 1000,
                "message": "In call to 'zephyr_check_cache' here",
                "resource": "/C:/Depot/Source/Library/ncs/v2.1.0/zephyr/cmake/modules/boards.cmake"
            },
            {
                "startLineNumber": 121,
                "startColumn": 1,
                "endLineNumber": 121,
                "endColumn": 1000,
                "message": "In call to 'include' here",
                "resource": "/C:/Depot/Source/Library/ncs/v2.1.0/zephyr/cmake/modules/zephyr_default.cmake"
            },
            {
                "startLineNumber": 66,
                "startColumn": 1,
                "endLineNumber": 66,
                "endColumn": 1000,
                "message": "In call to 'include' here",
                "resource": "/C:/Depot/Source/Library/ncs/v2.1.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake"
            },
            {
                "startLineNumber": 159,
                "startColumn": 1,
                "endLineNumber": 159,
                "endColumn": 1000,
                "message": "In call to 'include_boilerplate' here",
                "resource": "/C:/Depot/Source/Library/ncs/v2.1.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake"
            },
            {
                "startLineNumber": 4,
                "startColumn": 1,
                "endLineNumber": 4,
                "endColumn": 1000,
                "message": "In call to 'find_package' here",
                "resource": "/c:/Depot/Source/nRF/TestApp/peripheral_lbs/CMakeLists.txt"
            }
        ]
    },{
        "resource": "/c:/Depot/Source/Library/ncs/v2.1.0/zephyr/CMakeLists.txt",
        "owner": "nrf-connect",
        "severity": 4,
        "message": "__ASSERT() statements are globally ENABLED",
        "source": "cmake",
        "startLineNumber": 1839,
        "startColumn": 1,
        "endLineNumber": 1839,
        "endColumn": 2147483647
    }]

Related