Skip to content

West integration

The Zephyr project includes a tool called west, which is used to manage the combination of multiple Git repositories and versions that make up the nRF Connect SDK. The extension provides a graphical front end to west.

Initializing a west workspace

A new west workspace is created by using west init. To use the command from the extension:

  1. Go to the Command Palette and type nRF Connect: West Init.
  2. Browse to the folder where you want to initialize a west workspace.
  3. Choose nrf or zephyr, or a custom repository.
  4. Choose which version tag you want to work with.

West begins to initialize the workspace in the terminal output.

Updating a west workspace

The west update command makes sure your west workspace state matches the state of the west manifest file. Whenever you check out a different revision in your manifest repository, you should run west update to make sure your workspace contains the project repositories that the new revision expects.

To update a west workspace:

  1. Open the Command Palette and type nRF Connect: West Update
  2. Choose the location of your project repository and west begins to update.

Source control for west modules

The extension provides a view of your west workspace and modules in VS Code's Source Control View including:

  • The path to the current west manifest.
  • The tag or description of the state of the repository that holds the manifest.
  • A list of all the west modules grouped into:
    • Changed: modules that are out of sync with the west manifest or have local file changes.
    • Clean: modules that are neither out of sync nor have local changes.
    • Not Cloned: modules that have not been cloned and therefore do not exist in the file system. These normally correspond to excluded filter groups in the west manifest.
  • An alert symbol if the workspace is out of sync with the manifest. Clicking on the symbol runs west update.

The extension monitors the state of any modules that are inside the VS Code workspace and updates their status when changes are made.

To trigger a status update:

  • Click the refresh button on the west source control line
  • Alternatively, open the Command Palette and type nRF Connect: West Refresh.

Changing the current west manifest

  1. Click on the manifest path icon located towards the top of the Source Control View. You can also open the Command Palette and type nRF Connect: West Set Active Manifest.

  2. Choose between either the nRF or Zephyr manifest. This option is useful for those who use upstream Zephyr and need to frequently switch between the two manifests or different versions.

Managing west in the Source Control View"

Controlling the west environment

On macOS and Linux, the official documentation for the nRF Connect SDK suggests that you add your environment variables, such as GNUARMEMB_TOOLCHAIN_PATH, in ~/.bashrc. Unfortunately, VS Code does not pick up environment variables added to this file, even when launching VS Code from a terminal.

To get around this issue, the extension queries Bash for its environment on Linux and macOS. This executes the ~/.bashrc file, as well as any other files that run when starting Bash. If any of these files execute behavior that you do not want, either check for $NRF_CONNECT_VSCODE in your Bash scripts, or change the nrf-connect.west.env setting.

Note

VS Code picks up environment variables set in .profile. To disable this option while still being compatible with the terminal, move the nRF Connect SDK-specific environment variables (such as ZEPHYR_TOOLCHAIN_VARIANT or GNUARMEMB_TOOLCHAIN_PATH) to .profile.

Back to top