Compiling Applications with nRF Connect Extension for VS Code

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.

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.

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.x.0/conexio-firmware-sdk/samples/conexio_stratus). Select a sample application and click Open.

Browse the sampe application

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

For NCS v2.7.0

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

Board Roots for NCS v2.7.0

For NCS v2.9.0

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

Board Root for NCS v2.9.0

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 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

  • (2) check the Custom boards

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

    • conexio_stratus_pro/nrf9161/nsfor Stratus Pro nRF9161

    • conexio_stratus_pro/nrf9151/nsfor Stratus Pro nRF9151

    • conexio_stratus/nrf9160/nsfor Stratus nRF9160

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

Adding build configuration for NCS v2.7.0
Conexio Board Targets

Note for NCS v2.9.0: to generate the app_update.bin, select No sysbuild under System build (sysbuild) option as shown below.

No sysbuild config for NCS v2.9.0

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

Application Build In Progress

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 app_update.bin, located in your app directory -> build/zephyr/app_update.bin.

Application Compiled Successfully

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

Uploading the Firmware to the Device

Last updated

Was this helpful?