Skip to content

Commit b6e5d8e

Browse files
doc: openthread: Describe nRF radio implementation
Updated the architectures and configuration pages in nrf documentation to describe the new OpenThread radio platform implementation which does not use Zephyr L2 networking layer. Updated OpenThread samples README files to mention both configuration and new snippets. Signed-off-by: Arkadiusz Balys <[email protected]>
1 parent a1c8074 commit b6e5d8e

File tree

13 files changed

+2713
-58
lines changed

13 files changed

+2713
-58
lines changed

doc/nrf/protocols/thread/configuring.rst

Lines changed: 111 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,21 @@ Thread requires the following Zephyr modules to properly operate in the |NCS|:
3636
Enable OpenThread in the |NCS|
3737
==============================
3838

39-
To use the Thread protocol in the |NCS|, set the following Kconfig options:
39+
You can use the Thread protocol in the |NCS| in two ways: by utilizing the Zephyr networking layer, or by passing Thread frames directly to the nRF 802.15.4 radio driver.
40+
41+
* To use the Thread protocol with Zephyr networking layer, enable the following Kconfig options:
42+
43+
* :kconfig:option:`CONFIG_NETWORKING` - This option enables a generic link layer and the IP networking support.
44+
* :kconfig:option:`CONFIG_NET_L2_OPENTHREAD` - This option enables the OpenThread stack required for operating the Thread protocol effectively.
45+
46+
* To use the Thread protocol and nRF 802.15.4 radio directly, disable the previous Kconfig options, and enable the following:
47+
48+
* :kconfig:option:`CONFIG_OPENTHREAD` - This option enables the OpenThread stack, allowing the direct use of the nRF 802.15.4 radio.
49+
50+
To learn more about available architectures, see the :ref:`openthread_stack_architecture` user guide.
51+
52+
Additionally, you can set the following Kconfig options:
4053

41-
* :kconfig:option:`CONFIG_NETWORKING` - This option enables the generic link layer and the IP networking support.
42-
* :kconfig:option:`CONFIG_NET_L2_OPENTHREAD` - This option enables the OpenThread stack required for the correct operation of the Thread protocol and allows you to use it.
4354
* :kconfig:option:`CONFIG_MPSL` - This option enables the :ref:`nrfxlib:mpsl` (MPSL) implementation, which provides services for both :ref:`single-protocol and multi-protocol implementations <ug_thread_architectures>`.
4455
This is automatically set for all samples in the |NCS| that use the :ref:`zephyr:ieee802154_interface` radio driver.
4556

@@ -81,6 +92,7 @@ Depending on your configuration needs, you can also set the following options:
8192

8293
* :kconfig:option:`CONFIG_NET_SOCKETS` - This option enables API similar to BSD Sockets on top of the native Zephyr networking API.
8394
This configuration is needed for managing networking protocols.
95+
This configuration is available only if Zephyr networking layer is enabled.
8496
* :kconfig:option:`CONFIG_OPENTHREAD_SHELL` - This option enables OpenThread CLI (see `OpenThread CLI Reference`_).
8597
* :kconfig:option:`CONFIG_COAP` - This option enables Zephyr's :ref:`zephyr:coap_sock_interface` support.
8698
* :kconfig:option:`CONFIG_COAP_UTILS` - This option enables the :ref:`CoAP utils library <coap_utils_readme>`.
@@ -94,6 +106,7 @@ See the following files for more options that you might want to change:
94106

95107
* :file:`zephyr/subsys/net/l2/openthread/Kconfig.features` - OpenThread stack features.
96108
* :file:`zephyr/subsys/net/l2/openthread/Kconfig.thread` - Thread network configuration options.
109+
* :file:`nrf/modules/openthread/Kconfig.features.nrf` - Thread network configuration dedicated to nRF Connect purposes.
97110

98111
.. note::
99112
You can find the default configuration for all :ref:`openthread_samples` in the :file:`nrf/subsys/net/openthread/Kconfig.defconfig` file.
@@ -158,56 +171,116 @@ An IEEE EUI-64 address consists of two parts:
158171
* Company ID - a 24-bit MA-L (MAC Address Block Large), formerly called OUI (Organizationally Unique Identifier)
159172
* Extension identifier - a 40-bit device unique identifier
160173

