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

VS Code says nRF Command Line Tools are not installed

After successfully building and running the nRF9160 at_client sample app on Monday, I tried to repeat this success this morning but VS Code under Connected Devices says nRF Command Line Tools are not installed and does not show the nRF9160 board. Nothing changed from Monday that I can think of. I did try re-installing the nRF Command Line Tools, but nothing changed. Not sure what to do next.

I'm on a M1 Mac, but have installed the Intel versions of all software as I understand there are issues with the native M1 software. As I said, this worked the last time I tried it two days ago.

Parents
  • I solved the problem by adding the following line to my .zshrc file:

    export ZEPHYR_BASE=/opt/nordic/ncs/v2.0.0/zephyr

    Now I'm curious why it worked and then stopped working. Between when it worked and stopped working, I had been trying to get the command line working and had been editing my .zshrc file. Perhaps I had mucked something up? If I do a clean install on a new computer, do I need to add this line to .zshrc? I'd like to better understand.

  • Hi,

    When you select the toolchain from the toolchain manager from VS Code or open VS Code from the toolchain manager, all required environment variables are set automatically for you. Most are also set for you when you open the terminal from the toolchain manager, but ZEPHYR_BASE is no longer set automatically for 2.0.0 (that has been reported). So if you are building projects out of tree you need to set it yourself, either when needed or in the .zshrc to do it permanently. This will also be the case on new computers, unless the Toolchain manager start setting this again when you open a terminal from the toolchain manager (which is likely to happen in a future update).

Reply
  • Hi,

    When you select the toolchain from the toolchain manager from VS Code or open VS Code from the toolchain manager, all required environment variables are set automatically for you. Most are also set for you when you open the terminal from the toolchain manager, but ZEPHYR_BASE is no longer set automatically for 2.0.0 (that has been reported). So if you are building projects out of tree you need to set it yourself, either when needed or in the .zshrc to do it permanently. This will also be the case on new computers, unless the Toolchain manager start setting this again when you open a terminal from the toolchain manager (which is likely to happen in a future update).

Children
  • Thanks Einar. That explains what is going on, but there is another problem that opening VS Code from the Toolchain Manager does not currently work. That is certainly the case for me (reports it cannot find VS Code) and I believe I saw that as another known issue on Dev Zone. Anyway, thanks for explaining the underlying cause. I have everything working now.

Related