Compiling Applications with nRF Connect Extension for VS Code
Last updated
Last updated
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.
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.
You should now see the ported application under APPLICATIONS on the left pane.
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.
/opt/nordic/ncs/v2.7.0/conexio-firmware-sdk
The above directory path will be different on the Windows and Ubuntu machines.
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/ns
for Stratus Pro nRF9161
conexio_stratus_pro/nrf9151/ns
for Stratus Pro nRF9151
conexio_stratus/nrf9160/ns
for Stratus nRF9160
(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 using the nRF Connect extension.
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. 🚨
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.