Skip to content

Conversation

ArekBalysNordic
Copy link
Contributor

@ArekBalysNordic ArekBalysNordic commented Apr 16, 2025

Introduce radio_nrf5 OpenThread radio platform which uses nRF radio driver directly. The Zephyr L2 layer, IEEE802.15.4 shim layer and net packets are not used in this implementation.

To build without Zephyr's L2 layer add:

-DCONFIG_OPENTHREAD=y -DCONFIG_NET_L2_OPENTHREAD=n -DCONFIG_NETWORKING=n

TODO:

  • Prepare radio_nrf5.c file.
  • Prepare Kconfig to switch between the legacy approach with Zephyr L2 and IEE802.15.4 shim layer and the new one.
  • Implement receiving and transmitting through nRF radio driver.
  • Implement threading to manage transmission.

Do not review while it is in draft.

@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Apr 16, 2025
@ArekBalysNordic ArekBalysNordic force-pushed the openthread_radio_refactor branch from 4ddfba4 to 3f13949 Compare April 16, 2025 13:17
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Apr 16, 2025

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 43

Inputs:

Sources:

sdk-nrf: PR head: bca4b6bf8c9219c5af8f4f32140c2a5417b195a4
zephyr: PR head: 0087a083d76101e611c0c156c212f7bb6b0e9f55

more details

sdk-nrf:

PR head: bca4b6bf8c9219c5af8f4f32140c2a5417b195a4
merge base: d0189a6959cded3ca35737a37359d2fde26b0fef
target head (main): cffb09ccf70792b3c32b4bd38c1e341aec2630c7
Diff

zephyr:

PR head: 0087a083d76101e611c0c156c212f7bb6b0e9f55
merge base: 6131774ed5598fde0d09eb266fec686c95e2f24b
target head (main): 9761288d1c61d676cf5e7501563c199db9007ae0
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (53)
doc
│  ├── nrf
│  │  ├── protocols
│  │  │  ├── thread
│  │  │  │  │ configuring.rst
modules
│  ├── openthread
│  │  ├── CMakeLists.txt
│  │  ├── Kconfig
│  │  ├── Kconfig.nrf5
│  │  ├── include
│  │  │  │ openthread.h
│  │  ├── openthread.c
│  │  ├── platform
│  │  │  ├── CMakeLists.txt
│  │  │  ├── alarm.c
│  │  │  ├── ble.c
│  │  │  ├── diag.c
│  │  │  ├── entropy.c
│  │  │  ├── platform-zephyr.h
│  │  │  ├── radio.c
│  │  │  ├── radio_nrf5.c
│  │  │  │ settings.c
│  │  │ shell.c
samples
│  ├── openthread
│  │  ├── cli
│  │  │  ├── prj.conf
│  │  │  ├── snippets
│  │  │  │  ├── ci
│  │  │  │  │  │ ci.conf
│  │  │  │  ├── logging
│  │  │  │  │  │ logging.conf
│  │  │  ├── src
│  │  │  │  │ low_power.c
│  │  ├── coap_client
│  │  │  ├── src
│  │  │  │  │ coap_client_utils.c
│  │  ├── coap_server
│  │  │  ├── prj.conf
│  │  │  ├── snippets
│  │  │  │  ├── logging
│  │  │  │  │  │ logging.conf
│  │  │  ├── src
│  │  │  │  │ coap_server.c
│  │  ├── coprocessor
│  │  │  ├── prj.conf
│  │  │  ├── src
│  │  │  │  │ nrf_802154_radio_wrapper.c
│  ├── wifi
│  │  ├── thread_coex
│  │  │  ├── src
│  │  │  │  │ ot_utils.c
subsys
│  ├── caf
│  │  ├── modules
│  │  │  │ net_state_ot.c
│  ├── net
│  │  ├── openthread
│  │  │  ├── rpc
│  │  │  │  ├── common
│  │  │  │  │  │ ot_rpc_lock_net_l2.c
tests
│  ├── subsys
│  │  ├── net
│  │  │  ├── openthread
│  │  │  │  ├── rpc
│  │  │  │  │  ├── server
│  │  │  │  │  │  ├── CMakeLists.txt
│  │  │  │  │  │  ├── src
│  │  │  │  │  │  │  ├── instance_suite.c
│  │  │  │  │  │  │  │ mocks.c
west.yml
zephyr
│  ├── doc
│  │  │ zephyr.doxyfile.in
│  ├── include
│  │  ├── zephyr
│  │  │  ├── net
│  │  │  │  ├── net_if.h
│  │  │  │  │ openthread.h
│  ├── modules
│  │  ├── openthread
│  │  │  ├── CMakeLists.txt
│  │  │  ├── Kconfig
│  │  │  ├── include
│  │  │  │  │ openthread.h
│  │  │  ├── openthread.c
│  │  │  ├── platform
│  │  │  │  ├── CMakeLists.txt
│  │  │  │  ├── alarm.c
│  │  │  │  ├── ble.c
│  │  │  │  ├── diag.c
│  │  │  │  ├── entropy.c
│  │  │  │  ├── platform-zephyr.h
│  │  │  │  ├── radio.c
│  │  │  │  ├── radio_spinel.cpp
│  │  │  │  │ settings.c
│  │  │  │ shell.c
│  ├── subsys
│  │  ├── net
│  │  │  ├── l2
│  │  │  │  ├── openthread
│  │  │  │  │  ├── openthread.c
│  │  │  │  │  │ openthread_utils.c
│  ├── tests
│  │  ├── subsys
│  │  │  ├── openthread
│  │  │  │  │ radio_stub.c

