Porting to NCS v2.0

Our development environment extends the NCS for our 9160 and 52840 hardware. To create a command line build environment in v.1.x.x, I was able to leverage the env.cmd file found in .\v1.x.x\toolchain\cmd to set the environment variables needed by command line builds. This isolated our tools from having to know and individually set these variables.

Now, in v2.0, this cmd file no longer exists. The only way to get an 'official' command line build environment appears to be to use the "Toolchain Manager" GUI tool. Is there a documented way to set the proper environment variables from the command line? Thanks.

Doug

Parents
  • Hi Douglas,

    I heard back from our experts.

    "Eventually we will release a command line version of the toolchain manager and that will support getting the script
    sourced by the command prompt when using the Toolchain Manager 'open command prompt' option.
    A workaround for the script, is to use the env subcommand of the version of nrfutil-toolchain-manager that is bundled with the graphical Toolchain Manager. The script will depend on the way you invoke it. E.g. if I call
    %USERPROFILE%\.nrfconnect-apps\node_modules\pc-nrfconnect-toolchain-manager\resources\nrfutil-toolchain-manager\win32\nrfutil-toolchain-manager.exe env --as-script --install-dir C:\ncs --ncs-version v2.0.0
    in a command prompt, I get a different script when I call
    $USERPROFILE/.nrfconnect-apps/node_modules/pc-nrfconnect-toolchain-manager/resources/nrfutil-toolchain-manager/win32/nrfutil-toolchain-manager.exe env --as-script --install-dir C:/ncs --ncs-version v2.0.0
    in a bash. That might already help the customer.
    Both invocations above depend on the SDKs and toolchains being installed at C:\ncs, which is the default it the users did not already install toolchains with older versions of the Toolchain Manager, otherwise the user needs to change the arguments accordingly.
    NOTE: The commands above do not include setting the environment variable ZEPHYR_BASE. So, e.g. in my example above ZEPHYR_BASE needs additionally be set to C:\ncs\v2.0.0\zephyr."
    -Priyanka
Reply
  • Hi Douglas,

    I heard back from our experts.

    "Eventually we will release a command line version of the toolchain manager and that will support getting the script
    sourced by the command prompt when using the Toolchain Manager 'open command prompt' option.
    A workaround for the script, is to use the env subcommand of the version of nrfutil-toolchain-manager that is bundled with the graphical Toolchain Manager. The script will depend on the way you invoke it. E.g. if I call
    %USERPROFILE%\.nrfconnect-apps\node_modules\pc-nrfconnect-toolchain-manager\resources\nrfutil-toolchain-manager\win32\nrfutil-toolchain-manager.exe env --as-script --install-dir C:\ncs --ncs-version v2.0.0
    in a command prompt, I get a different script when I call
    $USERPROFILE/.nrfconnect-apps/node_modules/pc-nrfconnect-toolchain-manager/resources/nrfutil-toolchain-manager/win32/nrfutil-toolchain-manager.exe env --as-script --install-dir C:/ncs --ncs-version v2.0.0
    in a bash. That might already help the customer.
    Both invocations above depend on the SDKs and toolchains being installed at C:\ncs, which is the default it the users did not already install toolchains with older versions of the Toolchain Manager, otherwise the user needs to change the arguments accordingly.
    NOTE: The commands above do not include setting the environment variable ZEPHYR_BASE. So, e.g. in my example above ZEPHYR_BASE needs additionally be set to C:\ncs\v2.0.0\zephyr."
    -Priyanka
Children
No Data
Related