Unable to create a build configuration in VS Code using nRF Connect Extension

Hi, 

I followed the instructions listed in Installing the nRF Connect SDK (nordicsemi.com). Then I followed the steps in How to create and build an application (nordicsemi.com) but I keep getting the error shown in the attachment when trying to build the application. I am stuck at the 'Add Build Configuration' step with the error attached. ("Could NOT find Python3"). Could someone please help me figure out what I am missing?

When I hit 'Build Configuration' the nRFConnect Terminal just sits there spinning with no output or error. Then, I tried to use 'west build' command and that's when I see the error attached. 

Using toolchain v2.7.0

SDK v2.7.0

  • Instead of west build on terminal, can you try using the manual build options in VS code?

  • Could you give me more guidance on how to do this? Just attempting to 'Generate Configuration' gives the same error but that also uses 'west'. 

     

  • Hi,

    Looks to me that something has gone wrong in the installation procedure.

    Could you follow the installation steps in https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/installation/install_ncs.html and select "nRF Connect for Visual Studio Code" for every step throughout the way? You should not be required to use chokolatey for anything.

    The same steps are explained in https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-1-nrf-connect-sdk-introduction/ 

    Can you also copy-paste the full build logs instead of pasting screenshots? Attatch them using Insert -> Code or as a .txt file.

    Kind regards,
    Andreas

  • Hello Andreas,

    I followed the steps on the link you provided(which is what I have done quite a few times before I decided to ask for help on the forum). I installed the 2.7.0 toolchain and the 2.7.0 SDK. When I try to add a build configuration and start a build, the task seems to be "hanging" (spinning wheel and grayed out configuration tab). There is an error on the 'Output' tab reported right away. "Error: there is no registered task type 'nrf-connect-generate'. Did you miss installing an extension that provides a corresponding task provider?"

    To try another way to generate a build output file, I tried to use the command on ther terminal

    > west build --board nrf52832 (possibly incorrect but I have a build folder and a file in there that I have attached)

    # This is the CMakeCache file.
    # For build in directory: c:/nordic/myapps/blinky_pwm_1/build
    # It was generated by CMake: C:/ncs/toolchains/ce3b5ff664/opt/bin/cmake.exe
    # You can edit this file to change values found and used by cmake.
    # If you do not want to change any of the values, simply exit the editor.
    # If you do want to change a value, simply edit, save, and exit the editor.
    # The syntax for the file is as follows:
    # KEY:TYPE=VALUE
    # KEY is the name of a variable in the cache.
    # TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
    # VALUE is the current value for the KEY.
    
    ########################
    # EXTERNAL cache entries
    ########################
    
    //Application Binary Directory
    APPLICATION_BINARY_DIR:PATH=C:/nordic/myapps/blinky_pwm_1/build
    
    //Application Source Directory
    APPLICATION_SOURCE_DIR:PATH=C:/nordic/myapps/blinky_pwm_1
    
    //No help, variable specified on the command line.
    BOARD:UNINITIALIZED=nrf52832
    
    //NCS Toolchain DTC
    DTC:FILEPATH=C:/ncs/toolchains/ce3b5ff664/opt/bin/dtc.exe
    
    //NCS Toolchain Git
    GIT_EXECUTABLE:FILEPATH=C:/ncs/toolchains/ce3b5ff664/bin/git.exe
    
    //NCS GNU ARM emb path
    GNUARMEMB_TOOLCHAIN_PATH:PATH=C:/ncs/toolchains/ce3b5ff664/opt
    
    //NCS Toolchain gperf
    GPERF:FILEPATH=C:/ncs/toolchains/ce3b5ff664/opt/bin/gperf.exe
    
    //The directory containing a CMake configuration file for NcsToolchain.
    NcsToolchain_DIR:PATH=C:/ncs/toolchains/ce3b5ff664/cmake
    
    //NCS Toolchain protoc
    PROTOBUF_PROTOC_EXECUTABLE:STRING=C:/ncs/toolchains/ce3b5ff664/opt/bin/cmake.exe;-E;env;PATH=C:\ncs\toolchains\ce3b5ff664\opt\bin\;C:\ncs\toolchains\ce3b5ff664\;C:\ncs\toolchains\ce3b5ff664\mingw64\bin\;C:\ncs\toolchains\ce3b5ff664\bin\;C:\ncs\toolchains\ce3b5ff664\opt\bin\;C:\ncs\toolchains\ce3b5ff664\opt\bin\Scripts\;C:\ncs\toolchains\ce3b5ff664\opt\nanopb\generator-bin\;C:\ncs\toolchains\ce3b5ff664\opt\zephyr-sdk\aarch64-zephyr-elf\bin\;C:\ncs\toolchains\ce3b5ff664\opt\zephyr-sdk\x86_64-zephyr-elf\bin\;C:\ncs\toolchains\ce3b5ff664\opt\zephyr-sdk\arm-zephyr-eabi\bin\;C:\ncs\toolchains\ce3b5ff664\opt\zephyr-sdk\riscv64-zephyr-elf\bin\;c:\Users\paulek\.vscode\extensions\nordic-semiconductor.nrf-connect-2024.9.87-win32-x64\platform\nrfutil\lib\nrfutil-toolchain-manager\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath\;C:\WINDOWS\system32\;C:\WINDOWS\;C:\WINDOWS\System32\Wbem\;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\MATLAB\R2022b\bin\;C:\Program Files\Git\cmd\;C:\Program Files\TortoiseGit\bin\;C:\Program Files (x86)\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility\;C:\Program Files (x86)\Plantronics\Spokes3G\;C\;C:\ProgramData\chocolatey\bin\;C:\Program Files\CMake\bin\;C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin\;C:\Program Files\Microsoft VS Code\bin\;C:\Python\Scripts\;C:\Python\;C:\ncs\;C:\Users\paulek\AppData\Local\Microsoft\WindowsApps\;C:\Users\paulek\AppData\Local\gitkraken\bin\;C:\Users\paulek\;C:\Program Files (x86)\Keil_v5\ARM\ARMCLANG\bin;C:/ncs/toolchains/ce3b5ff664/opt/nanopb/generator-bin/protoc.exe
    
    //NCS Toolchain protoc
    PROTOC:STRING=C:/ncs/toolchains/ce3b5ff664/opt/bin/cmake.exe;-E;env;PATH=C:\ncs\toolchains\ce3b5ff664\opt\bin\;C:\ncs\toolchains\ce3b5ff664\;C:\ncs\toolchains\ce3b5ff664\mingw64\bin\;C:\ncs\toolchains\ce3b5ff664\bin\;C:\ncs\toolchains\ce3b5ff664\opt\bin\;C:\ncs\toolchains\ce3b5ff664\opt\bin\Scripts\;C:\ncs\toolchains\ce3b5ff664\opt\nanopb\generator-bin\;C:\ncs\toolchains\ce3b5ff664\opt\zephyr-sdk\aarch64-zephyr-elf\bin\;C:\ncs\toolchains\ce3b5ff664\opt\zephyr-sdk\x86_64-zephyr-elf\bin\;C:\ncs\toolchains\ce3b5ff664\opt\zephyr-sdk\arm-zephyr-eabi\bin\;C:\ncs\toolchains\ce3b5ff664\opt\zephyr-sdk\riscv64-zephyr-elf\bin\;c:\Users\paulek\.vscode\extensions\nordic-semiconductor.nrf-connect-2024.9.87-win32-x64\platform\nrfutil\lib\nrfutil-toolchain-manager\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath\;C:\WINDOWS\system32\;C:\WINDOWS\;C:\WINDOWS\System32\Wbem\;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\MATLAB\R2022b\bin\;C:\Program Files\Git\cmd\;C:\Program Files\TortoiseGit\bin\;C:\Program Files (x86)\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility\;C:\Program Files (x86)\Plantronics\Spokes3G\;C\;C:\ProgramData\chocolatey\bin\;C:\Program Files\CMake\bin\;C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin\;C:\Program Files\Microsoft VS Code\bin\;C:\Python\Scripts\;C:\Python\;C:\ncs\;C:\Users\paulek\AppData\Local\Microsoft\WindowsApps\;C:\Users\paulek\AppData\Local\gitkraken\bin\;C:\Users\paulek\;C:\Program Files (x86)\Keil_v5\ARM\ARMCLANG\bin;C:/ncs/toolchains/ce3b5ff664/opt/nanopb/generator-bin/protoc.exe
    
    //NCS Toolchain Python
    PYTHON_EXECUTABLE:FILEPATH=C:/ncs/toolchains/ce3b5ff664/opt/bin/python.exe
    
    //NCS Toolchain Python
    Python3_EXECUTABLE:FILEPATH=C:/ncs/toolchains/ce3b5ff664/opt/bin/python.exe
    
    //NCS Toolchain West
    WEST:FILEPATH=C:/ncs/toolchains/ce3b5ff664/opt/bin/Scripts/west.exe
    
    //No help, variable specified on the command line.
    WEST_PYTHON:UNINITIALIZED=C:/ncs/toolchains/ce3b5ff664/opt/bin/python.exe
    
    //Zephyr base
    ZEPHYR_BASE:PATH=C:/ncs/v2.7.0/zephyr
    
    //NCS Zephyr SDK install dir
    ZEPHYR_SDK_INSTALL_DIR:PATH=C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk
    
    //NCS Toolchain Variant
    ZEPHYR_TOOLCHAIN_VARIANT:STRING=zephyr
    
    //The directory containing a CMake configuration file for ZephyrAppConfiguration.
    ZephyrAppConfiguration_DIR:PATH=ZephyrAppConfiguration_DIR-NOTFOUND
    
    //The directory containing a CMake configuration file for ZephyrBuildConfiguration.
    ZephyrBuildConfiguration_DIR:PATH=C:/ncs/v2.7.0/nrf/share/zephyrbuild-package/cmake
    
    //The directory containing a CMake configuration file for Zephyr.
    Zephyr_DIR:PATH=C:/ncs/v2.7.0/zephyr/share/zephyr-package/cmake
    
    
    ########################
    # INTERNAL cache entries
    ########################
    
    //This is the directory where this CMakeCache.txt was created
    CMAKE_CACHEFILE_DIR:INTERNAL=c:/nordic/myapps/blinky_pwm_1/build
    //Major version of cmake used to create the current loaded cache
    CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
    //Minor version of cmake used to create the current loaded cache
    CMAKE_CACHE_MINOR_VERSION:INTERNAL=21
    //Patch version of cmake used to create the current loaded cache
    CMAKE_CACHE_PATCH_VERSION:INTERNAL=0
    //Path to CMake executable.
    CMAKE_COMMAND:INTERNAL=C:/ncs/toolchains/ce3b5ff664/opt/bin/cmake.exe
    //Path to cpack program executable.
    CMAKE_CPACK_COMMAND:INTERNAL=C:/ncs/toolchains/ce3b5ff664/opt/bin/cpack.exe
    //Path to ctest program executable.
    CMAKE_CTEST_COMMAND:INTERNAL=C:/ncs/toolchains/ce3b5ff664/opt/bin/ctest.exe
    //Name of external makefile project generator.
    CMAKE_EXTRA_GENERATOR:INTERNAL=
    //Name of generator.
    CMAKE_GENERATOR:INTERNAL=Ninja
    //Generator instance identifier.
    CMAKE_GENERATOR_INSTANCE:INTERNAL=
    //Name of generator platform.
    CMAKE_GENERATOR_PLATFORM:INTERNAL=
    //Name of generator toolset.
    CMAKE_GENERATOR_TOOLSET:INTERNAL=
    //Source directory with the top level CMakeLists.txt file for this
    // project
    CMAKE_HOME_DIRECTORY:INTERNAL=C:/nordic/myapps/blinky_pwm_1
    //NCS Toolchain ninja
    CMAKE_MAKE_PROGRAM:INTERNAL=C:/ncs/toolchains/ce3b5ff664/opt/bin/ninja.exe
    //number of local generators
    CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
    //Path to CMake installation.
    CMAKE_ROOT:INTERNAL=C:/ncs/toolchains/ce3b5ff664/opt/share/cmake-3.21
    _Python3_EXECUTABLE:INTERNAL=C:/ncs/toolchains/ce3b5ff664/opt/bin/python.exe
    
    

    I am working remotely and wonder if the antivirus software installed by my company could be preventing any script from running? The reason I used chocolatey was to try another installation method - Installing manually (nordicsemi.com). I ran into an error from Cyclance preventing the scripts from running completely so I abandoned that route. 

    Any help or guidance you can provide would be greatly appreciated. 

    Thanks!

  • Hi,

    1. Could you open a command pallette and generate support information? ctrl+shift+p >generate support information 


    2. So the general approach I would recommend is that you start completely from scratch, i.e uninstall all the tools (nrfutil, nrf-command-line tools, Segger, vs code extensions, any appdata) and follow the procedure once more. These are errors that typically come when something has gone wrong in the steps. And yes, I know you've reinstalled it many times, and so have I in the past when I've seen these kinds of errors.

    3. Alternatively if you have another windows machine available you can see if you're able to reinstall

    4. Could you verify which version of Windows you're using? I'm assuming W10 or W11

    5. Is this the exact build command? "west build --board nrf52832" should not return the build log you're seeing unless you've set up custom aliases. It should return the following

    (v2.6.2) C:\ncs\sdk\zephyr\samples\hello_world> west build --board nrf52832
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/sdk/zephyr/samples/hello_world
    -- CMake version: 3.21.0
    -- Using NCS Toolchain 2.6.20240605.885759407716 for building. (C:/ncs/toolchains/ce3b5ff664/cmake)
    -- Found Python3: C:/ncs/toolchains/ce3b5ff664/opt/bin/python.exe (found suitable version "3.9.13", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/sdk/zephyr/.cache
    -- Zephyr version: 3.5.99 (C:/ncs/sdk/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52832
    No board named 'nrf52832' found.
    
    Please choose one of the following boards:
    
    arc:
      em_starterkit
      em_starterkit_em11d
      em_starterkit_em7d
      em_starterkit_em7d_v22
      emsdp
      emsdp_em4
      emsdp_em5d
      emsdp_em6
      emsdp_em7d
      emsdp_em7d_esp
      emsdp_em9d
      hsdk
      hsdk4xd
      hsdk_2cores
      iotdk
      nsim_em
      nsim_em11d
      nsim_em7d_v22
      nsim_hs
      nsim_hs3x_hostlink
      
      .... the list goes on and lists every available board in NCS
    

    Kind regards,
    Andreas

Related