<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-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>west build is invalid choice</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/89008/west-build-is-invalid-choice</link><description>Hi, 
 I have installed the nRF Connect SDK v2.0.0 with Visual Studio and can now successfully, build, flash and run the nrf9160 at_client sample application. But when I try to build it from the command line west says that &amp;#39;build&amp;#39; is an invalid choice</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Wed, 15 Jun 2022 22:37:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/89008/west-build-is-invalid-choice" /><item><title>RE: west build is invalid choice</title><link>https://test-devzone.nordicsemi.com/thread/372677?ContentTypeID=1</link><pubDate>Wed, 15 Jun 2022 22:37:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27fda8dd-3329-4e2d-b32f-2700ba990584</guid><dc:creator>user4461</dc:creator><description>&lt;p&gt;I&amp;#39;m pretty sure ZEPHYR_BASE just tells west where Zephyr is installed. I&amp;#39;ve followed Nordic&amp;#39;s instructions and used their Tool Chain Manager GUI to install the SDK. And it appears that if you do that, you need to add the ZEPHYR_BASE env variable so west can find it.&lt;/p&gt;
&lt;p&gt;It looks like as an alternative, we maybe could use a manifest and do west init/west update. Perhaps that will be the better solution in the end. Thanks for your sample manifest, that will save me a bunch of time as I experiment with this.&lt;/p&gt;
&lt;p&gt;I do think there is still an issue here for Nordic. I would think that when you use &amp;quot;Open Terminal&amp;quot; from the Toolchain Manager SDK drop down, that the ZEPHYR_BASE env variable should have been set. If Nordic agrees, maybe you can add that to their TODO list.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: west build is invalid choice</title><link>https://test-devzone.nordicsemi.com/thread/372666?ContentTypeID=1</link><pubDate>Wed, 15 Jun 2022 18:07:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42ab4355-323e-4eea-b96f-1c5eafc1ca0b</guid><dc:creator>user104297</dc:creator><description>&lt;p&gt;Ah ok,&lt;/p&gt;
&lt;p&gt;I think your exporting of $ZEPHYR_BASE probably informs `west` of the path needed to get to &lt;span style="font-family:courier new, courier;"&gt;/opt/nordic/ncs/v2.0.0/zephyr/scripts/zephyr_module.py&lt;/span&gt;. I&amp;#39;m guessing such a script exists on your system.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not proficient in Python, but it looks like this script may be the entry point for `west` to obtain its build related extending commands, the one that was not available when you tried earlier from the nRF Connect terminal window.&lt;/p&gt;
&lt;p&gt;If you are good compiling and working in the arbitrary location then you&amp;#39;re home!&amp;nbsp; If you need to version control your work, you may be faced with making the sample copy a fully stand alone Zephyr application.&lt;/p&gt;
&lt;p&gt;Glad to hear you have gotten things running as quickly!&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: west build is invalid choice</title><link>https://test-devzone.nordicsemi.com/thread/372665?ContentTypeID=1</link><pubDate>Wed, 15 Jun 2022 17:56:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2069bce7-3e99-46f7-8167-1d1d3e96cdb5</guid><dc:creator>user104297</dc:creator><description>&lt;p&gt;Hi Greg,&lt;/p&gt;
&lt;p&gt;That&amp;#39;s more clear to me now when you describe &amp;quot;I copied one of Nordic&amp;#39;s sample apps to a new directory and I ran west from [there]...&amp;quot;.&amp;nbsp; I think what is missing is that Nordic Semi&amp;#39;s Zephyr based sample apps are part of a larger &amp;#39;west workspace&amp;#39;.&amp;nbsp; To copy a single app to another location without performing a `west init` on that new location will leave the `west` utility with only its core commands, not the extra ones which are provided by either Zephyr or Nordic.&lt;/p&gt;
&lt;p&gt;You can do what you want to do, but from what I gather you are trying to make a stand alone application out of an existing sample app from one of Nordic&amp;#39;s ncs releases.&amp;nbsp; Is your goal to work with a given sample app, and be able to copy or clone that to new locations on demand?&lt;/p&gt;
&lt;p&gt;A few months ago I found myself needing to do this.&amp;nbsp; There are a couple steps involved, but the work is not too harrowing.&amp;nbsp; When I wanted to extend and experiment with Nordic Semi&amp;#39;s aws_iot sample app, and be able to check that into a git repo of my choosing, I needed to complete four key steps:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;(1)&amp;nbsp; copy the sample app to a new dedicated location&lt;/p&gt;
&lt;p&gt;(2)&amp;nbsp; create a west manifest file along side the sample app&amp;#39;s src directory&lt;/p&gt;
&lt;p&gt;(3)&amp;nbsp; invoke `west init -l custom_app` in the parent directory of my project dir named custom_app&lt;/p&gt;
&lt;p&gt;(4)&amp;nbsp; cd into &amp;#39;custom_app&amp;#39; and invoke `west update`&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To create the west manifest file, a file which is by convention named &amp;#39;west.yml&amp;#39; took me the longest time to figure out of any of these steps.&amp;nbsp; It is possible I have forgotten some details, but these steps are in the ballpark of what&amp;#39;s needed to move from building within Nordic Semi&amp;#39;s super big west based project, to building our own apps based on Nordic and Zephyr source trees.&lt;/p&gt;
&lt;p&gt;The critical benefit I needed from this effort is the ability to version control my coding work.&amp;nbsp; In the sample apps which came with my initial `git clone` of Nordic ncs, I can update all I want, but I cannot git control any of my changes.&amp;nbsp; Git is already pointed to Nordic&amp;#39;s repositories on github.&amp;nbsp; That is the way I want it, but I need to be able to leverage their open source code in my own work, and track my changes in git repositories where I have read and write access.&lt;/p&gt;
&lt;p&gt;As an aside, here is what my west.yml west manifest file looks like:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;manifest:
  remotes:
    - name: nrfconnect
      url-base: https://github.com/nrfconnect
  projects:
    - name: nrf 
      repo-path: sdk-nrf
      remote: nrfconnect
      revision: v1.6.1
      import: true 
