Commit Graph

47 Commits

Author SHA1 Message Date
Robert Lubos 4a8ba0b043 zephyr: Specify module's Kconfig location
Specify that the Kconfig file for the OpenThread module is located
within Zephyr tree.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-07-08 13:31:56 +02:00
Przemyslaw Bida 0e141a556a zephyr: Simplify zephyr integration of openthread.
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>
2022-03-01 15:59:31 +01:00
Eduardo Montoya 1ccc050189 cmake: enable new OpenThread options
CONFIG_OPENTHREAD_BORDER_ROUTING_NAT64
CONFIG_OPENTHREAD_DNS_DSO
CONFIG_OPENTHREAD_EXCLUDE_TCPLP_LIB

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2022-01-31 10:45:23 +01:00
Lukasz Maciejonczyk 41bc49da49 zephyr: add option to use SETTINGS_RAM in zephyr
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.
2021-12-07 15:49:58 +01:00
Sebastian Bøe f3aae12491 zephyr: Add -imacros <autoconf.h> to ot-config
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>
2021-09-29 11:14:03 +02:00
Eduardo Montoya 323d4b655d zephyr: add Uptime CMake option
Allow to configure `CONFIG_OPENTHREAD_UPTIME`.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2021-09-13 13:58:22 +02:00
Przemyslaw Bida 24e6fd4a7e zephyr: Add openthread configuration options.
Adding the following options to configuration:
- OT_CSL_AUTO_SYNC
- OT_HISTORY_TRACKER

Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2021-08-26 10:53:21 +02:00
Eduardo Montoya 411dbe7462 zephyr: add Netdata Publisher CMake option
Allow to configure `CONFIG_OPENTHREAD_NETDATA_PUBLISHER`.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2021-08-11 10:01:01 +02:00
Robert Lubos 542b14a5bc cmake: Fix CONFIG_OPENTHREAD_CUSTOM_PARAMETERS handling
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>
2021-08-09 15:19:36 +02:00
Damian Krolik 0c52ef1b59 [zephyr] adjust Zephyr build after OT upmerge
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>
2021-07-06 12:00:23 +02:00
Pieter De Gendt d7eaf6f421 openthread: cmake: enable OT_ASSERT based on CONFIG_ASSERT
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-07-01 15:00:06 +02:00
Robert Lubos 385e19da1a cmake: Make OpenThread cache variables reconfigurable
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>
2021-05-19 15:00:44 +02:00
Robert Lubos 0dc141a521 cmake: enable new OpenThread options
Allow to configure new OpenThread options with Kconfig.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-04-30 11:12:37 +02:00
Kamil Kasperczyk 3f5090bc34 cmake: added enabling OpenThread DNS-SD server feature
Enabled OT_DNSSD_SERVER feature from upmerge.

Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
2021-02-17 14:41:16 +01:00
Eduardo Montoya 17273b953f cmake: enable new OpenThread features
Enable new features from the upmerge:
- OT_COPA_BLOCK

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2021-02-05 09:44:01 +01:00
Eduardo Montoya 28df62ec3e cmake: enable new OpenThread features
Enable new features from the upmerge:
- OT_SRP_CLIENT
- OT_SRP_SERVER

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2021-01-25 18:54:15 +01:00
Eduardo Montoya bd3a99488f cmake: fix usage of stale Kconfig symbol for coprocessor vendor hooks
`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>
2021-01-22 15:48:02 +01:00
Robert Lubos b7433ff4ef cmake: Add C library dependency to ot-config target
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>
2021-01-18 14:55:09 +01:00
Eduardo Montoya 355c5cf13a cmake: enable new OpenThread features
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>
2020-12-16 14:39:37 +01:00
Markus Becker f9fbfad011 net: openthread: OpenThread RCP mode integration into Zephyr
* Add RCP library.
* Conditionally remove non required libraries not required for RCP.
2020-10-20 17:07:55 +02:00
Torsten Rasmussen 07f430dac6 cmake: openthread depends on generated headers in Zephyr
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>
2020-09-21 14:54:22 +02:00
Torsten Rasmussen 7854c687bf cmake: using ${ZEPHYR_BASE} instead of $ENV{ZEPHYR_BASE}
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>
2020-09-10 17:02:10 +02:00
Torsten Rasmussen 93ddb74996 cmake: excluded unused openthread libraries from Zephyr build
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>
2020-09-10 17:02:10 +02:00
Torsten Rasmussen e9fb5cdc0c cmake: use generator expression to fetch zephyr_interface options
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>
2020-09-10 17:02:10 +02:00
Marek Porwisz f23165fde9 cmake: Allow multiple mbedtls libraries
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>
2020-09-03 16:31:19 +02:00
Eduardo Montoya 1d4bcdd96d cmake: Align config options with upstream
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>
2020-08-18 13:33:09 +02:00
Kamil Kasperczyk 9950843843 logging: Removed outdated NCP_SPINEL log output.
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>
2020-08-13 16:08:23 +02:00
Kamil Kasperczyk e294e1d507 cmake: Add config option for selecting OpenThread stack version.
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>
2020-08-04 18:00:16 +02:00
Marek Porwisz 168248677c cmake: Add custom mbedtls target
Add support for custom mbedtls target name.

Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
2020-07-22 14:13:55 +02:00
Marek Porwisz a0a7e20213 cmake: Use different config switch for build
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>
2020-07-15 13:10:45 +02:00
Kamil Kasperczyk acd7241123 logging: Added Zephyr config option to set OPENTHREAD_CONFIG_LOG_OUTPUT
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>
2020-07-03 13:21:26 +02:00
Marek Porwisz e3b80d6e4c cmake: add options from options.cmake
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>
2020-06-29 14:27:23 +02:00
Philipp Wohlgenannt 981b502fc6 cmake: Add NCP vendor hook
Add NCP vendor hook for vendor sepcific code

Signed-off-by: Philipp Wohlgenannt <philipp.wohlgenannt@tridonic.com>
2020-06-22 17:30:35 +02:00
Eduardo Montoya 1db7e9ebe5 cmake: add config option to enable reference device
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2020-05-22 15:08:16 +02:00
Robert Lubos a83d18cf18 cmake: Make sure libc is linked after OT libs
Otherwise linker may fail to find specific functions, for instance:
`undefined reference to `strncmp'`

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-05-07 11:34:43 +02:00
Robert Lubos 5f3f6fdfa0 cmake: Remove obsolete libc capabilities
These options are no longer used in OT.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-05-07 10:59:40 +02:00
Robert Lubos 3b3b372c79 cmake: Fix failed checks
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>
2020-05-07 10:27:30 +02:00
Robert Lubos a8ba8debc9 cmake: Specify mbedTLS target
OpenThread now allows to specify target name for mbedTLS, when external
mbedTLS instance is used.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-05-06 13:32:56 +02:00
Lukasz Maciejonczyk 2ac83762b8 [cmake] Add config option to enable CoAP api
Signed-off-by: Lukasz Maciejonczyk <Lukasz.Maciejonczyk@nordicsemi.no>
2020-04-16 15:01:01 +02:00
Robert Lubos 497590aa12 cmake: Fix incorrect default mbedTLS config for Zephyr
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>
2020-03-24 11:55:51 +01:00
Markus Becker bc267a6223 Allow configuration of more OT options from Zephyr
Signed-off-by: Markus Becker <markus.becker@tridonic.com>
2020-03-19 16:08:12 +01:00
Robert Lubos d79f2e66eb cmake: Remove unused compile definitions
Zephyr definitions are not needed for OT build.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-03-18 10:53:32 +01:00
Robert Lubos 3c6191eb4e cmake: Avoid linking openthread-platform-utils-static lib
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>
2020-01-15 11:01:20 +01:00
Robert Lubos 05aaccc6e0 cmake: Keep all OT CMake configuration together
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>
2019-12-17 16:15:06 +01:00
Robert Lubos 5496d9df48 cmake: Integrate OpenThread CMake files with Zephyr
OpenThread now has a native CMake build system. This commit integrates
it with Zephyr.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-12-13 13:08:10 +01:00
Robert Lubos 1e2ce14a35 Revert "west: add zephyr module"
This reverts commit 0dbecf508e.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-12-13 13:03:02 +01:00
Robert Lubos 0dbecf508e west: add zephyr module
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>
2019-07-24 09:30:02 +02:00