diff --git a/docs/guides/ti/ti_openthread_library_usage.md b/docs/guides/ti/ti_openthread_library_usage.md new file mode 100644 index 00000000000000..2b209fca44e744 --- /dev/null +++ b/docs/guides/ti/ti_openthread_library_usage.md @@ -0,0 +1,100 @@ +# Configuring Openthread libraries on TI CC13x4 Platforms + +## Overview + +TI Matter example applications provide configuration option for how Thread code +is included in the build. Thread code can be included in as (1) full source or +(2) as optimized for matter thread certified library. The library builds have +been optimized for matter to disable features such as Thread Joiner capability +in order to save on Flash/RAM usage. + +Build arguments have been added to enable Matter applications to link against +certified Openthread FTD/MTD libraries or custom user libraries. + +## Platform Code Changes + +To configure a TI example to utilize either an Openthread source or library +build, open up the `args.gni` file of the example: + +To configure the device as an FTD or MTD, set following parameter to either true +or false respectively. + +``` +chip_openthread_ftd = true +``` + +- **Openthread Library From Source**: + + 1. `ot_ti_lib_dir` Is set to an empty string + + ``` + ot_ti_lib_dir="" + ``` + + 2. `chip_openthread_target` Is set to an empty string + + ``` + chip_openthread_target = "" + ``` + + 3. `openthread_external_platform` Points to the Openthread build dependency + ``` + openthread_external_platform="${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti" + ``` + +- **TI Certified Openthread Library**: + + 1. `ot_ti_lib_dir` Is set to an empty string + + ``` + ot_ti_lib_dir="" + ``` + + 2. `chip_openthread_target` Points to the TI certified library dependency + + ``` + chip_openthread_target = "${chip_root}/third_party/openthread/platforms/ti:ot-ti-cert" + ``` + + 3. `openthread_external_platform` Points to the Openthread build dependency + ``` + `openthread_external_platform="${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti"` + ``` + +- **Custom Openthread Library**: + + 1. `ot_ti_lib_dir` Points to a library directory containing a custom + `libopenthread-ftd/mtd` variant + + ``` + ot_ti_lib_dir="${chip_root}/CUSTOM_LIB_DIR_PATH/" + ``` + + 2. `chip_openthread_target` Is set to an empty string + + ``` + chip_openthread_target = "" + ``` + + 3. `openthread_external_platform` Points to the Openthread build dependency + + ``` + openthread_external_platform="${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti" + ``` + +The TI Openthread certified library for the MTD/FTD configurations is based on +the following header file: + +- `third_party/openthread/ot-ti/src/openthread-core-cc13xx_cc26xx-config-matter.h` + +In order to update the Openthread configuration when building from source or a +custom library, users may adjust features via the following configuration header +file: + +- `${chip_root}/examples/platform/cc13x4_26x4/project_include/OpenThreadConfig.h` + +Please refer to TI's standalone Openthread Application build process for +instructions on acquiring FTD/MTD libraries as they are automatically built when +generating the standalone applications. + +- `third_party/openthread/ot-ti/README.md` diff --git a/docs/guides/ti/ti_platform_overview.md b/docs/guides/ti/ti_platform_overview.md index a26ade4d224b0a..bae464ac107224 100644 --- a/docs/guides/ti/ti_platform_overview.md +++ b/docs/guides/ti/ti_platform_overview.md @@ -126,6 +126,33 @@ CC2674P10 or the CC2674R10, please refer to the guide linked below.
+## Factory Data Programming Tool + +For instructions on how to program custom factory data on TI devices, please +refer to the guide linked below. + +- [TI Factory Data User Guide](./ti_factory_data_user_guide.md) + +
+ +## Intermittently Connected Devices + +For instructions on how to use Matters' ICD feature on TI devices, please refer +to the guide linked below. + +- [Enabling ICD On TI Devices](./enabling_icd_on_ti_devices.md) + +
+ +## Matter Openthread Library Configuration + +For instructions on how to configure the Openthread build configuration for a +Matter application, please refer to the guide linked below. + +- [Openthread Library Configuration](./ti_openthread_library_usage.md) + +
+ ### TI Support For technical support, please consider creating a post on TI's [E2E forum][e2e]. diff --git a/examples/all-clusters-app/cc13x4_26x4/BUILD.gn b/examples/all-clusters-app/cc13x4_26x4/BUILD.gn index a20b07b6441f1d..4a60c7992b197e 100644 --- a/examples/all-clusters-app/cc13x4_26x4/BUILD.gn +++ b/examples/all-clusters-app/cc13x4_26x4/BUILD.gn @@ -45,22 +45,6 @@ ti_sysconfig("sysconfig") { "ti_ble_config.h", "ti_dmm_application_policy.c", "ti_dmm_application_policy.h", - - # CCFG generation disabled for OTA-able application - #"ti_devices_config.c", - #"ti_devices_config.h", - - # disabled until upstream generation is aligned - #"tiop_config.h", - #"tiop_config.c", - - # not traditional source files - #"ti_utils_build_linker.cmd.genlibs", - #"syscfg_c.rov.xs", - #"ti_utils_runtime_model.gv", - #"ti_utils_runtime_Makefile", - #"ti_ble_app_config.opt", - #"ti_build_config.opt", ] public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ] @@ -107,16 +91,9 @@ ti_simplelink_executable("all-clusters-app") { "${chip_root}/examples/all-clusters-app/all-clusters-common", "${chip_root}/examples/platform/cc13x4_26x4:cc13x4_26x4-attestation-credentials", "${chip_root}/src/lib", + "${chip_root}/third_party/openthread:openthread", ] - - if (chip_openthread_ftd) { - deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] - } else { - deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] - } - defines = [] - if (custom_factory_data) { defines += [ "CC13XX_26XX_FACTORY_DATA" ] } diff --git a/examples/all-clusters-app/cc13x4_26x4/args.gni b/examples/all-clusters-app/cc13x4_26x4/args.gni index f6d58510052473..bebfb47fa12665 100644 --- a/examples/all-clusters-app/cc13x4_26x4/args.gni +++ b/examples/all-clusters-app/cc13x4_26x4/args.gni @@ -30,13 +30,14 @@ lwip_debug = false chip_enable_ota_requestor = true -openthread_external_platform = "${chip_root}/third_party/openthread/platforms/cc13x4_26x4:libopenthread-cc13x4_cc26x4" +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti" +chip_openthread_target = "" + chip_openthread_ftd = true # Disable CHIP Logging #chip_progress_logging = false - -# Disable verbose logs for all-clusters app to save Flash #chip_detail_logging = false #chip_automation_logging = false diff --git a/examples/all-clusters-app/cc13x4_26x4/main/include/OpenThreadConfig.h b/examples/all-clusters-app/cc13x4_26x4/main/include/OpenThreadConfig.h deleted file mode 100644 index 7d227258b1eaae..00000000000000 --- a/examples/all-clusters-app/cc13x4_26x4/main/include/OpenThreadConfig.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Overrides to default OpenThread configuration. - * - */ - -#pragma once - -// Use the TI-supplied default platform configuration for remainder -#include "openthread-core-cc13x4_26x4-config.h" diff --git a/examples/lighting-app/cc13x4_26x4/BUILD.gn b/examples/lighting-app/cc13x4_26x4/BUILD.gn index 6434af621259d4..55d78f140fb2d4 100644 --- a/examples/lighting-app/cc13x4_26x4/BUILD.gn +++ b/examples/lighting-app/cc13x4_26x4/BUILD.gn @@ -49,18 +49,6 @@ ti_sysconfig("sysconfig") { # CCFG generation disabled for OTA-able application #"ti_devices_config.c", #"ti_devices_config.h", - - # disabled until upstream generation is aligned - #"tiop_config.h", - #"tiop_config.c", - - # not traditional source files - #"ti_utils_build_linker.cmd.genlibs", - #"syscfg_c.rov.xs", - #"ti_utils_runtime_model.gv", - #"ti_utils_runtime_Makefile", - #"ti_ble_app_config.opt", - #"ti_build_config.opt", ] public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ] @@ -89,16 +77,9 @@ ti_simplelink_executable("lighting_app") { "${chip_root}/examples/lighting-app/lighting-common", "${chip_root}/examples/platform/cc13x4_26x4:cc13x4_26x4-attestation-credentials", "${chip_root}/src/lib", + "${chip_root}/third_party/openthread:openthread", ] - - if (chip_openthread_ftd) { - deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] - } else { - deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] - } - defines = [] - if (custom_factory_data) { defines += [ "CC13XX_26XX_FACTORY_DATA" ] } diff --git a/examples/lighting-app/cc13x4_26x4/args.gni b/examples/lighting-app/cc13x4_26x4/args.gni index 640bf6ee57003e..823c0385aeb643 100644 --- a/examples/lighting-app/cc13x4_26x4/args.gni +++ b/examples/lighting-app/cc13x4_26x4/args.gni @@ -30,8 +30,13 @@ lwip_debug = false chip_enable_ota_requestor = true -chip_openthread_ftd = false -openthread_external_platform = "${chip_root}/third_party/openthread/platforms/cc13x4_26x4:libopenthread-cc13x4_cc26x4" +chip_openthread_ftd = true + +ot_ti_lib_dir = "" +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti" + +chip_openthread_target = "" # Disable CHIP Logging chip_progress_logging = true diff --git a/examples/lock-app/cc13x4_26x4/BUILD.gn b/examples/lock-app/cc13x4_26x4/BUILD.gn index ab32881a6f15eb..12baedb9ead35e 100644 --- a/examples/lock-app/cc13x4_26x4/BUILD.gn +++ b/examples/lock-app/cc13x4_26x4/BUILD.gn @@ -49,14 +49,6 @@ ti_sysconfig("sysconfig") { # CCFG generation disabled for OTA-able application #"ti_devices_config.c", #"ti_devices_config.h", - - # not traditional source files - #"ti_utils_build_linker.cmd.genlibs", - #"syscfg_c.rov.xs", - #"ti_utils_runtime_model.gv", - #"ti_utils_runtime_Makefile", - #"ti_ble_app_config.opt", - #"ti_build_config.opt", ] public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ] @@ -93,16 +85,9 @@ ti_simplelink_executable("lock_app") { "${chip_root}/examples/lock-app/lock-common", "${chip_root}/examples/platform/cc13x4_26x4:cc13x4_26x4-attestation-credentials", "${chip_root}/src/lib", + "${chip_root}/third_party/openthread:openthread", ] - - if (chip_openthread_ftd) { - deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] - } else { - deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] - } - defines = [] - if (custom_factory_data) { defines += [ "CC13XX_26XX_FACTORY_DATA" ] } diff --git a/examples/lock-app/cc13x4_26x4/args.gni b/examples/lock-app/cc13x4_26x4/args.gni index 1e92a24dab0c3f..ca53f6e3bbc603 100644 --- a/examples/lock-app/cc13x4_26x4/args.gni +++ b/examples/lock-app/cc13x4_26x4/args.gni @@ -31,7 +31,10 @@ lwip_debug = false chip_enable_ota_requestor = true chip_openthread_ftd = true -openthread_external_platform = "${chip_root}/third_party/openthread/platforms/cc13x4_26x4:libopenthread-cc13x4_cc26x4" +ot_ti_lib_dir = "" +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti" +chip_openthread_target = "" # Disable CHIP Logging chip_progress_logging = true diff --git a/examples/platform/cc13x4_26x4/project_include/OpenThreadConfig.h b/examples/platform/cc13x4_26x4/project_include/OpenThreadConfig.h index 65a1dbd30aa457..795d77b646769c 100644 --- a/examples/platform/cc13x4_26x4/project_include/OpenThreadConfig.h +++ b/examples/platform/cc13x4_26x4/project_include/OpenThreadConfig.h @@ -1,7 +1,5 @@ /* - * * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,75 +23,31 @@ #pragma once -#ifdef DeviceFamily_CC13X4_CC26X4 - -/* Number of message buffers reduced to fit into CC26x2x3 RAM */ -#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 22 - -#endif // DeviceFamily_CC13X4_CC26X4 - -#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP - -// When operating in a less than ideal RF environment, having a more forgiving configuration -// of OpenThread makes thread a great deal more reliable. -#define OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_MAX_RETRY_DELAY 120 // default is 28800 -#define OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_DIRECT 15 // default is 3 -#define OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_INDIRECT 1 // default is 0 -#define OPENTHREAD_CONFIG_MAC_MAX_TX_ATTEMPTS_INDIRECT_POLLS 16 // default is 4 - -// Enable periodic parent search to speed up finding a better parent. -#define OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE 1 // default is 0 -#define OPENTHREAD_CONFIG_PARENT_SEARCH_RSS_THRESHOLD -45 // default is -65 -#define OPENTHREAD_CONFIG_MLE_INFORM_PREVIOUS_PARENT_ON_REATTACH 1 // default is 0 - -// Use smaller maximum interval to speed up reattaching. -#define OPENTHREAD_CONFIG_MLE_ATTACH_BACKOFF_MAXIMUM_INTERVAL (60 * 10 * 1000) // default 1200000 ms - -#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 -// #define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 0 -#define UART_AS_SERIAL_TRANSPORT 1 -#define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 1 - -#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 -#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 -#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 -#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 -#define OPENTHREAD_CONFIG_DNS_CLIENT_SERVICE_DISCOVERY_ENABLE 1 - -#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 -#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 -#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 -#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 - -#define OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS 0 -// TCP disabled until OpenThread has a GN/Ninja build for the tcplp library -#define OPENTHREAD_CONFIG_TCP_ENABLE 0 - -#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 - -// #define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 1 -// #define OPENTHREAD_CONFIG_COAP_API_ENABLE 1 -#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 -#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 -#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 #define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 #define OPENTHREAD_CONFIG_DIAG_ENABLE 0 #define OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE 0 -#define OPENTHREAD_CONFIG_DUA_ENABLE 1 -#define OPENTHREAD_CONFIG_LINK_RAW_ENABLE 1 +#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 #define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 #define OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE 1 #define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE 1 -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 1 -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 1 -#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1 -#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 -#define OPENTHREAD_CONFIG_MLR_ENABLE 1 -#define OPENTHREAD_CONFIG_NETDATA_PUBLISHER_ENABLE 1 -#define OPENTHREAD_CONFIG_SRP_CLIENT_AUTO_START_DEFAULT_MODE 1 -#define OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0 -#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 1 +#define OPENTHREAD_CONFIG_MLE_IP_ADDRS_PER_CHILD 6 + +// TCP disabled until OpenThread has a GN/Ninja build for the tcplp library +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#define OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS 0 +#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 +#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#define UART_AS_SERIAL_TRANSPORT 1 +#ifdef OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE +#undef OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE +#define OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE 0 +#endif +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP // Use the TI-supplied default platform configuration for remainder -#include "openthread-core-cc13xx_cc26xx-config-matter.h" +#ifdef OPENTHREAD_PROJECT_CORE_CONFIG_FILE +#include OPENTHREAD_PROJECT_CORE_CONFIG_FILE +#endif diff --git a/examples/pump-app/cc13x4_26x4/BUILD.gn b/examples/pump-app/cc13x4_26x4/BUILD.gn index d20d2d8a392c64..8770c4e8f34a59 100644 --- a/examples/pump-app/cc13x4_26x4/BUILD.gn +++ b/examples/pump-app/cc13x4_26x4/BUILD.gn @@ -48,18 +48,6 @@ ti_sysconfig("sysconfig") { # CCFG generation disabled for OTA-able application #"ti_devices_config.c", #"ti_devices_config.h", - - # disabled until upstream generation is aligned - #"tiop_config.h", - #"tiop_config.c", - - # not traditional source files - #"ti_utils_build_linker.cmd.genlibs", - #"syscfg_c.rov.xs", - #"ti_utils_runtime_model.gv", - #"ti_utils_runtime_Makefile", - #"ti_ble_app_config.opt", - #"ti_build_config.opt", ] public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ] @@ -89,16 +77,9 @@ ti_simplelink_executable("pump_app") { "${chip_root}/examples/platform/cc13x4_26x4:cc13x4_26x4-attestation-credentials", "${chip_root}/examples/pump-app/pump-common", "${chip_root}/src/lib", + "${chip_root}/third_party/openthread:openthread", ] - - if (chip_openthread_ftd) { - deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] - } else { - deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] - } - defines = [] - if (custom_factory_data) { defines += [ "CC13XX_26XX_FACTORY_DATA" ] } diff --git a/examples/pump-app/cc13x4_26x4/args.gni b/examples/pump-app/cc13x4_26x4/args.gni index 94b3913ed26045..a1018dafc1f370 100644 --- a/examples/pump-app/cc13x4_26x4/args.gni +++ b/examples/pump-app/cc13x4_26x4/args.gni @@ -30,7 +30,11 @@ lwip_debug = false chip_enable_ota_requestor = true -openthread_external_platform = "${chip_root}/third_party/openthread/platforms/cc13x4_26x4:libopenthread-cc13x4_cc26x4" +ot_ti_lib_dir = "" +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti" +chip_openthread_target = "" + chip_openthread_ftd = true # Disable CHIP Logging diff --git a/examples/pump-app/cc13x4_26x4/main/include/OpenThreadConfig.h b/examples/pump-app/cc13x4_26x4/main/include/OpenThreadConfig.h deleted file mode 100644 index 7d227258b1eaae..00000000000000 --- a/examples/pump-app/cc13x4_26x4/main/include/OpenThreadConfig.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Overrides to default OpenThread configuration. - * - */ - -#pragma once - -// Use the TI-supplied default platform configuration for remainder -#include "openthread-core-cc13x4_26x4-config.h" diff --git a/examples/pump-controller-app/cc13x4_26x4/BUILD.gn b/examples/pump-controller-app/cc13x4_26x4/BUILD.gn index 61aa833752ed47..2d823d8bb129bc 100644 --- a/examples/pump-controller-app/cc13x4_26x4/BUILD.gn +++ b/examples/pump-controller-app/cc13x4_26x4/BUILD.gn @@ -49,18 +49,6 @@ ti_sysconfig("sysconfig") { # CCFG generation disabled for OTA-able application #"ti_devices_config.c", #"ti_devices_config.h", - - # disabled until upstream generation is aligned - #"tiop_config.h", - #"tiop_config.c", - - # not traditional source files - #"ti_utils_build_linker.cmd.genlibs", - #"syscfg_c.rov.xs", - #"ti_utils_runtime_model.gv", - #"ti_utils_runtime_Makefile", - #"ti_ble_app_config.opt", - #"ti_build_config.opt", ] public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ] @@ -88,16 +76,9 @@ ti_simplelink_executable("pump_controller_app") { "${chip_root}/examples/platform/cc13x4_26x4:cc13x4_26x4-attestation-credentials", "${chip_root}/examples/pump-controller-app/pump-controller-common", "${chip_root}/src/lib", + "${chip_root}/third_party/openthread:openthread", ] - - if (chip_openthread_ftd) { - deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] - } else { - deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] - } - defines = [] - if (custom_factory_data) { defines += [ "CC13XX_26XX_FACTORY_DATA" ] } diff --git a/examples/pump-controller-app/cc13x4_26x4/args.gni b/examples/pump-controller-app/cc13x4_26x4/args.gni index 0aecbe27208f5e..dbbc3cd09f6b7e 100644 --- a/examples/pump-controller-app/cc13x4_26x4/args.gni +++ b/examples/pump-controller-app/cc13x4_26x4/args.gni @@ -30,7 +30,11 @@ lwip_debug = false chip_enable_ota_requestor = true -openthread_external_platform = "${chip_root}/third_party/openthread/platforms/cc13x4_26x4:libopenthread-cc13x4_cc26x4" +ot_ti_lib_dir = "" +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti" +chip_openthread_target = "" + chip_openthread_ftd = true # Disable CHIP Logging diff --git a/examples/pump-controller-app/cc13x4_26x4/main/include/OpenThreadConfig.h b/examples/pump-controller-app/cc13x4_26x4/main/include/OpenThreadConfig.h deleted file mode 100644 index 7d227258b1eaae..00000000000000 --- a/examples/pump-controller-app/cc13x4_26x4/main/include/OpenThreadConfig.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Overrides to default OpenThread configuration. - * - */ - -#pragma once - -// Use the TI-supplied default platform configuration for remainder -#include "openthread-core-cc13x4_26x4-config.h" diff --git a/examples/shell/cc13x4_26x4/BUILD.gn b/examples/shell/cc13x4_26x4/BUILD.gn index 9a2e3f2f3263ce..d16b5b43984ab7 100644 --- a/examples/shell/cc13x4_26x4/BUILD.gn +++ b/examples/shell/cc13x4_26x4/BUILD.gn @@ -45,18 +45,6 @@ ti_sysconfig("sysconfig") { "ti_ble_config.h", "ti_dmm_application_policy.c", "ti_dmm_application_policy.h", - - # disabled until upstream generation is aligned - #"tiop_config.h", - #"tiop_config.c", - - # not traditional source files - #"ti_utils_build_linker.cmd.genlibs", - #"syscfg_c.rov.xs", - #"ti_utils_runtime_model.gv", - #"ti_utils_runtime_Makefile", - #"ti_ble_app_config.opt", - #"ti_build_config.opt", ] public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ] @@ -88,16 +76,9 @@ ti_simplelink_executable("shell_app") { "${chip_root}/src/lib", "${chip_root}/src/lib/shell:shell", "${chip_root}/src/setup_payload", + "${chip_root}/third_party/openthread:openthread", ] - - if (chip_openthread_ftd) { - deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] - } else { - deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] - } - defines = [] - if (custom_factory_data) { defines += [ "CC13XX_26XX_FACTORY_DATA" ] } diff --git a/examples/shell/cc13x4_26x4/args.gni b/examples/shell/cc13x4_26x4/args.gni index 21f752427ef41a..631165271a0399 100644 --- a/examples/shell/cc13x4_26x4/args.gni +++ b/examples/shell/cc13x4_26x4/args.gni @@ -30,7 +30,9 @@ chip_enable_ota_requestor = true # Disable FTD Build for all-clusters app to save Flash chip_openthread_ftd = false -openthread_external_platform = "${chip_root}/third_party/openthread/platforms/cc13x4_26x4:libopenthread-cc13x4_cc26x4" +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti" +chip_openthread_target = "" # Disable CHIP Logging chip_progress_logging = false diff --git a/examples/shell/cc13x4_26x4/include/OpenThreadConfig.h b/examples/shell/cc13x4_26x4/include/OpenThreadConfig.h deleted file mode 100644 index 415c1e3d45e646..00000000000000 --- a/examples/shell/cc13x4_26x4/include/OpenThreadConfig.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * - * Copyright (c) 2022 Texas Instruments Incorporated - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Overrides to default OpenThread configuration. - * - */ - -#pragma once - -// Use the TI-supplied default platform configuration for remainder -#include "openthread-core-cc13x4_26x4-config.h" diff --git a/src/platform/cc13xx_26xx/cc13x4_26x4/BUILD.gn b/src/platform/cc13xx_26xx/cc13x4_26x4/BUILD.gn index 0c62b3855ad353..4ad1b10fdf9c60 100644 --- a/src/platform/cc13xx_26xx/cc13x4_26x4/BUILD.gn +++ b/src/platform/cc13xx_26xx/cc13x4_26x4/BUILD.gn @@ -80,24 +80,14 @@ static_library("cc13x4_26x4") { } if (chip_enable_openthread) { - # needed for MTD/FTD - import("//build_overrides/ti_simplelink_sdk.gni") - import("${ti_simplelink_sdk_build_root}/ti_simplelink_board.gni") public_deps += [ - "${chip_root}/third_party/openthread/platforms/cc13x4_26x4:libopenthread-cc13x4_cc26x4", + "${chip_root}/third_party/openthread:openthread", + "${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti", "${chip_root}/third_party/ti_simplelink_sdk:mbedtls", "${chip_root}/third_party/ti_simplelink_sdk:ti_simplelink_sdk", "${chip_root}/third_party/ti_simplelink_sdk:ti_simplelink_sysconfig", ] - if (chip_openthread_ftd) { - public_deps += - [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] - } else { - public_deps += - [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] - } - sources += [ "../../OpenThread/OpenThreadUtils.cpp", "../ThreadStackManagerImpl.cpp", diff --git a/src/platform/cc13xx_26xx/cc13x4_26x4/args.gni b/src/platform/cc13xx_26xx/cc13x4_26x4/args.gni index 35c5499e2b02f1..5d9207f926db81 100644 --- a/src/platform/cc13xx_26xx/cc13x4_26x4/args.gni +++ b/src/platform/cc13xx_26xx/cc13x4_26x4/args.gni @@ -32,6 +32,7 @@ chip_inet_config_enable_ipv4 = false chip_build_tests = false -openthread_project_core_config_file = "openthread-core-cc13x4_26x4-config.h" +openthread_project_core_config_file = + "openthread-core-cc13xx_cc26xx-config-matter.h" openthread_core_config_platform_check_file = - "openthread-core-cc13x4_26x4-config-check.h" + "openthread-core-cc13xx_cc26xx-config-check.h" diff --git a/src/platform/cc13xx_26xx/cc13x4_26x4/crypto/sha256_alt.c b/src/platform/cc13xx_26xx/cc13x4_26x4/crypto/sha256_alt.c index 5adc0c8f3da9fa..60cbbc8bfb4b83 100644 --- a/src/platform/cc13xx_26xx/cc13x4_26x4/crypto/sha256_alt.c +++ b/src/platform/cc13xx_26xx/cc13x4_26x4/crypto/sha256_alt.c @@ -28,6 +28,7 @@ #include #include +#include #include /*! @@ -142,8 +143,11 @@ void mbedtls_sha256_clone(mbedtls_sha256_context * dst, const mbedtls_sha256_con int mbedtls_sha256_finish_ret(mbedtls_sha256_context * ctx, unsigned char output[32]) { int_fast16_t result; + uint32_t key; + key = HwiP_disable(); result = SHA2_finalize(ctx->hndl, output); + HwiP_restore(key); if (SHA2_STATUS_SUCCESS != result) { @@ -158,9 +162,12 @@ int mbedtls_sha256_finish_ret(mbedtls_sha256_context * ctx, unsigned char output int mbedtls_sha256_update_ret(mbedtls_sha256_context * ctx, const unsigned char * input, size_t ilen) { int_fast16_t result; + uint32_t key; + key = HwiP_disable(); // Process data in chunks. The driver buffers incomplete blocks internally. result = SHA2_addData(ctx->hndl, input, ilen); + HwiP_restore(key); if (SHA2_STATUS_SUCCESS != result) { @@ -175,9 +182,13 @@ int mbedtls_sha256_update_ret(mbedtls_sha256_context * ctx, const unsigned char int mbedtls_internal_sha256_process(mbedtls_sha256_context * ctx, const unsigned char data[64]) { int_fast16_t result; + uint32_t key; + + key = HwiP_disable(); // Process data in chunks. The driver buffers incomplete blocks internally. result = SHA2_addData(ctx->hndl, data, SHA2_BLOCK_SIZE_BYTES_256); + HwiP_restore(key); if (SHA2_STATUS_SUCCESS != result) { diff --git a/src/platform/cc13xx_26xx/cc13x4_26x4/openthread-core-cc13x4_26x4-config-check.h b/src/platform/cc13xx_26xx/cc13x4_26x4/openthread-core-cc13x4_26x4-config-check.h deleted file mode 100644 index a5fcac9459b6c4..00000000000000 --- a/src/platform/cc13xx_26xx/cc13x4_26x4/openthread-core-cc13x4_26x4-config-check.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#pragma once - -#if OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT -#error "Platform cc1352 doesn't support configuration option: OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT" -#endif diff --git a/src/platform/cc13xx_26xx/cc13x4_26x4/openthread-core-cc13x4_26x4-config.h b/src/platform/cc13xx_26xx/cc13x4_26x4/openthread-core-cc13x4_26x4-config.h deleted file mode 100644 index f1c575c1a82e11..00000000000000 --- a/src/platform/cc13xx_26xx/cc13x4_26x4/openthread-core-cc13x4_26x4-config.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2018, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#pragma once - -#ifdef DeviceFamily_CC13X4 - -/* Number of message buffers reduced to fit into CC26x2x3 RAM */ -#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 22 - -#endif // DeviceFamily_CC13X4 - -#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP - -// When operating in a less than ideal RF environment, having a more forgiving configuration -// of OpenThread makes thread a great deal more reliable. -#define OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_MAX_RETRY_DELAY 120 // default is 28800 -#define OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_DIRECT 15 // default is 3 -#define OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_INDIRECT 1 // default is 0 -#define OPENTHREAD_CONFIG_MAC_MAX_TX_ATTEMPTS_INDIRECT_POLLS 16 // default is 4 - -// Enable periodic parent search to speed up finding a better parent. -#define OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE 1 // default is 0 -#define OPENTHREAD_CONFIG_PARENT_SEARCH_RSS_THRESHOLD -45 // default is -65 -#define OPENTHREAD_CONFIG_MLE_INFORM_PREVIOUS_PARENT_ON_REATTACH 1 // default is 0 - -// Use smaller maximum interval to speed up reattaching. -#define OPENTHREAD_CONFIG_MLE_ATTACH_BACKOFF_MAXIMUM_INTERVAL (60 * 10 * 1000) // default 1200000 ms - -#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 -// #define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 0 -#define UART_AS_SERIAL_TRANSPORT 1 -#define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 1 - -#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 -#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 -#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 -#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 -#define OPENTHREAD_CONFIG_DNS_CLIENT_SERVICE_DISCOVERY_ENABLE 1 - -#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0 -#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 -#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 -#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 - -#define OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS 0 -// TCP disabled until OpenThread has a GN/Ninja build for the tcplp library -#define OPENTHREAD_CONFIG_TCP_ENABLE 0 diff --git a/third_party/openthread/platforms/cc13x4_26x4/BUILD.gn b/third_party/openthread/platforms/cc13x4_26x4/BUILD.gn deleted file mode 100644 index 64b0a813935f0e..00000000000000 --- a/third_party/openthread/platforms/cc13x4_26x4/BUILD.gn +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build_overrides/chip.gni") -import("//build_overrides/openthread.gni") -import("//build_overrides/ti_simplelink_sdk.gni") - -import("${ti_simplelink_sdk_build_root}/ti_simplelink_board.gni") -import("${ti_simplelink_sdk_build_root}/ti_simplelink_sdk.gni") - -openthread_ti_root = "${chip_root}/third_party/openthread/ot-ti" - -config("openthread_cc13x4_cc26x4_config") { - include_dirs = [ - "${openthread_root}/examples/platforms", - "${openthread_root}/src/core", - "${openthread_ti_root}/src", - ] -} - -source_set("libopenthread-cc13x4_cc26x4") { - cflags = [ - "-Wno-address-of-packed-member", - "-Wno-implicit-fallthrough", - "-Wno-unused-label", - ] - public_deps = [ - "${openthread_root}/src/core:libopenthread_core_headers", - "${ti_simplelink_sdk_build_root}:ti_simplelink_sdk", - "${ti_simplelink_sdk_build_root}:ti_simplelink_sysconfig", - ] - - configs -= [ "${build_root}/config/compiler:std_default" ] - configs += [ "${ti_simplelink_sdk_build_root}:ti_simplelink_posix_config" ] - - #configs += [ ":${sdk_target_name}_posix_config" ] - #configs += [ "${ti_simplelink_sdk_build_root}:ti_simplelink_sdk_posix_config" ] - sources = [ - #"${openthread_ti_root}/src/system.c", - "${openthread_root}/examples/platforms/utils/code_utils.h", - "${openthread_root}/examples/platforms/utils/link_metrics.cpp", - "${openthread_root}/examples/platforms/utils/link_metrics.h", - "${openthread_root}/examples/platforms/utils/mac_frame.cpp", - "${openthread_root}/examples/platforms/utils/mac_frame.h", - "${openthread_ti_root}/src/alarm.c", - "${openthread_ti_root}/src/alarm_micro.c", - "${openthread_ti_root}/src/diag.c", - "${openthread_ti_root}/src/entropy.c", - "${openthread_ti_root}/src/misc.c", - "${openthread_ti_root}/src/radio.c", - "${openthread_ti_root}/src/settings.c", - ] - - public_configs = [ - ":openthread_cc13x4_cc26x4_config", - "${openthread_root}:openthread_config", - ] - if (chip_openthread_ftd) { - public_configs += [ "${openthread_root}:openthread_ftd_config" ] - } else { - public_configs += [ "${openthread_root}:openthread_mtd_config" ] - } -} diff --git a/third_party/openthread/platforms/cc13x2_26x2/BUILD.gn b/third_party/openthread/platforms/ti/BUILD.gn similarity index 79% rename from third_party/openthread/platforms/cc13x2_26x2/BUILD.gn rename to third_party/openthread/platforms/ti/BUILD.gn index 476d0232fdf358..66a99a9d88df30 100644 --- a/third_party/openthread/platforms/cc13x2_26x2/BUILD.gn +++ b/third_party/openthread/platforms/ti/BUILD.gn @@ -19,17 +19,28 @@ import("//build_overrides/ti_simplelink_sdk.gni") import("${ti_simplelink_sdk_build_root}/ti_simplelink_board.gni") import("${ti_simplelink_sdk_build_root}/ti_simplelink_sdk.gni") +declare_args() { + ot_ti_lib_dir = "" +} + openthread_ti_root = "${chip_root}/third_party/openthread/ot-ti" -config("openthread_cc13x2_cc26x2_config") { +config("openthread_ti_config") { include_dirs = [ "${openthread_root}/examples/platforms", "${openthread_root}/src/core", "${openthread_ti_root}/src", ] + + public_configs = [ "${openthread_root}:openthread_config" ] + if (chip_openthread_ftd) { + public_configs += [ "${openthread_root}:openthread_ftd_config" ] + } else { + public_configs += [ "${openthread_root}:openthread_mtd_config" ] + } } -source_set("libopenthread-cc13x2_cc26x2") { +source_set("libopenthread-ti") { cflags = [ "-Wno-address-of-packed-member", "-Wno-implicit-fallthrough", @@ -44,10 +55,7 @@ source_set("libopenthread-cc13x2_cc26x2") { configs -= [ "${build_root}/config/compiler:std_default" ] configs += [ "${ti_simplelink_sdk_build_root}:ti_simplelink_posix_config" ] - #configs += [ ":${sdk_target_name}_posix_config" ] - #configs += [ "${ti_simplelink_sdk_build_root}:ti_simplelink_sdk_posix_config" ] sources = [ - #"${openthread_ti_root}/src/system.c", "${openthread_root}/examples/platforms/utils/code_utils.h", "${openthread_root}/examples/platforms/utils/link_metrics.cpp", "${openthread_root}/examples/platforms/utils/link_metrics.h", @@ -61,14 +69,26 @@ source_set("libopenthread-cc13x2_cc26x2") { "${openthread_ti_root}/src/radio.c", "${openthread_ti_root}/src/settings.c", ] - public_configs = [ - ":openthread_cc13x2_cc26x2_config", + ":openthread_ti_config", "${openthread_root}:openthread_config", ] +} + +source_set("ot-ti-cert") { + sources = [] + public_configs = [ ":openthread_ti_config" ] + deps = [ ":libopenthread-ti" ] + + if ("" != ot_ti_lib_dir) { + library_dir = ot_ti_lib_dir + } else { + library_dir = "${openthread_ti_root}/libs/${ti_simplelink_device_family}" + } + if (chip_openthread_ftd) { - public_configs += [ "${openthread_root}:openthread_ftd_config" ] + libs = [ "${library_dir}/libopenthread-ftd.a" ] } else { - public_configs += [ "${openthread_root}:openthread_mtd_config" ] + libs = [ "${library_dir}/libopenthread-mtd.a" ] } } diff --git a/third_party/ti_simplelink_sdk/ti_simplelink_sdk.gni b/third_party/ti_simplelink_sdk/ti_simplelink_sdk.gni index fe77dfc0033039..0698af16536e51 100644 --- a/third_party/ti_simplelink_sdk/ti_simplelink_sdk.gni +++ b/third_party/ti_simplelink_sdk/ti_simplelink_sdk.gni @@ -17,7 +17,6 @@ import("//build_overrides/chip.gni") import("//build_overrides/freertos.gni") import("//build_overrides/mbedtls.gni") -import("//build_overrides/openthread.gni") import("//build_overrides/pigweed.gni") import("//build_overrides/ti_simplelink_sdk.gni") import("${chip_root}/src/app/icd/icd.gni") @@ -353,14 +352,6 @@ template("ti_simplelink_sdk") { ] public_configs = [ ":${sdk_target_name}_config" ] - - if (chip_openthread_ftd) { - public_configs += - [ "${chip_root}/third_party/openthread/repo:openthread_ftd_config" ] - } else { - public_configs += - [ "${chip_root}/third_party/openthread/repo:openthread_mtd_config" ] - } } } @@ -517,13 +508,12 @@ template("ti_simplelink_sdk") { if (ti_simplelink_device_family == "cc13x4_26x4") { defines = [] include_dirs = [ - "${chip_root}/third_party/openthread/repo/include/", "${chip_root}/src/", + "${chip_root}/third_party/openthread/repo/include", ] configs -= [ "${build_root}/config/compiler:warnings_default" ] # removed for # -Wshadow - cflags = [ "-Wno-sign-compare", "-Wno-unused-variable", @@ -569,6 +559,7 @@ template("ti_simplelink_sdk") { public_configs = [ ":${sdk_target_name}_config", ":${sdk_target_name}_${ti_simplelink_device_family}_dmm_config", + "${chip_root}/third_party/openthread/platforms/ti:openthread_ti_config", ] } }