## 2021-10-28 - contributor Ted removing Kionix out-of-Zephyr-tree driver dependency:
##    # Drivers repository
##    - name: zephyr-driver-work-v2
##      path: kionix-drivers
##      revision: sensor-configuration-routines-work-001
##      url: git@github.com:tedhavelka/zephyr-driver-work-v2
  self:
    # This repository should be cloned to 
    path: aws-iot-stand-alone
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Lines which begin with # are commented out.&lt;/p&gt;
&lt;p&gt;Basically this is the simplest of west manifest files.&amp;nbsp; All it says to `west` when I invoke `west update` is for this utility to go and either download or update Nordic&amp;#39;s nrf repository, at its 1.6.1 release.&amp;nbsp; You can find other more complex examples of west manifest files in ncs 1.6.1 itself -- it has a lot of third party code projects comprising it -- and also in Zephyr RTOS source tree.&lt;/p&gt;
&lt;p&gt;I think you&amp;#39;re pretty close to copying and building your desired sample app in a path of your choosing.&amp;nbsp; But you will need to `west` initialize that path location, and then `west update` to download the needed third party repos.&lt;/p&gt;
&lt;p&gt;Hope this helps, Greg.&amp;nbsp; Stay safe,&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: west build is invalid choice</title><link>https://test-devzone.nordicsemi.com/thread/372664?ContentTypeID=1</link><pubDate>Wed, 15 Jun 2022 17:48:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08864351-5936-475c-a0c3-38d90707273a</guid><dc:creator>user4461</dc:creator><description>&lt;p&gt;Solved it. If I run:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; export ZEPHYR_BASE=/opt/nordic/ncs/v2.0.0/zephyr&lt;/p&gt;
&lt;p&gt;and then run west build it works. Interesting, if I try to specify the ZEPHYR_BASE on the west command line with -z it does not work. Anyway, I would think that the ZEPHYR_BASE would have been set up by the Open Terminal command.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: west build is invalid choice</title><link>https://test-devzone.nordicsemi.com/thread/372661?ContentTypeID=1</link><pubDate>Wed, 15 Jun 2022 17:30:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:740702d7-98be-40cd-ad24-9bc396095dea</guid><dc:creator>user4461</dc:creator><description>&lt;p&gt;Thanks Ted. What I have done is copy one of Nordic&amp;#39;s sample apps (at_client) to a new directory and I ran west from that directory when it failed. Your post made me try one more thing. I went back to the original sample app and ran &amp;#39;west build&amp;#39; from that directory and it works. So now I just have to figure out what west is missing when I copied the sample app to a new location.&lt;/p&gt;
&lt;p&gt;To sum up, if I build the sample app from it&amp;#39;s original location, which on my computer is:&lt;/p&gt;
&lt;p&gt;&lt;span class="s1"&gt;/opt/nordic/ncs/v2.0.0/nrf/samples/nrf9160/at_client&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="s1"&gt;Then west is happy and it builds. If I try to build my copy of at_client at:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="s1"&gt;~/git/nordic/at_client&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="s1"&gt;Then west says build is an invalid choice. I can however build it from VS Code.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="s1"&gt;I guess I need to go learn more about west and Zephyr...&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: west build is invalid choice</title><link>https://test-devzone.nordicsemi.com/thread/372656?ContentTypeID=1</link><pubDate>Wed, 15 Jun 2022 16:48:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1e96dce-1579-426f-881f-4dcd0a1dbb26</guid><dc:creator>user104297</dc:creator><description>&lt;p&gt;Hello Greg,&lt;/p&gt;
&lt;p&gt;My name is Ted, and I just recently got this error myself.&amp;nbsp; I&amp;#39;ve been building ncs 1.6.1 based sample apps and a custom app for a while now, so `west` generally works as expected.&amp;nbsp; The error you give here is exactly what I saw when I mistakenly issued my `west build . . .` command outside the directory in which my custom, Zephyr based app lives.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know how your project directory structure looks, but mine is structured like this:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ncs&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; +-------------+-------------+-----+-----+--------+---------+----------+&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; | &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; | &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;custom_app&amp;nbsp;&amp;nbsp; &amp;nbsp; bootloader&amp;nbsp; &amp;nbsp;&amp;nbsp; modules&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nrf&amp;nbsp;&amp;nbsp;&amp;nbsp; nrfxlib&amp;nbsp;&amp;nbsp;&amp;nbsp; zephyr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .west&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The `west` utility only knows about its &amp;quot;build&amp;quot; option when I invoke west in the directory named custom_app.&amp;nbsp; I believe this has to do with the way `west` looks for additional python modules when it first starts up.&amp;nbsp; Because the parent &amp;#39;ncs&amp;#39; directory is the location I chose to initialize as a &amp;#39;west workspace&amp;#39;, there&amp;#39;s a hidden .west directory created there, along side my custom app.&amp;nbsp; There&amp;#39;s a tiny one-line or few-lines config file there which I believe points `west` to some further, Zephyr specific options such as &amp;#39;build&amp;#39;.&lt;/p&gt;
&lt;p&gt;The reason I can run `west` in any path is that I&amp;#39;ve added its full path to my environment variable $PATH.&lt;/p&gt;
&lt;p&gt;When you open your terminal from nRF Connect SDK is it clear to you, or can you check which is your current working directory?&amp;nbsp; That might be the issue causing your error.&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>