Understanding Zephyr BSP for SOM-NRF9151
1. Overview
This documents provides brief description of board configuration and Zephyr demo applications for SOM-NRF9151.
2. Customized nRF Connect SDK
The Zephyr BSP for SOM-NRF9151 is based on Nordic Semiconductor nRF Connect SDK.
Emcraft maintains forks of the nRF Connect SDK, Zephyr OS and MCUboot on GitHub, where additional improvements are made for the nRF91xx and nRF5340 devices:
GitHub - EmcraftSystems/sdk-nrf
GitHub - EmcraftSystems/sdk-zephyr
GitHub - EmcraftSystems/sdk-mcuboot
The actual supported version of nRF Connect SDK can be found in the up-to-date Release Notes document:
The SDK can be installed as described in Building SOM-NRF9151 Software | 2.1. Installing the nRF Connect SDK.
3. Zephyr BSP for SOM-NRF9151
The Zephyr BSP is available at https://github.com/EmcraftSystems/som-nrf9151-app.
The repository consists of the following directories:
boards
: contains a board configuration for SOM-NRF9151.asset_tracker_v2
: customized Nordic Asset Tracker v2 application.hello_world
andhello_mcuboot
: sample “hello world“ applications.scripts
: scripts used to build SOM-NRF9151 applications and generate Release Notes.
All the applications included in the current BSP can be built as described inBuilding SOM-NRF9151 Software | 3. Building Zephyr Software.
3.1. SOM-NRF9151 Board Configuration
Emcraft supports a custom out-of-tree board configuration for SOM-NRF9151:
https://github.com/EmcraftSystems/som-nrf9151-app/tree/main/boards/emcraft/nrf9151som
The board configuration includes the following files:
board.yml
: a YAML file describing the high-level meta data for the board, such as the board name, on-board SoC, supported build variants and board revisions.Kconfig.nrf9151som
: the base software configuration, which defines the board name and selects the appropriate SoC.Kconfig.defconfig
software configuration in Configuration System (Kconfig) format. This file provides conditional default settings for software features and peripheral drivers.nrf9151som_nrf9151_ns.dts
andnrf9151som_nrf9151.dts
: hardware description files in devicetree format. These files declare the on-board SoC, connectors, and any other hardware components such as LEDs, buttons, sensors, or communication peripherals (USB, Bluetooth controller, etc). Thenrf9151som_nrf9151.dts
file is used for the secure image built with TF-M, whennrf9151som_nrf9151_ns.dts
is used for the non-secure image built with Zephyr.nrf9151som_nrf9151_common.dtsi
: “include“ file in devicetree format, which declares hardware components used by both secure and non-secure images.nrf9151som_nrf9151_common-pinctrl.dtsi
: “include“ file in devicetree format. This file defines SoC pins, used by the appropriate peripheral modules.nrf9151som_nrf9151_defconfig
andnrf9151som_nrf9151_ns_defconfig
: software configuration in Kconfig.conf
format. As with the*.dts
files,nrf9151som_nrf9151_defconfig
is used to build the secure image, andnrf9151som_nrf9151_ns_defconfig
is used for the non-secure image.nrf9151som_nrf9151.yaml
andnrf9151som_nrf9151_ns.yaml
: YAML files with miscellaneous metadata used by the Test Runner (Twister).pre_dt_board.cmake
: defines additional options for the device tree compiler.
3.2. Demo Applications for SOM-NRF9151
3.2.1. Customized Asset Tracker v2 Application
The customized Asset Tracker v2 application is based on Nordic Asset Tracker v2, which has been modified to support SOM-NRF9151 hardware. For details refer to “Understanding Customised Asset Tracker v2 Application” (Coming soon).
3.2.2. “Hello World“ Application
A sample Zephyr application that simply prints a “Hello World!“ greeting to the serial console. The console device should be enabled and selected in the device tree:
...
chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
};
...
&uart0 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};
3.2.3. “Hello MCUboot“ Application
A sample Zephyr application that simply prints a “Hello World!“ greeting to the serial console. This application also includes the following subdirectories, which are used to enable the external SPI Flash and configure the MCUboot bootloader in addition to the serial console:
boards
: contains.dts
and.conf
overlays to configure the SPI Flash.sysbuild
: contains files to configure the MCUboot bootloader, which is included into the final application binary during build.