<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nrfutil toolchain-manager env does not set ZEPHYR_BASE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/123617/nrfutil-toolchain-manager-env-does-not-set-zephyr_base</link><description>I am trying to setup a NRF SDK development environment on the terminal on Ubuntu (I already successfully setup using VSCode), and I am trying to use nrfutil toolchain-manager env --as-script for that. 
 But when I try to build my project using west, it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Aug 2025 19:05:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/123617/nrfutil-toolchain-manager-env-does-not-set-zephyr_base" /><item><title>RE: nrfutil toolchain-manager env does not set ZEPHYR_BASE</title><link>https://devzone.nordicsemi.com/thread/545966?ContentTypeID=1</link><pubDate>Mon, 18 Aug 2025 19:05:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aea216f2-fb60-4dcc-89cc-e59e483570aa</guid><dc:creator>Rodrigo Moraes</dc:creator><description>&lt;p&gt;Sorry for the late reply. The source of my confusion was that I thought both the SDK and the toolchain were handled by `nrfutil toolchain-manager`, but that does not appear to be the case. I am trying to avoid hardcoding the SDK path.&lt;/p&gt;
&lt;p&gt;However, I discovered that there is an `nrfutil sdk-manager`, which manages both the SDK and the toolchains. It does not appear to have an equivalent of `nrfutil toolchain-manager env` for the SDK, but it does at least allow you to query the SDK path, and therefore find the path to `zephyr-env.sh`. So I made the following script for setting up the NCS environment (it relies on `jq` for parsing the JSON output of `nrfutil sdk-manager list --json`):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#!/bin/sh
# Usage: source ./ncd_env.sh
# This script finds the first available nRF Connect SDK version and directory,
# sources its environment, and then sources zephyr/zephyr-env.sh in that SDK.

find_and_source_ncs_env() {
    # Get the JSON from nrfutil
    local json
    json=&amp;quot;$(nrfutil sdk-manager list --json)&amp;quot;

    # Extract the first valid dir/version pair
    local result
    result=$(echo &amp;quot;$json&amp;quot; | jq -r &amp;#39;[.data.versions[] | {dir: (.dirNames[0] // null), version} | select(.dir != null and .version != null)][0] | @sh &amp;quot;version=\(.version) dir=\(.dir)&amp;quot;&amp;#39;)
    eval &amp;quot;$result&amp;quot;  # sets $version and $dir

    if [ -n &amp;quot;$version&amp;quot; ] &amp;amp;&amp;amp; [ -n &amp;quot;$dir&amp;quot; ]; then
        eval &amp;quot;$(nrfutil sdk-manager toolchain env --ncs-version &amp;quot;$version&amp;quot; --as-script sh)&amp;quot;
        # Source zephyr-env.sh if it exists
        if [ -f &amp;quot;$dir/zephyr/zephyr-env.sh&amp;quot; ]; then
            # shellcheck source=/dev/null
            . &amp;quot;$dir/zephyr/zephyr-env.sh&amp;quot;
            echo &amp;quot;Sourced env for ncs version $version&amp;quot;
        else
            echo &amp;quot;zephyr-env.sh not found at $dir/zephyr/zephyr-env.sh&amp;quot;
            return 2
        fi
    else
        echo &amp;quot;No valid version or directory found.&amp;quot;
        return 1
    fi
}

find_and_source_ncs_env&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil toolchain-manager env does not set ZEPHYR_BASE</title><link>https://devzone.nordicsemi.com/thread/545354?ContentTypeID=1</link><pubDate>Tue, 12 Aug 2025 11:27:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:171462ae-418f-4579-95b4-9cdbacf45068</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;You need to set source zephyr/zephyr-env.sh as seen &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/develop/env_vars.html#zephyr_environment_scripts"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil toolchain-manager env does not set ZEPHYR_BASE</title><link>https://devzone.nordicsemi.com/thread/545214?ContentTypeID=1</link><pubDate>Mon, 11 Aug 2025 13:11:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33841806-65e5-4c73-a5f6-b75ba4d67c36</guid><dc:creator>Rodrigo Moraes</dc:creator><description>&lt;p&gt;PS: the post problem&amp;nbsp;appears to be the inclusion of the string &amp;quot;un&lt;span&gt;а&lt;/span&gt;me -&lt;span&gt;а&lt;/span&gt;&amp;quot;, or some part of it. I replace some letters with unicode look-alikes to see if I can circumvent it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>