nRF Connect v2.6.0 installation issue through command line

Hi,

On my machine, I installed the SDK through VSCode with the extension pack. All runs smoothly and I can build from vscode and from command line with : 

west build --build-dir c:/Users/Documents/BTM/_build/Hardware/XSWIFI c:/Users/Documents/Project --pristine --board nrf5340 --no-sysbuild --cmake-only -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=c:/Users/Documents/Project/prj.conf -DBOARD_ROOT=./ -DTARGET=NRF53 -DCMAKE_BUILD_TYPE=MinSizeRel -DHAL_NRF5=0 -DZEPHYR_BUILD=ON

My C:\ncs folder looks like this : 

Now I would like to be able to install the toolchain and build by command line. 

Here is my .bat script : 

rem get nrfutil.exe
python -m buildTools download "https://files.nordicsemi.com/ui/api/v1/download?repoKey=swtools&path=external/nrfutil/executables/x86_64-pc-windows-msvc/nrfutil.exe" tools\ || goto ERROR \b 1
tools\nrfutil.exe install toolchain-manager || goto ERROR \b 1
tools\nrfutil.exe toolchain-manager install --ncs-version v2.6.0 || goto ERROR \b 1
tools\nrfutil.exe toolchain-manager env --as-script > \tools\zephyr_env.cmd
tools\zephyr_env.cmd
rem bug with command line utility that don't set ZEPHYR_BASE while creating the script via UI does
SET ZEPHYR_BASE=C:\ncs\v2.6.0\zephyr
west build --build-dir c:/Users/Documents/BTM/_build/Hardware/XSWIFI c:/Users/Documents/Project --pristine --board nrf5340 --no-sysbuild --cmake-only -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=c:/Users/Documents/Project/prj.conf -DBOARD_ROOT=./ -DTARGET=NRF53 -DCMAKE_BUILD_TYPE=MinSizeRel -DHAL_NRF5=0 -DZEPHYR_BUILD=ON

And the error is : 

west: unknown command "build"; do you need to run this inside a workspace?

Thing is, after tools\nrfutil.exe toolchain-manager install --ncs-version v2.6.0, the folder looks like this:  

v2.6.0 folder is missing. Why? I assume it is because I didn't performed west init and west update commands and it is the reason west doesn't find the "build" command. I saw the command toolchain-manager launch --terminal but it launches another terminal and my script continue on the first one, which I don't want. How to properly install the complete SDK in a single terminal? 

Thank you for you help

  • Hi Benoit,

    Please go through this nRF Connect SDK installation guide, where it's mentioned in detail how to install via command line or VSCode. I would suggest you to uninstall all current installations and once again try according to the documentation.

    Regards,

    Priyanka

  • Hi, the installation guide provided do not explain how to perform the installation in a single terminal (toolchain-manager launch --terminal launches a new terminal and the first .bat script cannot execute anything in that terminal). Here is the script I came up with:

    rem get nrfutil.exe
    SET BUILD_DIR=%CD%
    python -m buildTools download "https://files.nordicsemi.com/ui/api/v1/download?repoKey=swtools&path=external/nrfutil/executables/x86_64-pc-windows-msvc/nrfutil.exe" tools\ || goto ERROR \b 1
    tools\nrfutil.exe install toolchain-manager || goto ERROR \b 1
    tools\nrfutil.exe toolchain-manager install --ncs-version v2.6.0 || goto ERROR \b 1
    CD /d C:\ncs 
    mkdir v2.6.0 && CD v2.6.0
    west init -m https://github.com/nrfconnect/sdk-nrf --mr v2.6.0 
    west update 
    CD /d %BUILD_DIR%
    tools\nrfutil.exe toolchain-manager env --as-script > \tools\zephyr_env.cmd
    tools\zephyr_env.cmd
    rem bug with command line utility that don't set ZEPHYR_BASE while creating the script via UI does
    SET ZEPHYR_BASE=C:\ncs\v2.6.0\zephyr
    west build --build-dir c:/Users/Documents/BTM/_build/Hardware/XSWIFI c:/Users/Documents/Project --pristine --board nrf5340 --no-sysbuild --cmake-only -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=c:/Users/Documents/Project/prj.conf -DBOARD_ROOT=./ -DTARGET=NRF53 -DCMAKE_BUILD_TYPE=MinSizeRel -DHAL_NRF5=0 -DZEPHYR_BUILD=ON
    
    

    Now my C:\ncs\ folder looks correct, but I have the error : 

     unknown command "build"; workspace D:\JenkinsNode\workspace\_Project does not define this extension command -- try "west help"

    What does toolchain-manager launch --terminal performs exactly? How can I reproduce it once I jumped into C:\ncs\ folder before performing "west init" and "west update" commands?

    Thank you for your help

  • SOLVED : I had a .west folder in my base directory. Everything is fine after removing it.

Related