/
Building Thingy-9151-Lite Software

Building Thingy-9151-Lite Software

1. Overview

The instruction below explains how to prepare a Linux host and build the Zephyr BSP and application for the Emcraft Thingy-9151-Lite platform.

References:

2. Preparing Host

The application and nRF Connect SDK URLs are available as follows:

Make sure to change the remote URLs in existing local repositories accordingly.

The SDK can be also updated via west:

Go to ncs/nrf installation subdirectory git remote set-url origin https://github.com/EmcraftSystems/sdk-nrf.git git fetch origin git checkout emcraft-v2.6.1-branch west update

2.1. Installing the nRF Connect SDK

Set up the nRF Connect SDK on a Linux PC as described in the Nordic documentation for the corresponding version. The instruction for v2.6.1 nRF Connect SDK can be found here:

Technical Documentation

Note that Emcraft maintains forks of the nRF Connect SDK and Zephyr Os on GitHub where additional improvements are made for nRF9151 and nRF5340 devices:

https://github.com/EmcraftSystems/sdk-nrf

https://github.com/EmcraftSystems/sdk-zephyr

In order to use the Emcraft SDK and Zephyr forks adjust the SDK initialization command from the SDK installation document as follows:

west init -m https://github.com/EmcraftSystems/sdk-nrf --mr emcraft-v2.6.1-branch west update

The actual branch or release tag for the above command can be found in the last Release Notes document:

There is a known pitfall with installing the python dependencies using pip: upgrading the cryptography package may result in a non-working pip:

For folks curious about the breakage: cryptography 42.0.0 removed this X509_V_FLAG_NOTIFY_POLICY flag: pyca/cryptography@654dccb pyOpenSSL 23.2.0 stopped referencing this X509_V_FLAG_NOTIFY_POLICY flag: pyca/pyopenssl@d788a4f So, you'll only run into this issue if you're running cryptography >= 42.0.0, and pyOpenSSL < 23.2.0

Either ensure pyOpenSSL is upgraded before cryptography (there is no automatic dependency, so manually upgrade pyOpenSSL before pulling the bulk of the dependencies), or comment out the offending line to restore pip to the working state, then upgrade pyOpenSSL. Reinstall cryptography if necessary.

2.2. Getting the Source Code of the Thingy-9151-Lite Application

The Thingy-9151-Lite Zephyr application is maintained in the separate GitHub repository:

https://github.com/emcraftsystems/nrf-app

Just clone it in the same directory where west was initialized:

The current branch and release tag are specified in the Release Notes document.

3. Building Zephyr Software

3.1. Understanding Application Specific Configuration

Every application directory contains the config.h header file with various configuration parameters specific to the application.

During the nightly and release build, Buildbot adjusts some parameters, including the software version, the software build number and type (either debug or release):

Both debug and release images are created on every build (with different CONFIG_BUILD_DEBUG settings).

3.2. Understanding Automated Build

Emcraft maintains the Buildbot based automated build of the Thingy-9151-Lite Application, which is triggered by every change in the application repository. The subscribers receive an email from the Buildbot containing the references to the pre-built application binaries that can be downloaded from a cloud, for example:

Build status:

  • SUCCESS

Tag/Revision:

98.98-19 / fb2a8ca38312ed8acf7048c8656fb1cf8c91e62c

Steps:

 

0: worker_preparation

  • SUCCESS

1: Evaluate release tag

  • SUCCESS

2: Owners

  • SUCCESS

3: Upload ssh key

  • SUCCESS

4: Checkout build scripts

  • SUCCESS

5: Build firmware

  • SUCCESS

Files:

 

Image #1: thingy9151lite_nrf9151_app_on_nrf9161dk_v98.98-19-05212235_release.hex

Image #2: thingy9151lite_nrf9151_app_on_nrf9161dk_v98.98-19-05212235_debug.hex

