Creating an application¶
To start creating an application, click on the nRF Connect icon in the Activity Bar or press Ctrl+Alt+N.
You have the following options to create an application:
- In the Welcome View: Add an existing application and Create a new application
- In the Applications View: Add Application (identical to Add an existing application)
Add an existing application¶
Use this option or the corresponding Add Application option when you want to test out an SDK sample without making any changes of your own. This option opens the Select Folder window, in which you can select the directory of the sample that you want to test.
Create a new application¶
Use this option if you want to use an existing SDK sample as a canvas for your own project and want to develop a fully functioning application with a custom configuration. This option opens the New Application screen, where you can select a template for your application.
There are two types of applications supported by the extension: freestanding and workspace.
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.
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.
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¶
Set Application location to where you want your application to be stored.
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.
- Click the Browse button to open the Sample Browser.
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.
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 View in the Sidebar.
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:
- The application must have a
- The application must be located in either the
applicationsfolder of your module in the SDK. The extension looks for the pattern
sample.yamlfile must not be deeper than 8 levels from
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 View.
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.
Adding multiple applications¶
You can add additional applications to the list in any of the following ways:
Click on Create a new application from the Welcome View. This will add the application to the VS Code workspace.
Click on the plus sign icon from the Applications View. This will add the application to the list of applications.
Right-click on an application's folder and chose nRF Connect: Add Folder As Application. This will add the application to the list of applications.
Go to File > Add Folder to Workspace from the main interface. This will add the application to the VS Code workspace.