Outputs:

Toolchain

Version: 4aa3467a6d
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:4aa3467a6d_e85602c25f

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 16
    • sdk-zephyr test count: 1457
  • ❌ Integration tests
    • ✅ desktop52_verification
    • ✅ test-fw-nrfconnect-apps
    • ✅ test-fw-nrfconnect-chip
    • ✅ test-fw-nrfconnect-nfc
    • ❌ test-fw-nrfconnect-nrf-iot_cloud
    • ✅ test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • ✅ test-fw-nrfconnect-nrf-iot_thingy91
    • ❌ test-fw-nrfconnect-rs
    • ❌ test-fw-nrfconnect-fem
    • ❌ test-fw-nrfconnect-thread-main
    • ✅ test-sdk-find-my
    • ✅ test-fw-nrfconnect-nrf-iot_mosh
    • ✅ test-fw-nrfconnect-nrf-iot_positioning
    • ❌ test-sdk-wifi
    • ✅ test-low-level
    • ✅ test-fw-nrfconnect-ps-main
    • ⚠️ test-sdk-dfu
Disabled integration tests
    • doc-internal
    • test_ble_nrf_config
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-boot
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_serial_lte_modem
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-proprietary_esb
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-tfm
    • test-sdk-audio
    • test-sdk-mcuboot
    • test-sdk-pmic-samples
    • test-secdom-samples-public

Note: This message is automatically posted and updated by the CI

@ArekBalysNordic ArekBalysNordic changed the title modules: openthread: Prepare radio_nrf5.c file and Kconfigs modules: openthread: Implement radio_nrf5 OpenThread platform. Apr 16, 2025
@ArekBalysNordic ArekBalysNordic force-pushed the openthread_radio_refactor branch from 3f13949 to 0a1013d Compare April 17, 2025 15:39
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Apr 17, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
zephyr nrfconnect/sdk-zephyr@6131774 nrfconnect/sdk-zephyr#2792 nrfconnect/sdk-zephyr#2792/files

DNM label due to: 1 project with PR revision

Note: This message is automatically posted and updated by the Manifest GitHub Action.

Copy link

github-actions bot commented Apr 17, 2025

You can find the documentation preview for this PR here.

Preview links for modified nRF Connect SDK documents:

https://ncsdoc.z6.web.core.windows.net/PR-21882/nrf/protocols/thread/configuring.html

@ArekBalysNordic ArekBalysNordic force-pushed the openthread_radio_refactor branch 2 times, most recently from 7cab044 to 35b97ad Compare April 18, 2025 12:34
@ArekBalysNordic ArekBalysNordic force-pushed the openthread_radio_refactor branch 2 times, most recently from 82b5166 to 42da834 Compare April 18, 2025 12:54
@ArekBalysNordic ArekBalysNordic force-pushed the openthread_radio_refactor branch 5 times, most recently from bd28b58 to 140193d Compare April 29, 2025 14:23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be moved out of OpenThread platform, as it does not implement it. Would move it one level up.

@ArekBalysNordic ArekBalysNordic force-pushed the openthread_radio_refactor branch 2 times, most recently from 2401932 to 0e3d1ae Compare April 30, 2025 09:03
@github-actions github-actions bot added the doc-required PR must not be merged without tech writer approval. label Apr 30, 2025
@adigie adigie force-pushed the openthread_radio_refactor branch from 21d9e9a to 3e301f9 Compare May 7, 2025 09:26
@adigie adigie force-pushed the openthread_radio_refactor branch 2 times, most recently from ee55876 to efb4285 Compare May 15, 2025 11:16
@adigie adigie requested review from a team as code owners May 29, 2025 19:49
@adigie adigie force-pushed the openthread_radio_refactor branch from 585f397 to 5211303 Compare May 29, 2025 19:50
@adigie adigie requested a review from a team as a code owner May 29, 2025 19:50
@adigie adigie changed the title modules: openthread: Implement radio_nrf5 OpenThread platform. [DRAFT] modules: openthread: Implement radio_nrf5 OpenThread platform. May 29, 2025
@adigie adigie force-pushed the openthread_radio_refactor branch from 619a785 to 7165e3e Compare May 30, 2025 08:11
ArekBalysNordic and others added 4 commits May 30, 2025 10:42
Updated modules/openthread/platform after latest changes in
Zephyr.