161-
You can configure the EUI-64 for a device in the following ways:
174+
You can configure the EUI-64 for a device in the following ways depending on chosen architecture:
175+
176+
.. tabs::
177+
178+
.. tab:: Zephyr networking layer enabled
179+
180+
Use the default
181+
By default, the company ID is set to Nordic Semiconductor's MA-L (``f4-ce-36``).
182+
The extension identifier is set to the DEVICEID from the factory information configuration registers (FICR).
183+
184+
Replace the company ID
185+
You can enable the :kconfig:option:`CONFIG_IEEE802154_VENDOR_OUI_ENABLE` Kconfig option to replace Nordic Semiconductor's company ID with your own company ID.
186+
Specify your company ID in :kconfig:option:`CONFIG_IEEE802154_VENDOR_OUI`.
187+
188+
The extension identifier is set to the default, namely the DEVICEID from FICR.
189+
190+
Replace the full EUI-64
191+
You can provide the full EUI-64 value by programming certain user information configuration registers (UICR).
192+
nRF52 Series devices use the CUSTOMER registers block, while nRF53 Series devices use the OTP registers block
193+
194+
To use the EUI-64 value from the UICR, enable the :kconfig:option:`CONFIG_NRF5_UICR_EUI64_ENABLE` Kconfig option and set :kconfig:option:`CONFIG_NRF5_UICR_EUI64_REG` to the base of the two consecutive registers that contain your EUI-64 value.
195+
196+
The following example shows how to replace the full EUI-64 on the nRF52840 device:
197+
198+
1. Enable the :kconfig:option:`CONFIG_IEEE802154_NRF5_UICR_EUI64_ENABLE` Kconfig option.
199+
200+
#. Specify the offset for the UICR registers in :kconfig:option:`CONFIG_IEEE802154_NRF5_UICR_EUI64_REG`.
201+
This example uses UICR->CUSTOMER[0] and UICR->CUSTOMER[1], which means that you can keep the default value ``0``.
202+
203+
#. Build and program your application erasing the whole memory.
204+
Make sure to replace *serial_number* with the serial number of your debugger:
205+
206+
.. parsed-literal::
207+
:class: highlight
208+
209+
west build -b nrf52840dk/nrf52840 -p always
210+
west flash --snr *serial_number* --erase
211+
212+
#. Program the registers UICR->CUSTOMER[0] and UICR->CUSTOMER[1] with your EUI-64 value (replace *serial_number* with the serial number of your debugger):
213+
214+
.. parsed-literal::
215+
:class: highlight
216+
217+
nrfutil device x-write --serial-number *serial_number* --address 0x10001080 --value 0x11223344
218+
nrfutil device x-write --serial-number *serial_number* --address 0x10001084 --value 0x55667788
219+
nrfutil device reset --reset-kind=RESET_PIN
220+
221+
If you used a different value for :kconfig:option:`CONFIG_IEEE802154_NRF5_UICR_EUI64_REG`, you must use different register addresses.
222+
223+
At the end of the configuration process, you can check the EUI-64 value using OpenThread CLI:
224+
225+
.. code-block:: console
226+
227+
uart:~$ ot eui64
228+
8877665544332211
229+
Done
230+
231+
.. tab:: Zephyr networking layer disabled
232+
233+
Use the default
234+
By default, the company ID is set to Nordic Semiconductor's MA-L (``f4-ce-36``).
235+
The extension identifier is set to the DEVICEID from the factory information configuration registers (FICR).
236+
237+
Replace the company ID
238+
You can enable the :kconfig:option:`CONFIG_IEEE802154_VENDOR_OUI_ENABLE` Kconfig option to replace Nordic Semiconductor's company ID with your own company ID.
239+
Specify your company ID in :kconfig:option:`CONFIG_NRF5_VENDOR_OUI`.
240+
241+
The extension identifier is set to the default, namely the DEVICEID from FICR.
162242

163-
Use the default
164-
By default, the company ID is set to Nordic Semiconductor's MA-L (``f4-ce-36``).
165-
The extension identifier is set to the DEVICEID from the factory information configuration registers (FICR).
243+
Replace the full EUI-64
244+
You can provide the full EUI-64 value by programming certain user information configuration registers (UICR).
245+
nRF52 Series devices use the CUSTOMER registers block, while nRF53 Series devices use the OTP registers block.
166246

