Skip to content

Creating an application

Click Create a new application from sample from the Welcome panel to open the New Application screen.

Create a new application

Application types

There are two types of applications supported by the extension: freestanding and workspace.

Workspace application

A workspace application is an application that is inside a west workspace. A workspace application specifies the nRF Connect SDK version through the west manifest file. This means that the nRF Connect SDK version setting specified in the VS Code workspace setting is not used to resolve the nRF Connect SDK installation.

Instead west will clone a separate instance of nRF Connect SDK to its workspace and use it for the workspace application.

Workspace name

When creating a workspace application, a Workspace name field appears in the New Application screen and creates a workspace directory with the name you enter. This directory contains both the SDK and the application's directory.

Freestanding application

A freestanding application is an application that is not inside a west workspace and not using west manifest to specify the nRF Connect SDK version. Instead, the nRF Connect SDK version specified in the VS Code workspace setting is used. This means that all freestanding applications in the same VS Code workspace will use the same nRF Connect SDK version.

The extension will resolve the path of the nRF Connect SDK installation on the local system from the version variable. Typically, this means that applications in different VS Code workspaces that point to the same nRF Connect SDK version will use the same copy of the installed nRF Connect SDK.

Application location and name

  1. Set Application location to where you want your application to be stored.

  2. Type in a name for the application. This creates another folder in the Application location directory.

nRF Connect SDK versions

By default, the nRF Connect SDK is determined by the version you selected during setup. If you want to compile your application against a different version, install that version from the Toolchain Manager and choose it in the Quick Setup screen.

See Configuration scopes for more information on how your environment is affected by configuration scopes.

Application templates

  1. Click the Browse button to open the Sample Browser.
  2. Search for specific samples by typing the name into the search field, or filter the search parameters by clicking the filter icon. The sample's documentation appears in the right side of the browser.

    Blinky sample application

  3. When you have found the sample you want to use, click Select and then click Create Application. The application is now visible in the Applications panel of the extension.

    Note

    Some samples in the nRF Connect SDK are currently not designed to work out-of-tree. You may need to manually configure your sample to work correctly in the extension.

Using custom samples

The extension scans for freestanding applications in all the west modules in the manifest and adds them to the Application template list. To have a custom sample that is based on your own SDK appear in the list, it must meet the following requirements:

  1. The application must have a sample.yaml file.
  2. The application must be located in either the samples or applications folder of your module in the SDK. The extension looks for the pattern ${topdir}/**/(applications|samples)/**/sample.yaml.
  3. The sample.yaml file must not be deeper than 8 levels from ${topdir}.

Working with multiple applications

The extension lets you work with multiple applications without the need for a multi-root workspace. You can see the list of applications associated with the current workspace in the Applications panel.

When opening a file in the editor or changing the active editor window, and the file is in an application's directory, the active application implicitly changes. If the file belongs to a build directory, then the active configuration changes too.

Note

All freestanding applications added to the VS Code workspace will use the same nRF Connect SDK version. We do not recommend adding multiple workspace applications to the same VS Code workspace.

Adding multiple applications

You can add additional applications to the list in any of the following ways:

  • Click on Creating new application from sample from the Welcome panel.
    This will add the application to the VS Code workspace.

    Add an application from the Welcome panel

  • Click on the plus sign icon from the Applications panel.
    This will add the application to the list of applications.

    Add an application with the plus sign icon

  • Right-click on an application's folder and chose Add Folder As Application.
    This will add the application to the list of applications.

    Add an application from the context menu

  • Go to File > Add Folder to Workspace from the main interface.
    This will add the application to the VS Code workspace.

    Add an application from the file menu

Back to top