> For the complete documentation index, see [llms.txt](https://docs.conexiotech.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.conexiotech.com/master/building-and-programming-an-application/compiling-applications-with-nrf-connect-extension-for-vs-code.md).

# Compiling Applications with nRF Connect Extension for VS Code

{% hint style="warning" %}
Compiling Conexio Stratus applications using nRF Connect for VSCode is the recommended method.
{% endhint %}

To make zephyr-based application development a breeze, the Stratus board is also compatible with the newly released nRF Connect SDK extension for VS Code.&#x20;

## **1. Adding an existing application to nRF Connect for VS Code**

Once you are all set with the [<mark style="color:red;">nRF Connect Visual Studio Code Extension Pack</mark>](https://marketplace.visualstudio.com/items?itemName=nordic-semiconductor.nrf-connect-extension-pack) installation, start the extension in the VS Code.

{% hint style="success" %}
Installing the nRF Connect Visual Studio Code Extension Pack will also install all the required dependencies.
{% endhint %}

First, Open Existing Application:

<figure><img src="/files/7VxcUjo1hnJWHyxYVWRw" alt=""><figcaption></figcaption></figure>

This will open the file browser on your machine. Navigate to the location where the `conexio-firmware-sdk` directory resides (`ncs/v3.2.1/conexio-firmware-sdk/samples/conexio_stratus`). Select a sample application and click **Open**.

<figure><img src="/files/KQYFjNX3XJ46x5nkWuAo" alt=""><figcaption><p>Browse the sampe application</p></figcaption></figure>

You should now see the ported application under **APPLICATIONS** on the left pane.

## **2. Point the build system to the custom board root directory of Conexio boards**

By default, the build system in nRF Connect goes to specific folders to look for board definitions. Namely,`<SDK Installation Path>/zephyr/boards/arm/`and `<SDK Installation Path>/nrf/boards/arm/`.

We need to tell the build system to look at the directory for the custom Conexio Stratus boards. This is easy to do within the VS Code environment.

Navigate to the Settings of nRF Connect Extension. This can be done by navigating to File -> Preferences -> Settings -> Extensions -> nRF Connect -> Board Roots, then add the `conexio-firmware-sdk`directory path as shown below.

**For NCS v3.2.1**

```
/opt/nordic/ncs/v3.2.1/conexio-firmware-sdk
```

An example is shown below:

<figure><img src="/files/L7foT9KrxTWNmWkglhOR" alt=""><figcaption><p>Board Root configuration for nRF Connect for VS Code -> NCS v3.2.1</p></figcaption></figure>

{% hint style="info" %}
The above directory path will be different on the Windows and Ubuntu machines.
{% endhint %}

## **3. Compiling an application using nRF Connect Extension**

Prior to compiling our sample application, we first need to generate the device build configuration for our project by clicking on the **Add Build Configuration (1)** option as shown below.

This opens a new tab, asking the user to select the board for which the build configurations will be generated. In our case, we will&#x20;

* (2) check the **Custom boards**

<figure><img src="/files/uisocTXJA2WlkRcdDlB4" alt=""><figcaption><p>Adding build configuration for NCS</p></figcaption></figure>

(ii) then from the drop-down menu select the desired Conexio Stratus board

* &#x20;`conexio_stratus_pro/nrf9151/ns`for Stratus Pro nRF9151
* `conexio_stratus_pro/nrf9161/ns`for Stratus Pro nRF9161

<figure><img src="/files/XUHfaIXijoQnIsOmp1qC" alt=""><figcaption><p>Conexio Board Targets</p></figcaption></figure>

**Note:** to generate the correct binary `zephyr.signed.bin`, select either **Build system default** or **Use sysbuild** under **System build (sysbuild)** as shown below.

<figure><img src="/files/8K3nvMl0w9lxe5sdfVpB" alt=""><figcaption></figcaption></figure>

(3) click **Build Configuration** to start the Zephyr application build process.

Now, you should see the build process kicking in the background and generating the required files and binaries for the `led_blink` sample application.

<figure><img src="/files/DODAiO7OM7gYza8Q81cM" alt=""><figcaption><p>Application Build In Progress</p></figcaption></figure>

Once the project is compiled successfully, in the project navigation panel, you will see all the generated files. The main program binary that will be flashed to the Stratus device is `zephyr.signed.bin`, located in your app directory -> `build/<project_name>/zephyr/zephyr.signed.bin.`

![Application Compiled Successfully](/files/HPy37vogFZd1a4VrMchG)

Well done! You have successfully managed to compile the sample application using the nRF Connect extension.

## 4. Setting DFU Mode (Device Firmware Upgrade)

To program the Stratus device via USB, you will need to put the device into DFU mode first. This mode triggers the onboard bootloader that accepts firmware binary files. To enter DFU mode:

* Hold down BOTH buttons (BUTTON/MODE + RESET)
* Release only the RESET button, while holding down the MODE/USER button
* Wait for the white LED to turn on (steady-state)
* Release the MODE button

The device is now in DFU mode. 🚨

## **5. Flashing an application via USB**

To upload the Conexio Stratus Pro firmware, we now have to:

* Open the terminal within the nRF Connect extension and invoke the following firmware upload command, making sure the device is in DFU mode.
* `<project_name>` replace it with your project that you have just built.

```
newtmgr -c serial image upload build/<project_name>/zephyr/zephyr.signed.bin
```

<figure><img src="/files/ITL5Z1crLFwvpDgllLoS" alt=""><figcaption></figcaption></figure>

## **5. Viewing the sample output in the terminal**

To view the data from the device in the serial terminal, you can open the nRF Serial Terminal in VS Code an select

```
dev=/dev/tty.SLAB_USBtoUART,baud=115200'
```

for macOS, it will emulate the device as such, while on the windows it will be different.

<figure><img src="/files/WrfqRF7b4Ho1yewlCvVD" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.conexiotech.com/master/building-and-programming-an-application/compiling-applications-with-nrf-connect-extension-for-vs-code.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