167-
Replace the company ID
168-
You can enable :kconfig:option:`CONFIG_IEEE802154_VENDOR_OUI_ENABLE` to replace Nordic Semiconductor's company ID with your own company ID.
169-
Specify your company ID in :kconfig:option:`CONFIG_IEEE802154_VENDOR_OUI`.
247+
To use the EUI-64 value from the UICR, enable the :kconfig:option:`CONFIG_NRF5_UICR_EUI64_ENABLE` Kconfig option and set :kconfig:option:`CONFIG_NRF5_UICR_EUI64_REG` to the base of the two consecutive registers that contain your EUI-64 value.
170248

171-
The extension identifier is set to the default, namely the DEVICEID from FICR.
249+
The following example shows how to replace the full EUI-64 on the nRF52840 device:
172250

173-
Replace the full EUI-64
174-
You can provide the full EUI-64 value by programming certain user information configuration registers (UICR).
175-
For nRF52 Series devices, the CUSTOMER registers block is used.
176-
For nRF53 Series devices, the OTP registers block is used.
251+
1. Enable the :kconfig:option:`CONFIG_NRF5_UICR_EUI64_ENABLE` Kconfig option.
177252

178-
To use the EUI-64 value from the UICR, enable :kconfig:option:`CONFIG_IEEE802154_NRF5_UICR_EUI64_ENABLE` and set :kconfig:option:`CONFIG_IEEE802154_NRF5_UICR_EUI64_REG` to the base of the two consecutive registers that contain your EUI-64 value.
253+
#. Specify the offset for the UICR registers in :kconfig:option:`CONFIG_NRF5_UICR_EUI64_REG`.
254+
This example uses UICR->CUSTOMER[0] and UICR->CUSTOMER[1], which means that you can keep the default value ``0``.
179255

180-
The following example shows how to replace the full EUI-64 on an nRF52840 device:
256+
#. Build and program your application erasing the whole memory.
257+
Make sure to replace *serial_number* with the serial number of your debugger:
181258

182-
1. Enable :kconfig:option:`CONFIG_IEEE802154_NRF5_UICR_EUI64_ENABLE`.
183-
#. Specify the offset for the UICR registers in :kconfig:option:`CONFIG_IEEE802154_NRF5_UICR_EUI64_REG`.
184-
This example uses UICR->CUSTOMER[0] and UICR->CUSTOMER[1], which means that you can keep the default value ``0``.
185-
#. Build and program your application erasing the whole memory (replace *serial_number* with the serial number of your debugger):
259+
.. parsed-literal::
260+
:class: highlight
186261
187-
.. parsed-literal::
188-
:class: highlight
262+
west build -b nrf52840dk/nrf52840 -p always
263+
west flash --snr *serial_number* --erase
189264
190-
west build -b nrf52840dk/nrf52840 -p always
191-
west flash --snr *serial_number* --erase
265+
#. Program the registers UICR->CUSTOMER[0] and UICR->CUSTOMER[1] with your EUI-64 value (replace *serial_number* with the serial number of your debugger):
192266

193-
#. Program the registers UICR->CUSTOMER[0] and UICR->CUSTOMER[1] with your EUI-64 value (replace *serial_number* with the serial number of your debugger):
267+
.. parsed-literal::
268+
:class: highlight
194269
195-
.. parsed-literal::
196-
:class: highlight
270+
nrfutil device x-write --serial-number *serial_number* --address 0x10001080 --value 0x11223344
271+
nrfutil device x-write --serial-number *serial_number* --address 0x10001084 --value 0x55667788
272+
nrfutil device reset --reset-kind=RESET_PIN
197273
198-
nrfutil device x-write --serial-number *serial_number* --address 0x10001080 --value 0x11223344
199-
nrfutil device x-write --serial-number *serial_number* --address 0x10001084 --value 0x55667788
200-
nrfutil device reset --reset-kind=RESET_PIN
274+
If you used a different value for :kconfig:option:`CONFIG_NRF5_UICR_EUI64_REG`, you must use different register addresses.
201275

202-
If you used a different value for :kconfig:option:`CONFIG_IEEE802154_NRF5_UICR_EUI64_REG`, you must use different register addresses.
276+
At the end of the configuration process, you can check the EUI-64 value using OpenThread CLI:
203277

204-
At the end of the configuration process, you can check the EUI-64 value using OpenThread CLI:
278+
.. code-block:: console
205279
206-
.. code-block:: console
280+
uart:~$ ot eui64
281+
8877665544332211
282+
Done
207283
208-
uart:~$ ot eui64
209-
8877665544332211
210-
Done
211284
212285
.. _ug_thread_configuring_crypto:
213286

