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?
Parents
  • 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
    }]

Reply
  • 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
    }]

Children
  • Hi, 

    Sorry for the delay. The team can't reproduce the errors, however, they are all cmake related and apart from the last minor one they are reported by the cmake extension (we don't control them). The error message is curious though: BOARD is not being defined on the CMake command-line in the environment or by the app. A build cannot be generated by west on the command line without specifying a valid board, and neither it is possible within VS Code (that also just calls west). I'd say these are stale reports and they can be ignored, otherwise, it would be nice to know the exact steps to reproduce.

    Regards,
    Amanda H.

Related