This commit simplifies integration of openthread module in Zephyr.
Main changes:
Move of zephyr/CMakeLists.txt -> to zephyr/modules/openthread
alter module.yml to facilitate above changes.
Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
Link with openthread-platform-utils library only if
CONFIG_OPENTHREAD_SETTINGS_RAM is enabled.
openthread-platform-utils contains settings backend for storing
OpenThread data in RAM.
Third-party libraries need Kconfig defines but can not include them
through the usual method of including openthread-*-config.h.
To this end we add the flag -imacros <autoconf.h> to ot-config.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Current handling of CONFIG_OPENTHREAD_CUSTOM_PARAMETERS config used
an OT_PRIVATE_DEFINES variable, which became obsolete and no longer
functional due to some past changes in OpenThread build system. Use
`ot-config` target instead to pass custom configs.
Additionally, remove the line that appended the OT_PRIVATE_INCLUDES
variable, as the variable also became obsolete and is no longer used in
the OpenThread build system.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
OT_LINK_METRICS CMake option has been divided into
OT_LINK_METRICS_INITIATOR and OT_LINK_METRICS_SUBJECT, so
make proper adjustments in the Zephyr CMakeLists.txt.
Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
All of the OpenThread configuration variables are cache variables, which
are persistent across runs and not being overwritten by default. This
casue an undesired behaviour, that only the initial configuration is
being applied for OpenThread, making it indifferent for any following
Kconfig changes.
Fix this, by adding `FORCE` parameter when setting the variable,
therefore ensuring that the variable value gets updated. Additionally,
set the variable to OFF explicity in case the respetive Kconfig option
is disabled. Both of these changes ensure that the configuration used by
OpenThread is in sync with the current Kconfig configuration.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
`CONFIG_OPENTHREAD_NCP_VENDOR_HOOK_SOURCE` was renamed to
`CONFIG_OPENTHREAD_COPROCESSOR_VENDOR_HOOK_SOURCE`, but the change
was not applied in this `CMakeLists.txt`.
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
Apparently linking `-lc` within `zephyr_link_library` did not ensure
that C library is linked after OpenThread libs, which in result could
lead to linker errors (for instance "undefined reference to
`isupper'").
Fix this by using `target_link_libraries` command on the ot-config
target instead, which is linked with every OT library generated.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Enable new features from the upmerge:
- OT_CLI_TRANSPORT
- OT_CSL_DEBUG
- OT_DATASET_UPDATER
- OT_LINK_METRICS
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
Fixes: #28465
Openthread depends on errno.h, which includes errno_private.h in minimal libc.
errno_private.h is generated as part of ${SYSCALL_LIST_H_TARGET} target.
This commit defines a dependency from openthread to ${SYSCALL_LIST_H_TARGET}.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Since https://github.com/zephyrproject-rtos/zephyr/pull/23054 then
ZEPHYR_BASE should be used as a CMake variable.
See also: d7862cf77686e607fcce776df1da6a800315bac8 in Zephyr repo.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Fixes: #28197
Disable unused openthread libraries from Zephyr build.
This removes the need of setting Zephyr compile flags on openthread
targets that are not used by Zephyr.
It further reduces number of build steps and build time significantly.
Before, 780 steps:
`time ninja -Cbuild`
[708/708] Linking CXX executable zephyr/zephyr.elf
135.08user 30.24system 0:46.21elapsed 357%CPU
After, 480 steps:
`time ninja -Cbuild`
[480/480] Linking CXX executable zephyr/zephyr.elf
84.02user 18.92system 0:30.72elapsed 335%CPU
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Fixes: #28197
Using generator expressions to fetch include directories, compile
options, and compile definitions from Zephyr interface.
This fixes#28197 and is a safer approach because the use of a generator
expression ensures that properties added after openthread libraries are
defined will also be included.
zephyr_get_<option>_for_lang() has a limitation that it will not be able
to return flags added to zephyr_interface after the function has
returned.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Some mbedtls implementations require multiple libraries to be linked,
for example nrf_security provides common + backend specific libraries.
Intorduced possibility of passing multiple libraries from project
configuration file.
Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
This commit updates cmake configuration with the
latest upstream definitions.
It re-orders the definitions and adds missing symbols.
It removes stale symbols.
New symbols:
- CONFIG_OPENTHREAD_COAP_OBSERVE
- CONFIG_OPENTHREAD_CSL_RECEIVER
- CONFIG_OPENTHREAD_MLE_LONG_ROUTES
- CONFIG_OPENTHREAD_MLR
Removed symbols:
- CONFIG_OPENTHREAD_RCP
Note: Symbols with naming inconsistencies are kept
unmodified for the shake of regressions:
- CONFIG_OPENTHREAD_DIAG
- CONFIG_OPENTHREAD_RAW
- CONFIG_OPENTHREAD_ENABLE_SERVICE
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
In OpenThread OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL
was removed and all occurences were replaced
with OPENTHREAD_CONFIG_LOG_OUTPUT_APP, so change is required
to keep compatibility.
Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
Config option sets OT_THREAD_VERSION value, which is already
used in OpenThread to specify stack version.
Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
Different switch was used for build to allow including all shim body
in zephyr without the need for building openthread from this repo. This
allows developer to include custom OpenThread sources as part of the
application.
This change is needed as Thread is a subject of certification and
sources provided by zephyr may not necessairly pass certification or be
precertified. User is allowed to use certified OpenThread version
this way.
Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
OPENTHREAD_CONFIG_LOG_OUTPUT now can be set to OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL
using CONFIG_LOG_BACKEND_SPINEL Zephyr config option.
Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
Some options were not included in the CMakeLists.txt despite being
available in options.cmake file. Additionally added possibility
to pass additional flags that do not have corresponding option.
Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
Otherwise linker may fail to find specific functions, for instance:
`undefined reference to `strncmp'`
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Some new checks which OpenThread added in Cmake are failing, if we
don't specify we that build a static library.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
OpenThread now allows to specify target name for mbedTLS, when external
mbedTLS instance is used.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
mbedTLS default configuration in OpenThread when building with CMake
changed in the recent upmerge. In result, cryptography worked
incorrectly, making it impossible to decrypt packets in wireshark for
instance.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
openthread-platform-utils-static library contains OpenThread settings
implementation, which conflicts and is no longer needed with native
Zephyr settings implementation.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Follwing the convention in Zephyr, all CMake configuration related to
a module, should be placed within the module repostiory.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add module.yml file needed to make OpenThread a Zephyr module. Move
OpenThread CMakeLists.txt here.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>