Building Thingy-9151-Lite Software
- 1 1. Overview
- 2 2. Preparing Host
- 3 3. Building Zephyr Software
- 3.1 3.1. Understanding Application Specific Configuration
- 3.2 3.2. Understanding Automated Build
- 3.3 3.3. Building Thingy-9151-Lite Application for nRF9151/nRF9161
- 3.4 3.4. Building Thingy-9151-Lite Application for nRF5340 (application core)
- 3.5 3.5. Building Thingy-9151-Lite Application for nRF5340 DK (network core)
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
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.5.1 nRF Connect SDK can be found here:
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/nrf/installation/installing.html
Follow the Nordic instructions, but replace the west init...
command with the one below to use the Emcraft repositories.
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.
Note that Emcraft maintains the fork of the nRF Connect SDK on GitHub:
https://github.com/voxelbotics/sdk-nrf
Adjust the west init
command to get the branch or release tag specified in the Release Notes document, for example:
west init -m https://github.com/voxelbotics/sdk-nrf --mr voxelbotics-v2.6.1-branch
The Emcraft fork has a slightly modified manifest file
https://github.com/voxelbotics/sdk-nrf/blob/voxelbotics-v2.6.1-branch/west.yml
that refers to the Emcraft fork of the Zephyr source code on GitHub:
https://github.com/voxelbotics/sdk-zephyr
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:
GitHub - voxelbotics/nrf-app: IVE: Custom Zephyr application and board configuration
Just clone it in the same directory where west
was initialized:
git clone git@github.com:voxelbotics/nrf-app -b main
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: |
|
Tag/Revision: | 98.98-19 / fb2a8ca38312ed8acf7048c8656fb1cf8c91e62c |
Steps: |
|
0: worker_preparation |
|
1: Evaluate release tag |
|
2: Owners |
|
3: Upload ssh key |
|
4: Checkout build scripts |
|
5: Build firmware |
|
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:
nrf-app/thingy9151lite_nrf9151_app/boards/nrf9161dk_nrf9161_ns.overlay at main · voxelbotics/nrf-app
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:
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:
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
.