Skip to content

Conversation

@ArekBalysNordic
Copy link
Contributor

Add configuration validation when using precompiled OpenThread libraries. This helps users identify Kconfig options that differ from the library's built-in configuration and would have no effect.

  • Create openthread_kconfig_check.cmake with utilities for tracking Kconfig to OT option mappings
  • Move the kconfig_to_ot_option macro for boolean options to a separate script file.
  • Add kconfig_to_ot_string_option macro for string options
  • Register all OpenThread Kconfig options including FTD/MTD and string options like POWER_SUPPLY, THREAD_VERSION, etc.
  • Add kconfig_to_ot_string_option macro for string options
  • Add openthread_check_kconfig_for_precompiled_libs function that:
    • Reads openthread_lib_configuration.txt from the selected library
    • Compares current Kconfig values with library OT_* values
    • Displays a warning listing differing options when mismatches found

When CONFIG_OPENTHREAD_SOURCES is not set, users will now see a warning if their configuration differs from the precompiled library, guiding them to either adjust their config or build from sources.

@ArekBalysNordic ArekBalysNordic requested review from a team, LuDuda and Copilot January 8, 2026 14:32
@ArekBalysNordic ArekBalysNordic requested review from a team as code owners January 8, 2026 14:32
@NordicBuilder NordicBuilder added the doc-required PR must not be merged without tech writer approval. label Jan 8, 2026
@NordicBuilder NordicBuilder requested a review from a team January 8, 2026 14:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds configuration validation for OpenThread precompiled libraries to help users identify when their Kconfig settings differ from the library's built-in configuration. The main change is creating a new CMake infrastructure that tracks Kconfig-to-OpenThread option mappings and displays warnings when mismatches are detected.

Key changes:

  • Created openthread_kconfig_check.cmake with utilities for tracking and validating OpenThread Kconfig options
  • Refactored modules/openthread/CMakeLists.txt to use the new tracking system for both boolean and string options
  • Extended validation to cover FTD/MTD device types and string options (thread version, power supply, etc.)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
subsys/net/CMakeLists.txt Broadened the condition for including OpenThread settings check from CONFIG_NET_L2_OPENTHREAD to CONFIG_OPENTHREAD
modules/openthread/openthread_kconfig_check.cmake New file implementing Kconfig tracking and validation infrastructure for precompiled libraries
modules/openthread/CMakeLists.txt Refactored to use new tracking macros and added precompiled library configuration validation
doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst Added release note about the new precompiled library warning feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


# Register string OpenThread Kconfig options
kconfig_to_ot_string_option(CONFIG_OPENTHREAD_THREAD_VERSION OT_THREAD_VERSION "Thread stack version")
kconfig_to_ot_string_option(CONFIG_OPENTHREAD_MBEDTLS_LIB_NAME OT_EXTERNAL_MBEDTLS "External mbedtls library")
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The original code at line 21 uses string(REPLACE \" \" \";\" OT_MBEDTLS_LIB_LIST \" ${CONFIG_OPENTHREAD_MBEDTLS_LIB_NAME}\") to convert the space-separated library list into a CMake list before setting OT_EXTERNAL_MBEDTLS. The new implementation passes the raw string directly, which may not work correctly if CONFIG_OPENTHREAD_MBEDTLS_LIB_NAME contains multiple space-separated library names. The space-to-semicolon conversion logic should be preserved.

Suggested change
kconfig_to_ot_string_option(CONFIG_OPENTHREAD_MBEDTLS_LIB_NAME OT_EXTERNAL_MBEDTLS "External mbedtls library")
kconfig_to_ot_string_option(CONFIG_OPENTHREAD_MBEDTLS_LIB_NAME OT_EXTERNAL_MBEDTLS "External mbedtls library")
if(DEFINED CONFIG_OPENTHREAD_MBEDTLS_LIB_NAME)
string(REPLACE " " ";" OT_MBEDTLS_LIB_LIST " ${CONFIG_OPENTHREAD_MBEDTLS_LIB_NAME}")
set(OT_EXTERNAL_MBEDTLS "${OT_MBEDTLS_LIB_LIST}")
endif()

Copilot uses AI. Check for mistakes.
@ArekBalysNordic
Copy link
Contributor Author

@LuDuda Please take a look, you requested such functionality some time ago. :)

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Jan 8, 2026

CI Information

To view the history of this post, click the 'edited' button above
Build number: 3

Inputs:

Sources:

sdk-nrf: PR head: 917f95f4860061f18b897f81fb34ad4affb986ae

more details

sdk-nrf:

PR head: 917f95f4860061f18b897f81fb34ad4affb986ae
merge base: d6c88a74779647f151672a83b995215491d0df9a
target head (main): 69b449deef77c1c56510a8caada06b3e374e6668
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 (4)
doc
│  ├── nrf
│  │  ├── releases_and_maturity
│  │  │  ├── releases
│  │  │  │  │ release-notes-changelog.rst
modules
│  ├── openthread
│  │  ├── CMakeLists.txt
│  │  │ openthread_kconfig_check.cmake
subsys
│  ├── net
│  │  │ CMakeLists.txt

Outputs:

Toolchain

Version: 400c6cb4ec
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:400c6cb4ec_5ea73affbf

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

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 481
  • ✅ Integration tests
    • ✅ test-fw-nrfconnect-thread-main
Disabled integration tests
    • test-fw-nrfconnect-nrf_lrcs_mosh
    • desktop52_verification
    • test_ble_nrf_config
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_cloud
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-ps-main
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-low-level
    • test-sdk-audio
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-mcuboot
    • test-sdk-wifi
    • test-secdom-samples-public

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

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

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-26446/nrf/releases_and_maturity/releases/release-notes-changelog.html

Add configuration validation when using precompiled OpenThread
libraries. This helps users identify Kconfig options that differ
from the library's built-in configuration and would have no
effect.

- Create openthread_kconfig_check.cmake with utilities for
  tracking Kconfig to OT option mappings
- Move the kconfig_to_ot_option macro for boolean options to
  a separate script file.
- Add kconfig_to_ot_string_option macro for string options
- Register all OpenThread Kconfig options including FTD/MTD and
  string options like POWER_SUPPLY, THREAD_VERSION, etc.
- Add kconfig_to_ot_string_option macro for string options
- Add openthread_check_kconfig_for_precompiled_libs function
  that:
  - Reads openthread_lib_configuration.txt from the selected
    library
  - Compares current Kconfig values with library OT_* values
  - Displays a warning listing differing options when
    mismatches found

When CONFIG_OPENTHREAD_SOURCES is not set, users will now see a
warning if their configuration differs from the precompiled library,
guiding them to either adjust their config or build from sources.

Signed-off-by: Arkadiusz Balys <[email protected]>
Copilot AI review requested due to automatic review settings January 9, 2026 15:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

doc-required PR must not be merged without tech writer approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants