Setting up a west workspace (in progress)

Application types

In nRF Connect SDK (and Zephyr), there are three basic types of applications based on where the application is located:

Application typeApplication location
RepositorynRF Connect SDK repository
FreestandingOther locations
Workspacewest workspace where Zephyr is installed

Repository application

An application located within the nRF Connect SDK source code repository in a Zephyr west workspace is referred to as a repository application. The samples and applications already in nRF Connect SDK are all examples of repository applications.

In the following example, asset_tracker_v2 and hello_world are repository applications.

nRF-Connect-SDK/
├─── .west/
│    └─── config
└─── nrf/
     ├── applications/
     │    ├── asset_tracker_v2/
     │    └── ...     
     ├── boards/
     ├── tests/
     └── ...
└─── zephyr/
     ├── boards/
     ├── drivers/
     ├── samples/
     │    ├── hello_world/
     └── ...     
└─── ...
File structure

Freestanding application

An application located outside of a workspace is referred to as a freestanding application. The exercise code in the Nordic Developer Academy are all freestanding applications.

In the following example, inter_less1_exer1-solution is a freestanding application:

<home>/
├─── nRF-Connect-SDK/
│     ├─── .west/
│     │    └─── config
│     ├── nrf/
│     ├── zephyr/
│     ├── bootloader/
│     ├── modules/
│     └── ...

└─── ncs-inter/
     ├── lesson1  
     │    └─── inter_less1_exer1_solution     
     │         ├── CMakeLists.txt
     │         ├── prj.conf
     │         └── src/
     │             └── main.c     
     ├── lesson2
     ├── ...
File structure

Workspace application

An application located within a west workspace, but outside the nRF Connect SDK repository itself, is referred to as a workspace application.

In the following example, app is a workspace application:

my-workspace/
├─── .west/
│    └─── config
├─── nrf/
├─── zephyr/
├─── bootloader/
├─── modules/
├─── tools/
├─── ncs-example-application
     └── app/
         ├── CMakeLists.txt
         ├── prj.conf
         └── src/
             └── main.c     
File structure

Setting up a workspace application

west init and west update are the two most important workspace-related commands.

west init creates a west workspace. This can either be done by cloning a new manifest repository from a remote URL, or creating a workspace around an existing local manifest repository.

Cloning a new manifest repository from a remote URL:

# initialize my-workspace for the ncs-example-application (main branch)
west init -m https://github.com/nrfconnect/ncs-example-application --mr main my-workspace
# update nRF Connect SDK modules
cd my-workspace
west update
Terminal command

Creating a workspace around a local manifest repository:

west init -l ncs-example-application
Terminal command
Register an account
Already have an account? Log in
(All fields are required unless specified optional)

  • 8 or more characters
  • Upper and lower case letters
  • At least one number or special character

Forgot your password?
Enter the email associated with your account, and we will send you a link to reset your password.