-
Notifications
You must be signed in to change notification settings - Fork 1.4k
modules: openthread: Add Kconfig check for precompiled libraries #26446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.cmakewith utilities for tracking and validating OpenThread Kconfig options - Refactored
modules/openthread/CMakeLists.txtto 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.
modules/openthread/CMakeLists.txt
Outdated
|
|
||
| # 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") |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
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.
| 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() |
|
@LuDuda Please take a look, you requested such functionality some time ago. :) |
6cd0a77 to
2515264
Compare
CI InformationTo view the history of this post, click the 'edited' button above Inputs:Sources:sdk-nrf: PR head: 917f95f4860061f18b897f81fb34ad4affb986ae more detailssdk-nrf:
Github labels
List of changed files detected by CI (4)Outputs:ToolchainVersion: 400c6cb4ec Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
|
You can find the documentation preview for this PR here. Preview links for modified nRF Connect SDK documents: |
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]>
2515264 to
917f95f
Compare
There was a problem hiding this 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.
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.
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.