Pre-built libraries

The nRF Connect SDK provides a set of OpenThread pre-built libraries. These pre-built libraries are available in nrfxlib and provide features and optional functionalities from the OpenThread stack. You can use these libraries for building applications with support for the complete Thread Specification.

To use a pre-built library, configure OpenThread to use pre-built libraries by setting the CONFIG_OPENTHREAD_LIBRARY Kconfig option and select one of the provided Feature sets.

Feature sets

A feature set defines a combination of OpenThread features for a specific use case.

These feature sets are mainly used for pre-built libraries, but you can also use them when you build your application libraries from source. The nRF Connect SDK provides the following feature sets:

The following table lists the supported features for each of these sets. No tick indicates that there is no support for the given feature in the related configuration, while the tick signifies that the feature is selected (=1 value). Features introduced with the Thread 1.2 Specification are at the bottom of the table and have “Thread 1.2” in parenthesis after the feature name. For more information about Thread 1.2 features, see the Thread 1.2 Base Features document.

OpenThread feature

Master

FTD

MTD

Custom

BORDER_AGENT

BORDER_ROUTER

CHILD_SUPERVISION

COAP

COAPS

COMMISSIONER

DIAGNOSTIC

DNS_CLIENT

DHCP6_SERVER

DHCP6_CLIENT

ECDSA

IP6_FRAGM

JAM_DETECTION

JOINER

LINK_RAW

MAC_FILTER

MTD_NETDIAG

SERVICE

SLAAC

SNTP_CLIENT

SRP_CLIENT

UDP_FORWARD

BACKBONE_ROUTER (Thread 1.2)

CSL_RECEIVER (Thread 1.2)

DUA (Thread 1.2)

LINK_METRICS_INITIATOR (Thread 1.2)

LINK_METRICS_SUBJECT (Thread 1.2)

MLR (Thread 1.2)

For the full list of configuration options that were used during compilation, including their default values, see the openthread_lib_configuration.txt file within each library folder in the nrfxlib repository.

Customizing pre-built libraries

Selecting a feature set allows you to use the respective OpenThread features in your application. You might need to customize some configuration options to fit your use case though.

Be aware of the following limitations when customizing the configuration of a pre-built library:

  • You can only update configuration options that are configurable at run time. If you change any options that are compiled into the library, your changes will be ignored.

  • Changes to the configuration might impact the certification status of the pre-built libraries. See Thread certification options for more information.

The following list shows some of the configuration options that you might want to customize:

Updating pre-built OpenThread libraries

You can update the OpenThread pre-built libraries in nrfxlib when using any Thread sample if you configure the sample to build the OpenThread stack from source with CONFIG_OPENTHREAD_SOURCES. Use this functionality for certification of your configuration of the OpenThread libraries, for example.

You can install the libraries either with or without debug symbols. Installing the libraries with debug symbols can be useful when debugging, but will take a significant amount of storage memory. You can remove the symbols when updating with the CONFIG_OPENTHREAD_BUILD_OUTPUT_STRIPPED Kconfig option enabled. The option is disabled by default.

Note

When you select CONFIG_OPENTHREAD_USER_CUSTOM_LIBRARY, the location of the destination directory for the libraries depends on the chosen nrf_security backend, either CONFIG_CC3XX_BACKEND or CONFIG_OBERON_BACKEND.

Updating the libraries without debug symbols

There is a single command to update the libraries without debug symbols. When using the command line, run the command in the project folder. When using the nRF Connect for VS Code extension, open a terminal and choose nRF Terminal, then run the command there.

Use the following command:

west build -b nrf52840dk_nrf52840 -t install_openthread_libraries -- -DOPENTHREAD_BUILD_OUTPUT_STRIPPED=y

This command builds two versions of the libraries, with and without debug symbols, and installs only the version without debug symbols. This command also builds the sample on the specified board. Make sure that the board you mention is compatible with the chosen sample. The CONFIG_OPENTHREAD_BUILD_OUTPUT_STRIPPED Kconfig option will be disabled again after this command completes.

Updating the libraries with debug symbols

There is a single command to update the libraries with debug symbols. When using the command line, run the command in the project folder. When using the nRF Connect for VS Code extension, open a terminal and choose nRF Terminal, then run the command there.

Use the following command:

west build -b nrf52840dk_nrf52840 -t install_openthread_libraries

This command also builds the sample on the specified board. Make sure that the board you mention is compatible with the chosen sample.