Image #3: thingy9151lite_nrf5340_cpuapp_app_on_nrf5340dk_v98.98-19-05212235_release.hex

Image #4: thingy9151lite_nrf5340_cpuapp_app_on_nrf5340dk_v98.98-19-05212235_debug.hex

Image #5: thingy9151lite_nrf5340_cpunet_app_on_nrf5340dk_v98.98-19-05212235_release.hex

Image #6: thingy9151lite_nrf5340_cpunet_app_on_nrf5340dk_v98.98-19-05212235_debug.hex

Note that both debug (CONFIG_BUILD_DEBUG=1) and release (CONFIG_BUILD_DEBUG=0) images are generated for each application/board pair.

3.3. Building Thingy-9151-Lite Application for nRF9151/nRF9161

Go to the application directory:

The Nordic nRF9161 DK board is already supported in Zephyr, so it is configured using the devicetree overlay:

https://github.com/voxelbotics/nrf-app/blob/main/thingy9151lite_nrf9151_app/boards/nrf9161dk_nrf9161_ns.overlay

Build the application for nRF9161 DK using the following command:

The nRF9161 portion of the Emcraft Thingy-9151-Lite hardware kit is using the out-of-tree board configuration:

https://github.com/voxelbotics/nrf-app/blob/main/boards/arm/thingy9151lite_nrf9161

Build the application for the nRF9161 SiP of the Emcraft Thingy-9151-Lite hardware kit using the following command:

The resulting image is build/zephyr/merged.hex.

3.4. Building Thingy-9151-Lite Application for nRF5340 (application core)

Go to the application directory:

The Nordic nRF5340 DK board is already supported in Zephyr, so it is configured using the devicetree overlay:

https://github.com/voxelbotics/nrf-app/blob/main/thingy9151lite_nrf5340_cpuapp_app/boards/nrf5340dk_nrf5340_cpuapp_ns.overlay

Build the application for nRF5340 DK using the following command:

The nRF5340 portion of the Emcraft Thingy-9151-Lite hardware kit is using the out-of-tree board configuration:

https://github.com/voxelbotics/nrf-app/tree/main/boards/arm/thingy9151lite_nrf5340

Build the application for the nRF5340 application core of the Emcraft Thingy-9151-Lite hardware kit using the following command:

The resulting image is build/zephyr/merged.hex.

3.5. Building Thingy-9151-Lite Application for nRF5340 DK (network core)

Go to the application directory:

The Nordic nRF5340 DK board is already supported in Zephyr, so it is configured using the devicetree overlay:

https://github.com/voxelbotics/nrf-app/blob/main/thingy9151lite_nrf5340_cpunet_app/boards/nrf5340dk_nrf5340_cpunet.overlay

Build the application for nRF5340 DK using the following command:

The nRF5340 portion of the Emcraft Thingy-9151-Lite hardware kit is using the out-of-tree board configuration:

https://github.com/voxelbotics/nrf-app/tree/main/boards/arm/thingy9151lite_nrf5340

Build the application for the nRF5340 network core of the Emcraft Thingy-9151-Lite hardware kit using the following command:

The resulting image is build/zephyr/zephyr.hex.

 

Related content

Developing Zephyr BSP and Application Using Nordic Cross Tools (based on nRF Connect SDK 2.5.1)
Developing Zephyr BSP and Application Using Nordic Cross Tools (based on nRF Connect SDK 2.5.1)
More like this
Installing Thingy-9151-Lite Images
Installing Thingy-9151-Lite Images
More like this
Using Serial Console and Zephyr Shell
Using Serial Console and Zephyr Shell
Read with this
Developing Zephyr BSP and Application Using Nordic Cross Tools (using nRF Connect SDK 2.6.1)
Developing Zephyr BSP and Application Using Nordic Cross Tools (using nRF Connect SDK 2.6.1)
More like this
Setting Up Thingy-9151-Lite Hardware Platform
Setting Up Thingy-9151-Lite Hardware Platform
Read with this