@@ -232,6 +305,7 @@ The `Mbed TLS`_ protocol features can be handled using the :kconfig:option:`OPEN
232305
The :kconfig:option:`OPENTHREAD_MBEDTLS_CHOICE` Kconfig option has not been tested and is not recommended for use with the |NCS|.
233306

234307
For more information about the open source Mbed TLS implementation in the |NCS|, see the `sdk-mbedtls`_ repository.
308+
For more information about the OpenThread security in |NCS|, see the :ref:`ug_ot_thread_security` page.
235309

236310
.. _ug_thread_configure_commission:
237311

doc/nrf/protocols/thread/overview/architectures.rst

Lines changed: 110 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,35 @@ This can be done per platform, while retaining the ability to default to a stand
2828

2929
OpenThread architecture adapted from `openthread.io <OpenThread system architecture_>`_
3030

31+
|NCS| provides two different architecture options for OpenThread.
32+
The first one uses Zephyr networking layer to communicate OpenThread stack with the IEEE 802.15.4 radio driver.
33+
The second one uses the OpenThread stack directly to communicate with the IEEE 802.15.4 radio driver.
34+
35+
To learn more about the differences between the two architectures, see the following table:
36+
37+
.. list-table:: Thread architecture options
38+
:widths: auto
39+
:header-rows: 1
40+
41+
* - Integration with Zephyr networking layer
42+
- Direct IEEE 802.15.4 radio integration with OpenThread stack
43+
* - Uses Zephyr networking layer to communicate OpenThread stack with the IEEE 802.15.4 radio driver.
44+
- Uses the OpenThread stack directly to communicate with the IEEE 802.15.4 radio driver.
45+
* - Integrates Zephyr networking features, such as Sockets, IPv6, DNS, DHCPv6, zperf, and more.
46+
- Uses the Openthread networking features.
47+
* - Implements the Zephyr IEEE 802.15.4 radio driver and PHY layer in Zephyr.
48+
- Uses the nRF5 radio driver directly.
49+
* - Uses the Zephyr BSD Socket API to communicate with the application layer.
50+
- Uses the OpenThread BSD API to communicate with the application layer.
51+
* - CoAP and MQTT application layer Zephyr implementations available.
52+
- CoAP application layer OpenThread implementation available.
53+
* - More complex to implement and debug.
54+
- More lightweight and easier to implement and debug.
55+
* - More memory and flash usage.
56+
- Less memory and flash usage.
57+
58+
To learn how to choose the architecture option that best fits your needs, see the :ref:`ug_thread_configuring_basic` user guide.
59+
3160
.. _ug_thread_architectures_designs_soc_designs:
3261

3362
System-on-Chip designs
@@ -60,15 +89,33 @@ It has the following disadvantages:
6089
* The application and the network share flash and RAM space, which can limit the application functionality.
6190
* Might require external flash for DFU if the secondary application slot does not fit in the primary memory because of increased application size.
6291

63-
.. figure:: images/thread_platform_design_soc.svg
64-
:alt: Thread-only architecture (nRF52, nRF54L)
92+
Depending on integration with the Zephyr networking layer, there are two different designs:
93+
94+
.. tabs::
95+
96+
.. group-tab:: Integration with Zephyr networking layer
97+
98+
.. figure:: images/thread_platform_design_soc.svg
99+
:alt: Thread-only architecture (nRF52, nRF54L)
100+
101+
Thread-only architecture on nRF52 Series and nRF54L Series devices
102+
103+
.. figure:: images/thread_platform_design_nRF53.svg
104+
:alt: Thread-only architecture (nRF53)
105+
106+
Thread-only architecture on nRF53 Series devices
107+
108+
.. group-tab:: Direct IEEE 802.15.4 radio integration with OpenThread stack
65109

66-
Thread-only architecture on nRF52 Series and nRF54L Series devices
110+
.. figure:: images/thread_platform_design_soc_direct.svg
111+
:alt: Thread-only architecture (nRF52, nRF54L)
67112

68-
.. figure:: images/thread_platform_design_nRF53.svg
69-
:alt: Thread-only architecture (nRF53)
113+
Thread-only architecture on nRF52 Series and nRF54L Series devices
70114

71-
Thread-only architecture on nRF53 Series devices
115+
.. figure:: images/thread_platform_design_nRF53_direct.svg
116+
:alt: Thread-only architecture (nRF53)
117+
118+
Thread-only architecture on nRF53 Series devices
72119

73120
This platform design is suitable for the following development kits:
74121

@@ -94,15 +141,34 @@ It has the following disadvantages:
94141

95142
* Bluetooth LE activity can degrade the connectivity on Thread if not implemented with efficiency in mind.
96143

97-
.. figure:: images/thread_platform_design_multi.svg
98-
:alt: Multiprotocol Thread and Bluetooth LE architecture (nRF52, nRF54L)
144+
Depending on integration with the Zephyr networking layer, there are two different designs:
145+
146+
.. tabs::
147+
148+
.. group-tab:: Integration with Zephyr networking layer
149+
150+
.. figure:: images/thread_platform_design_multi.svg
151+
:alt: Multiprotocol Thread and Bluetooth LE architecture (nRF52, nRF54L)
152+
153+
Multiprotocol Thread and Bluetooth LE architecture on nRF52 Series and nRF54L Series devices
154+
155+
.. figure:: images/thread_platform_design_nRF53_multi.svg
156+
:alt: Multiprotocol Thread and Bluetooth LE architecture (nRF53)
157+
158+
Multiprotocol Thread and Bluetooth LE architecture on nRF53 Series devices
99159

100-
Multiprotocol Thread and Bluetooth LE architecture on nRF52 Series and nRF54L Series devices
160+
.. group-tab:: Direct IEEE 802.15.4 radio integration with OpenThread stack
101161

102-
.. figure:: images/thread_platform_design_nRF53_multi.svg
103-
:alt: Multiprotocol Thread and Bluetooth LE architecture (nRF53)
162+
.. figure:: images/thread_platform_design_multi_direct.svg
163+
:alt: Multiprotocol Thread and Bluetooth LE architecture (nRF52, nRF54L)
164+
165+
Multiprotocol Thread and Bluetooth LE architecture on nRF52 Series and nRF54L Series devices
166+
167+
.. figure:: images/thread_platform_design_nRF53_multi_direct.svg
168+
:alt: Multiprotocol Thread and Bluetooth LE architecture (nRF53)
169+
170+
Multiprotocol Thread and Bluetooth LE architecture on nRF53 Series devices
104171

105-
Multiprotocol Thread and Bluetooth LE architecture on nRF53 Series devices
106172

107173
For more information about the multiprotocol feature, see :ref:`ug_multiprotocol_support`.
108174

@@ -149,10 +215,23 @@ It has the following disadvantages:
149215

150216
* This is a more expensive option, because it requires a host processor for the application.
151217

152-
.. figure:: images/thread_platform_design_ncp.svg
153-
:alt: Network co-processor architecture
218+
Depending on integration with the Zephyr networking layer, there are two different designs:
219+
220+
.. tabs::
221+
222+
.. group-tab:: Integration with Zephyr networking layer
223+
224+
.. figure:: images/thread_platform_design_ncp.svg
225+
:alt: Network co-processor architecture
226+
227+
Network co-processor architecture
228+
229+
.. group-tab:: Direct IEEE 802.15.4 radio integration with OpenThread stack
154230

155-
Network co-processor architecture
231+
.. figure:: images/thread_platform_design_ncp_direct.svg
232+
:alt: Network co-processor architecture
233+
234+
Network co-processor architecture
156235

157236
.. note::
158237
|connection_options_limited|
@@ -178,10 +257,23 @@ It has the following disadvantages:
178257
* The host processor must be woken up on each received frame, even if a frame must be forwarded to the neighboring device.
179258
* The RCP solution can be less responsive than the NCP solution, due to the fact that each frame or command must be communicated to the host processor over the serial link.
180259

181-
.. figure:: images/thread_platform_design_rcp.svg
182-
:alt: Radio co-processor architecture
260+
Depending on integration with the Zephyr networking layer, there are two different designs:
261+
262+
.. tabs::
263+
264+
.. group-tab:: Integration with Zephyr networking layer
265+
266+
.. figure:: images/thread_platform_design_rcp.svg
267+
:alt: Radio co-processor architecture
268+
269+
Radio co-processor architecture
270+
271+
.. group-tab:: Direct IEEE 802.15.4 radio integration with OpenThread stack
272+
273+
.. figure:: images/thread_platform_design_rcp_direct.svg
274+
:alt: Radio co-processor architecture
183275

184-
Radio co-processor architecture
276+
Radio co-processor architecture
185277

186278
.. note::
187279
|connection_options_limited|

0 commit comments

Comments
 (0)