Aligned openthread implementation to the new approach.

Signed-off-by: Arkadiusz Balys <[email protected]>
Stop using L2 log level in platform files.

Signed-off-by: Arkadiusz Balys <[email protected]>
The new CONFIG_OPENTHREAD_SYS_INIT Kconfig option allows OpenThread
to be automatically initialised during the Zephyr POST_KERNEL
initialisation stage.

If Zephyr's L2 layer OpenThread implementation is enabled, the
IEEE802.15.4 shim layer initialises OpenThread in the POST_KERNEL
phase. However, since Openthread may work without Zephyr's L2
layer, in this case, no object can initialise it automatically.
This new Kconfig option may help start OpenThread automatically
if the L2 Layer is disabled.

Signed-off-by: Arkadiusz Balys <[email protected]>
Signed-off-by: Adrian Gielniewski <[email protected]>
* Add header with public API of OpenThread module.
* Add module include directory to Zephyr include directories.
* Use new header in platform implementation.

Signed-off-by: Adrian Gielniewski <[email protected]>
@adigie adigie force-pushed the openthread_radio_refactor branch from 7165e3e to dd61149 Compare May 30, 2025 09:39
adigie and others added 12 commits May 30, 2025 12:31
Use new API from OpenThread module header.

Signed-off-by: Adrian Gielniewski <[email protected]>
Add new Kconfig options to enable platform-specific features in
OpenThread:

- CONFIG_OPENTHREAD_PLATFORM_PKT_TXTIME enables support for packet TX
time when CONFIG_NET_PKT_TXTIME is selected.
- CONFIG_OPENTHREAD_PLATFORM_CARRIER_FUNCTIONS enables modulated and
continuous carrier functions when CONFIG_OPENTHREAD_DIAG and
CONFIG_IEEE802154_CARRIER_FUNCTIONS are enabled.

Update preprocessor conditionals to use the new options instead of
relying directly on CONFIG_NET_PKT_TXTIME and
CONFIG_IEEE802154_CARRIER_FUNCTIONS.

This change improves configurability and allows to reuse the platform
implementation when not using Zephyr networking.

Upstream PR #: 90737

Signed-off-by: Adrian Gielniewski <[email protected]>
Update sdk-zephyr.

Signed-off-by: Adrian Gielniewski <[email protected]>
Signed-off-by: Adrian Gielniewski <[email protected]>
To start working with a new implementation of the OpenThread radio
platform, we need to have the dedicated radio_nrf5.c file and
kconfig to switch between legacy Zephyr's IEEE802.15.4 shim layer
and direct nrf5 radio driver implementations.

Signed-off-by: Arkadiusz Balys <[email protected]>
Prepared build environment to support building OpenThread
without Zephyr's L2 and IEEE802.15.4 shim layers.
To do it, some of Kconfigs must be cloned into the new
Kconfig file (dedicated to nRF5-driver-based approach)
to meet all OpenThread requirements while NET_L2_OPENTHREAD
is disabled.

Signed-off-by: Arkadiusz Balys <[email protected]>
Stop using L2 log level in platform files.

Signed-off-by: Arkadiusz Balys <[email protected]>
Align Kconfigs

Signed-off-by: Adrian Gielniewski <[email protected]>
Add alternative radio implementation that does not use Zephyr L2.

Signed-off-by: Adrian Gielniewski <[email protected]>
Add nrf5 radio implementation.

Signed-off-by: Adrian Gielniewski <[email protected]>
Update docs.

Signed-off-by: Adrian Gielniewski <[email protected]>
@adigie adigie force-pushed the openthread_radio_refactor branch from dd61149 to a19cce9 Compare May 30, 2025 10:37
Move ACK handling out of radio callback.

Signed-off-by: Adrian Gielniewski <[email protected]>
@ArekBalysNordic
Copy link
Contributor Author

It will be finished in a different PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. DNM doc-required PR must not be merged without tech writer approval. manifest manifest-matter manifest-nrfxlib manifest-zephyr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants