This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Toolchain bash and command prompt initialization.

Hello,

I need to run "west build" and "west flash" commands from my custom IDE/Editor.   If  I open up Toolchain Manager and then do "Open bash" or "Open Command Prompt",

all works fine.  But now I need to do it  from regular bash and command prompt without opening the toolchain manager via my IDE/Editor.  I installed west but  I get

this error : 

usage: west [-h] [-z ZEPHYR_BASE] [-v] [-V] <command> ...
west: error: argument <command>: invalid choice: 'flash' (choose from 'init', 'pdate', 'list', 'manifest', 'diff', 'status', 'forall', 'help', 'config', 'topdr', 'selfupdate')

So, there must be an initialization that Toolchain Manager does.  Is there a way to get that initialization scripts so I can incorporate those in my *.sh and *.bat

files and execute those "west build" and "west flash" commands  ?

Many thanks for your reply.

Parents
  • Hi Jonathan,  thank you.  Just a aclarification, are you recommending me to uninstall  my SDK and toolchain that I've installed via "nRF Connect Desktop" and reinstall it via manual installation ?   Thanks ... 

  • No, that is not needed, was just adding the guide as additional material, it shows a bit more of prosess. Sorry for the confusion, the additional specifiers in the commands you intend to run should suffice. 

    Regards,
    Jonathan

  • Thank you for clarification.  Unfortunately I was not able to explain clearly what my problem was. 

    My problem is not about how to use "west". 

    If I open a bash window or command prompt via nRF Connect Desktop and then toolchain manager,  I don't have any issues.  If I open a bash window or command prompt via Windows run menu and run west command,  it displays "west: command not found".   

    As I've mentioned before,  I need to trigger a build/flash/run cycle via external tools, such as another IDE or Jenkins.  Therefore, my question is,  just like when you startup bash/command-line via Toolchain Manager,  I need to do it from my tools and therefore my questions are,  1. is there an initialization script that I should run ? 2. How does your Toolchain Manager run "Open bash" or "Open Command Prompt" commands so I can do the same thing from my tools. 

    Best. 
      

  • OK thanks for the explanation.

    When using NRF connect for Desktop the "Open bash" or "Open Command Promt" is running the .exe/.cmd in the toolchain directory


    You can do the manual install guide, then the west command can be sett as global so you will not have the "west command not found" issue, but then it is not as clean to rund different versions of NCS if that is something you do a lot. 

    Regards,
    Jonathan

Reply
  • OK thanks for the explanation.

    When using NRF connect for Desktop the "Open bash" or "Open Command Promt" is running the .exe/.cmd in the toolchain directory


    You can do the manual install guide, then the west command can be sett as global so you will not have the "west command not found" issue, but then it is not as clean to rund different versions of NCS if that is something you do a lot. 

    Regards,
    Jonathan

Children
No Data
Related