nRF5 SDK for Thread and Zigbee v3.1.0
OpenThread libraries

Table of Contents

The nRF5 SDK for Thread includes a pre-built OpenThread stack. It is provided as binary libraries in UART, SPI, and USB variants, with UART being the default one. These Thread libraries contain numerous features not required by the Thread specification. They are meant to showcase the potential of OpenThread on Nordic's platforms.

If you want to build your own project, you must include all of the mandatory libraries and can add some of the optional libraries. The libraries for both nRF52840 and nRF52811 SoCs can be found at the following path: <InstallFolder>/external/openthread/lib. Currently, libraries for GCC, IAR, and Keil 5 are provided.

Note
The pre-built OpenThread libraries do not support DHCPv6 Client/Server.

Refer to the release notes for the ID of the OpenThread commit that has been used both for generating the pre-built Thread stack libraries and for testing and verification. You can also compile the latest version of the libraries from GitHub on your own. See Building the latest OpenThread libraries for details.

Refer to API for detailed API reference for the libraries.

Mandatory libraries

Mandatory OpenThread libraries are different for nRF52840 and nRF52811 SoCs.

nRF52840 mandatory libraries

The following table lists mandatory libraries for nRF52840. Where multiple files are mentioned, choose only one, depending on your configuration.

nRF52840 supports the FTD, MTD, and Radio OpenThread stack variants.

GCC and IAR nRF52840 libraries come in two variants:

Name Description
- libopenthread-ftd.a
- libopenthread-mtd.a
- libopenthread-radio.a
OpenThread’s Thread stack implementation of the Full Thread Device (FTD), the Minimal Thread Device (MTD), or the radio-only (RCP) library, respectively.
libmbedcrypto.a mbed TLS SSL library with support for operations used by OpenThread: ECC, SHA-256, and AES ECB. Available with ARM CryptoCell support for hardware acceleration.
- libopenthread-nrf52840-sdk.a
- libopenthread-nrf52840-sdk-usb.a
- libopenthread-nrf52840-sdk-spi.a
- libopenthread-nrf52840-softdevice-sdk.a
- libopenthread-nrf52840-softdevice-sdk-usb.a
- libopenthread-nrf52840-softdevice-sdk-spi.a
OpenThread’s platform implementation library for serial communication through UART, USB, or SPI (with NCP or NCP Radio), respectively, for single PHY or multiprotocol operation. Multiprotocol support is indicated by softdevice in the name.
libopenthread-platform-utils.a OpenThread’s platform util that contains the flash manager library.
- libnordicsemi-nrf52840-radio-driver.a
- libnordicsemi-nrf52840-radio-driver-softdevice.a
OpenThread's IEEE802.15.4 radio driver library for single PHY or multiprotocol operation. Multiprotocol support is indicated by softdevice in the name.

nRF52811 mandatory libraries

The following table lists mandatory libraries for nRF52811. Where multiple files are mentioned, choose only one, depending on your configuration.

nRF52811 supports the MTD and Radio OpenThread stack variants.

Name Description
- libopenthread-mtd.a
- libopenthread-radio.a
OpenThread’s Thread stack implementation of the Full Thread Device (FTD) or the radio-only library, respectively.
libmbedcrypto.a mbed TLS SSL library with support for operations used by OpenThread: ECC, SHA-256, and AES ECB.
Software only – nRF52811 does not support CryptoCell.
- libopenthread-nrf52811-sdk.a
- libopenthread-nrf52811-sdk-spi.a
OpenThread’s platform implementation library for serial communication through UART or SPI (with NCP or NCP Radio), respectively.
libopenthread-platform-utils.a OpenThread’s platform util that contains the flash manager library.
libnordicsemi-nrf52811-radio-driver.a OpenThread's IEEE802.15.4 radio driver library for single PHY operation.

Optional libraries

The optional OpenThread libraries are different for each available configuration: FTD, MTD, or Radio. See the Description column for more information.

FTD MTD Radio Description
libopenthread-cli-ftd.a libopenthread-cli-mtd.a - Command Line Interface (CLI) library for UART or USB CDC transport.
libopenthread-ncp-ftd.a libopenthread-ncp-mtd.a libopenthread-ncp-radio.a Network Co-Processor (NCP) library for UART or USB CDC transport.
libopenthread-ncp-ftd-spi.a libopenthread-ncp-mtd-spi.a libopenthread-ncp-radio-spi.a Network Co-Processor (NCP) library for SPI transport.
libopenthread-diag.a libopenthread-diag.a - OpenThread’s diagnostic module library.
Optional FTD and MTD libraries

ARM CryptoCell support

CryptoCell hardware is present only in nRF52840.

This SDK provides a precompiled version of the hardware-accelerated mbed TLS library (libmbedcrypto.a) that uses the ARM CryptoCell technology, which can be used with OpenThread. For more information, see CryptoCell library.

The CryptoCell library is used by OpenThread to accelerate cryptographic operations (AES-EBC, ECJ-PAKE, and SHA256) in mbed TLS library. The application can still use it when called from the same context as OpenThread (main context in bare-metal applications, or the same thread in RTOS apllications).

Note
The hardware-accelerated version library is not thread-safe – do not use it from multiple threads or interrupt service routines. For concurrent access to cryptographic functions, use the software variant located inside the mtls_ts directory instead.

IEEE EUI-64 address

When the Thread device is configured to obtain the Thread Network security credentials with either Thread Commissioning or an out-of-band method, the extended MAC address should be constructed out of the globally unique IEEE EUI-64. This must be done before Building the latest OpenThread libraries.

The IEEE EUI-64 address consists of two parts:

By default, the device uses Nordic Semiconductor's MA-L (f4-ce-36). You can modify it by overwriting the OPENTHREAD_CONFIG_STACK_VENDOR_OUI define in openthread-core-nrf52840-config.h or openthread-core-nrf52811-config.h. This value must be publicly registered by the IEEE Registration Authority.

You can also provide the full IEEE EUI-64 address by providing a custom otPlatRadioGetIeeeEui64 function. To do this, define the flag OPENTHREAD_CONFIG_ENABLE_PLATFORM_EUI64_CUSTOM_SOURCE.

After the Thread Network security credentials have been successfully obtained, the device uses randomly generated extended MAC address.


Documentation feedback | Developer Zone | Subscribe | Updated