Compiling Applications with nRF Connect Extension for VS Code

Compiling Conexio Stratus applications using nRF Connect for VSCode is the recommended method.

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

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

Once you are all set with the nRF Connect Visual Studio Code Extension Pack installation, start the extension in the VS Code.

Installing the nRF Connect Visual Studio Code Extension Pack will also install all the required dependencies.

First, Open Existing Application:

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

On the left pane, under APPLICATIONS, you should now see the ported application.

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 we can easily 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-sdkdirectory path as shown below.

/opt/nordic/ncs/v2.7.0/conexio-firmware-sdk

The above directory path will be different on the Windows and Ubuntu machines.

3. Compiling an application using nRF Connect Extension

Prior to compiling our sample application, we need to first generate the device build configuration for our project, by clicking on 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

  • (2) check the Custom boards

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

    • conexio_stratus_pro/nrf9161/nsfor the non-secure domain or

    • conexio_stratus/nrf9160/nsfor the non-secure domain.

  • (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.

Once the project is compiled successfully, in the project navigation panel, you will see all the generated files.

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

4. Setting DFU Mode (Device Firmware Upgrade)

To program the Stratus 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 now is 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 newtmgr -c serial image upload build/zephyr/app_update.bin as shown, making sure the device is in DFU mode.

Last updated