From bd9ea2897292a17608f377f7bf33a02a1325eb98 Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Wed, 27 Jul 2022 11:14:30 -0400 Subject: [PATCH 01/18] WIP build with ot-lib --- .gitmodules | 7 +- examples/lighting-app/efr32/BUILD.gn | 32 +++-- examples/platform/efr32/BUILD.gn | 8 +- examples/platform/efr32/init_efrPlatform.cpp | 10 +- src/inet/BUILD.gn | 17 ++- src/platform/EFR32/BUILD.gn | 20 ++- src/platform/EFR32/ThreadStackManagerImpl.cpp | 5 + src/platform/EFR32/args.gni | 10 +- third_party/openthread/ot-efr32 | 2 +- third_party/openthread/platforms/BUILD.gn | 1 + .../openthread/platforms/efr32/BUILD.gn | 2 + third_party/openthread/repo | 2 +- third_party/silabs/BUILD.gn | 128 ++++++++++++++++++ third_party/silabs/ot-efr32-libs.gni | 23 ++++ 14 files changed, 228 insertions(+), 39 deletions(-) create mode 100644 third_party/silabs/ot-efr32-libs.gni diff --git a/.gitmodules b/.gitmodules index 16d589e739d539..3f38531818eb5c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -33,8 +33,8 @@ branch = main [submodule "openthread"] path = third_party/openthread/repo - url = https://github.com/openthread/openthread.git - branch = main + url = https://github.com/SiliconLabs/openthread.git + branch = matter_sve [submodule "ot-br-posix"] path = third_party/ot-br-posix/repo url = https://github.com/openthread/ot-br-posix.git @@ -78,7 +78,8 @@ platforms = qpg [submodule "third_party/openthread/ot-efr32"] path = third_party/openthread/ot-efr32 - url = https://github.com/openthread/ot-efr32.git + url = https://github.com/SiliconLabs/ot-efr32.git + branch = matter_sve platforms = efr32 [submodule "third_party/openthread/ot-ifx"] path = third_party/openthread/ot-ifx diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index 9a9e4c15b8f33c..ed632706a11933 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -19,7 +19,9 @@ import("//build_overrides/pigweed.gni") import("${build_root}/config/defaults.gni") import("${efr32_sdk_build_root}/efr32_executable.gni") +import("${efr32_sdk_build_root}/efr32_board.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") +import("${efr32_sdk_build_root}/ot-efr32-libs.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") @@ -203,21 +205,31 @@ efr32_executable("lighting_app") { # OpenThread Settings if (chip_enable_openthread) { - deps += [ - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${examples_plat_dir}:efr-matter-shell", - ] - if (chip_openthread_ftd) { + if (use_thread_cert_lib) { + print("DEP use_thread_cert_lib") deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + "${efr32_sdk_build_root}:openthread_system", + "${efr32_sdk_build_root}:ot-efr32-cert", + "${examples_plat_dir}:efr-matter-shell", ] } else { + print("not thread cert lib") deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", + "${examples_plat_dir}:efr-matter-shell", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } } } diff --git a/examples/platform/efr32/BUILD.gn b/examples/platform/efr32/BUILD.gn index ba36aeff00c83b..e214a391b85b60 100644 --- a/examples/platform/efr32/BUILD.gn +++ b/examples/platform/efr32/BUILD.gn @@ -43,10 +43,16 @@ source_set("openthread_core_config_efr32_chip_examples") { sources = [ "project_include/OpenThreadConfig.h" ] public_deps = [ - "${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32", + #TOFIX + #"${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32", + "${chip_root}/third_party/silabs:openthread_core_config_efr32", "${efr32_sdk_build_root}:efr32_sdk", ] + defines = [ + "OPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"OpenThreadConfig.h\"", + ] + public_configs = [ ":chip_examples_project_config" ] } diff --git a/examples/platform/efr32/init_efrPlatform.cpp b/examples/platform/efr32/init_efrPlatform.cpp index f251f48f5dbab1..a6f206845623b5 100644 --- a/examples/platform/efr32/init_efrPlatform.cpp +++ b/examples/platform/efr32/init_efrPlatform.cpp @@ -64,7 +64,11 @@ void initAntenna(void); void init_efrPlatform(void) { +#if CHIP_ENABLE_OPENTHREAD + otSysInit(0, NULL); +#else sl_system_init(); +#endif sl_mbedtls_init(); #if DISPLAY_ENABLED @@ -74,12 +78,6 @@ void init_efrPlatform(void) #if EFR32_LOG_ENABLED efr32LogInit(); #endif - -#if CHIP_ENABLE_OPENTHREAD - efr32RadioInit(); - efr32AlarmInit(); - efr32MiscInit(); -#endif // CHIP_ENABLE_OPENTHREAD } #ifdef __cplusplus diff --git a/src/inet/BUILD.gn b/src/inet/BUILD.gn index 6e671c0f7b358e..948c30ee1f8aac 100644 --- a/src/inet/BUILD.gn +++ b/src/inet/BUILD.gn @@ -22,6 +22,7 @@ import("${chip_root}/build/chip/buildconfig_header.gni") import("${chip_root}/build/chip/tests.gni") import("${chip_root}/src/lwip/lwip.gni") import("${chip_root}/src/platform/device.gni") +import("${chip_root}/third_party/silabs/ot-efr32-libs.gni") import("inet.gni") if (chip_system_config_use_open_thread_inet_endpoints) { @@ -108,12 +109,18 @@ static_library("inet") { } if (chip_system_config_use_open_thread_inet_endpoints) { - if (chip_openthread_ftd) { - public_deps += - [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] + if (use_thread_cert_lib){ + public_deps += + [ "${chip_root}/third_party/silabs/:ot-efr32-cert" ] } else { - public_deps += - [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] + print(" SHOULD NOT BE HERE IN INET") + 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" ] + } } } diff --git a/src/platform/EFR32/BUILD.gn b/src/platform/EFR32/BUILD.gn index cf1b3b77bcec1c..3f1e446a4a5462 100644 --- a/src/platform/EFR32/BUILD.gn +++ b/src/platform/EFR32/BUILD.gn @@ -14,8 +14,10 @@ import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") +import("//build_overrides/efr32_sdk.gni") import("${chip_root}/src/platform/device.gni") +import("${efr32_sdk_build_root}/ot-efr32-libs.gni") import("${chip_root}/build/chip/buildconfig_header.gni") import("${chip_root}/src/crypto/crypto.gni") @@ -97,14 +99,20 @@ static_library("EFR32") { "$dir_pw_checksum", "$dir_pw_kvs", ] - if (chip_enable_openthread) { - if (chip_openthread_ftd) { - public_deps += - [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] + if (use_thread_cert_lib){ + public_deps += + [ "${efr32_sdk_build_root}:ot-efr32-cert" ] } else { - public_deps += - [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] + print("SHOULD NOT BE HERE IN src/platform/EFR32/build.gn") + public_deps += [ "${chip_root}/third_party/openthread/platforms:openthread_system"] + 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 += [ diff --git a/src/platform/EFR32/ThreadStackManagerImpl.cpp b/src/platform/EFR32/ThreadStackManagerImpl.cpp index a90db73b620d39..16d792276644e4 100644 --- a/src/platform/EFR32/ThreadStackManagerImpl.cpp +++ b/src/platform/EFR32/ThreadStackManagerImpl.cpp @@ -100,6 +100,11 @@ extern "C" void otPlatFree(void * aPtr) CHIPPlatformMemoryFree(aPtr); } +extern "C" __WEAK void sl_openthread_init(void) +{ + // Place holder for enabling Silabs specific features available only through Simplicity Studio +} + /** * @brief Openthread UART implementation for the CLI is conflicting * with the UART implemented for Pigweed RPC as they use the same UART port diff --git a/src/platform/EFR32/args.gni b/src/platform/EFR32/args.gni index a66bd28acf86ef..18e4e068df4ccb 100644 --- a/src/platform/EFR32/args.gni +++ b/src/platform/EFR32/args.gni @@ -15,7 +15,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") - +import("${efr32_sdk_build_root}/ot-efr32-libs.gni") import("${chip_root}/examples/platform/efr32/args.gni") import("${chip_root}/src/crypto/crypto.gni") @@ -43,13 +43,11 @@ chip_with_lwip = false chip_build_tests = false -openthread_core_config_platform_check_file = - "openthread-core-efr32-config-check.h" +# HOW TO FIX THIS? +openthread_core_config_platform_check_file = "openthread-core-efr32-config-check.h" openthread_project_core_config_file = "OpenThreadConfig.h" openthread_core_config_deps = [ "${chip_root}/examples/platform/efr32:openthread_core_config_efr32_chip_examples" ] - -openthread_external_platform = - "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" +#openthread_external_platform = "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" chip_config_memory_management = "platform" diff --git a/third_party/openthread/ot-efr32 b/third_party/openthread/ot-efr32 index 7a567da02a0785..f993e86d2d4fdb 160000 --- a/third_party/openthread/ot-efr32 +++ b/third_party/openthread/ot-efr32 @@ -1 +1 @@ -Subproject commit 7a567da02a078546eb34136c1c44170c8832dd55 +Subproject commit f993e86d2d4fdb3ee57410bbac54da75dc6870bc diff --git a/third_party/openthread/platforms/BUILD.gn b/third_party/openthread/platforms/BUILD.gn index 3e0e4d2da2dfc7..c4748e3b837182 100644 --- a/third_party/openthread/platforms/BUILD.gn +++ b/third_party/openthread/platforms/BUILD.gn @@ -41,6 +41,7 @@ source_set("libopenthread-platform") { } static_library("libopenthread-platform-utils") { + print("I SHOULDN'T BE HERE") sources = [ "${openthread_root}/examples/platforms/utils/code_utils.h", "${openthread_root}/examples/platforms/utils/debug_uart.c", diff --git a/third_party/openthread/platforms/efr32/BUILD.gn b/third_party/openthread/platforms/efr32/BUILD.gn index 140070a57b9d8a..77f2e0702ede83 100644 --- a/third_party/openthread/platforms/efr32/BUILD.gn +++ b/third_party/openthread/platforms/efr32/BUILD.gn @@ -48,6 +48,8 @@ source_set("openthread_core_config_efr32") { } source_set("libopenthread-efr32") { + + print("I SHOULD NOT USE libopenthread-efr32") sources = [ "${openthread_efr32_root}/src/src/alarm.c", "${openthread_efr32_root}/src/src/crypto.c", diff --git a/third_party/openthread/repo b/third_party/openthread/repo index 2ce3d3bf021856..12046001b12522 160000 --- a/third_party/openthread/repo +++ b/third_party/openthread/repo @@ -1 +1 @@ -Subproject commit 2ce3d3bf0218566484be2e9943b95c755cefebe3 +Subproject commit 12046001b125221342151f70eb3addb43faa479a diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index 718852a0a2f235..914e7d96e6a674 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -14,6 +14,8 @@ import("//build_overrides/efr32_sdk.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") +import("${efr32_sdk_build_root}/ot-efr32-libs.gni") +import("//build_overrides/jlink.gni") declare_args() { # Build target to use for efr32 SDK. Use this to set global SDK defines. @@ -25,3 +27,129 @@ assert(efr32_sdk_target != "", "efr32_sdk_target must be specified") group("efr32_sdk") { public_deps = [ efr32_sdk_target ] } + +if (use_thread_cert_lib) +{ + config("libopenthread-platform_config") { + include_dirs = [ "${sl_openthread_root}/examples/platforms" ] + } + + copy("copy_openthread_system") { + sources = [ "${sl_openthread_root}/examples/platforms/openthread-system.h" ] + + outputs = + [ "${root_gen_dir}/include/openthread/platform/{{source_file_part}}" ] + } + + source_set("openthread_system") { + sources = + [ "${root_gen_dir}/include/openthread/platform/openthread-system.h" ] + deps = [ ":copy_openthread_system" ] + } + + source_set("libopenthread-platform") { + sources = [ "${sl_openthread_root}/examples/platforms/openthread-system.h" ] + + public_deps = [ ":openthread_system" ] + + public_configs = [ ":libopenthread-platform_config" ] + } + + config("openthread_efr32_config") { + defines = [ + "RADIO_CONFIG_DMP_SUPPORT=1", + "${efr32_board}=1", + "${efr32_mcu}", + "USE_SL_THREAD_CERT_LIB", + "OPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE=\"openthread-core-efr32-config-check.h\"", + ] + + include_dirs = [ + "${chip_root}/examples/platform/efr32", + "${sdk_support_root}/matter/efr32/${efr32_family}/${efr32_board}", + "${sl_ot_efr32_root}/src/", + "${sl_ot_efr32_root}/src/cli", + "${sl_ot_efr32_root}/src/src", + ] + + } + + source_set("openthread_core_config_efr32") { + sources = [ + "${sl_ot_efr32_root}/src/src/openthread-core-efr32-config-check.h", + "${sl_ot_efr32_root}/src/src/openthread-core-efr32-config.h", + "${sl_openthread_root}/src/cli/cli_config.h", + ] + + public_deps = [ "${efr32_sdk_build_root}:efr32_sdk", ":libopenthread-platform", ] + + public_configs = [ ":openthread_efr32_config" ] + } + + + source_set("ot-efr32-cert") + { + include_dirs = [ + #"${sl_openthread_root}/src", + #"${sl_openthread_root}/src/cli", + #"${sl_openthread_root}/src/core", + #"${sl_openthread_root}/src/core/border_router", + #"${sl_openthread_root}/src/core/coap", + #"${sl_openthread_root}/src/core/common", + #"${sl_openthread_root}/src/core/config", + #"${sl_openthread_root}/src/core/crypto", + #"${sl_openthread_root}/src/core/diags", + #"${sl_openthread_root}/src/core/mac", + #"${sl_openthread_root}/src/core/meshcop", + #"${sl_openthread_root}/src/core/net", + #"${sl_openthread_root}/src/core/radio", + #"${sl_openthread_root}/src/core/thread", + #"${sl_openthread_root}/include/openthread", + #"${sl_openthread_root}/include/openthread/platform", + #"${sl_openthread_root}/examples/platforms", + ] + + sources = [ + #"${sl_openthread_root}/src/core/openthread-core-config.h", + #"${sl_openthread_root}/src/core/config/announce_sender.h", + #"${sl_openthread_root}/src/core/config/backbone_router.h", + #"${sl_openthread_root}/src/core/config/border_router.h" + #"${sl_openthread_root}/examples/platforms/openthread-system.h", + #"${sl_openthread_root}/examples/platforms/utils/code_utils.h", + #"${sl_openthread_root}/examples/platforms/utils/encoding.h", + #"${sl_openthread_root}/examples/platforms/utils/logging_rtt.h", + #"${sl_openthread_root}/examples/platforms/utils/mac_frame.h", + #"${sl_openthread_root}/examples/platforms/utils/settings.h", + #"${sl_openthread_root}/examples/platforms/utils/soft_source_match_table.h", + #"${sl_openthread_root}/examples/platforms/utils/uart.h", + #"${sl_openthread_root}/examples/apps/cli/cli_uart.cpp", + #"${sl_openthread_root}/src/cli/cli_config.h", + #"${sl_openthread_root}/src/cli/cli.cpp", + #"${sl_openthread_root}/src/cli/cli.hpp", + ] + + public_configs = [ + ":openthread_efr32_config", + ":libopenthread-platform_config", + ] + + public_deps = [ + ":openthread_core_config_efr32", + ":libopenthread-platform", + "${sl_openthread_root}/src/core/:libopenthread_core_headers", + "${segger_rtt_root}:segger_rtt", + ] + + deps = [ + "${efr32_sdk_build_root}:efr32_sdk", + ] + + # selected thread device type FTD or MTD + XTD = "ftd" + + libs = [ + "${sl_ot_efr32_root}/libs/libsl_ot_stack_${XTD}_${efr32_family}_gcc.a", + "${sl_ot_efr32_root}/libs/libsl_platform_${XTD}_${efr32_family}_gcc.a", + ] + } +} \ No newline at end of file diff --git a/third_party/silabs/ot-efr32-libs.gni b/third_party/silabs/ot-efr32-libs.gni new file mode 100644 index 00000000000000..5eb74462a70066 --- /dev/null +++ b/third_party/silabs/ot-efr32-libs.gni @@ -0,0 +1,23 @@ +# Copyright (c) 2022 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/efr32_sdk.gni") + +declare_args() { + # Enable the silabs openthread certified libs *IN CERTIFICATION PHASE* + use_thread_cert_lib = false + sl_ot_efr32_root = "${chip_root}/third_party/openthread/ot-efr32" + sl_openthread_root = "${chip_root}/third_party/openthread/repo" +} \ No newline at end of file From b4c35a35f105223aae9d3247ca48fa2176c06e9e Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Thu, 28 Jul 2022 09:45:06 -0400 Subject: [PATCH 02/18] WIP compile from lib or source --- examples/lighting-app/efr32/.gn | 2 + examples/platform/efr32/BUILD.gn | 23 +++++++--- examples/platform/efr32/init_efrPlatform.cpp | 3 +- scripts/examples/gn_efr32_example.sh | 5 +++ src/platform/EFR32/Logging.cpp | 46 ++++++++++---------- src/platform/EFR32/args.gni | 2 - third_party/silabs/BUILD.gn | 32 +++++++++++++- third_party/silabs/ot-efr32-libs.gni | 2 +- 8 files changed, 80 insertions(+), 35 deletions(-) diff --git a/examples/lighting-app/efr32/.gn b/examples/lighting-app/efr32/.gn index 0ff42d50e06ef0..99fe27c53705e6 100644 --- a/examples/lighting-app/efr32/.gn +++ b/examples/lighting-app/efr32/.gn @@ -13,6 +13,7 @@ # limitations under the License. import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") # The location of the build configuration file. buildconfig = "${build_root}/config/BUILDCONFIG.gn" @@ -24,5 +25,6 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_openthread_ftd = true + openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/examples/platform/efr32/BUILD.gn b/examples/platform/efr32/BUILD.gn index e214a391b85b60..6cc2ead6566e7f 100644 --- a/examples/platform/efr32/BUILD.gn +++ b/examples/platform/efr32/BUILD.gn @@ -16,6 +16,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") import("${chip_root}/src/lib/lib.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") +import("${efr32_sdk_build_root}/ot-efr32-libs.gni") config("chip_examples_project_config") { include_dirs = [ "project_include" ] @@ -42,12 +43,22 @@ config("chip_examples_project_config") { source_set("openthread_core_config_efr32_chip_examples") { sources = [ "project_include/OpenThreadConfig.h" ] - public_deps = [ - #TOFIX - #"${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32", - "${chip_root}/third_party/silabs:openthread_core_config_efr32", - "${efr32_sdk_build_root}:efr32_sdk", - ] + public_deps = [ "${efr32_sdk_build_root}:efr32_sdk" ] + + if (use_thread_cert_lib) + { + print("openthread_core_config_efr32_chip_examples cert") + public_deps += [ #TOFIX + "${chip_root}/third_party/silabs:openthread_core_config_efr32", + ] + } + else + { + print("openthread_core_config_efr32_chip_examples not cert") + public_deps += [ + "${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32", + ] + } defines = [ "OPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"OpenThreadConfig.h\"", diff --git a/examples/platform/efr32/init_efrPlatform.cpp b/examples/platform/efr32/init_efrPlatform.cpp index a6f206845623b5..14c1a7f889018e 100644 --- a/examples/platform/efr32/init_efrPlatform.cpp +++ b/examples/platform/efr32/init_efrPlatform.cpp @@ -76,7 +76,8 @@ void init_efrPlatform(void) #endif #if EFR32_LOG_ENABLED - efr32LogInit(); + // TO DO IF DEF + // efr32LogInit(); #endif } diff --git a/scripts/examples/gn_efr32_example.sh b/scripts/examples/gn_efr32_example.sh index 6882bba7d44d00..d88a5a4efa0b45 100755 --- a/scripts/examples/gn_efr32_example.sh +++ b/scripts/examples/gn_efr32_example.sh @@ -102,6 +102,7 @@ if [ "$#" == "0" ]; then build wifi example variant for given exansion board --additional_data_advertising enable Addition data advertissing and rotating device ID + --use_ot_lib " elif [ "$#" -lt "2" ]; then echo "Invalid number of arguments @@ -149,6 +150,10 @@ else optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true " shift ;; + --use_ot_lib) + optArgs+="use_thread_cert_lib=true openthread_external_platform=\"""\" " + shift + ;; *) if [ "$1" =~ *"use_rs911x=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then USE_WIFI=true diff --git a/src/platform/EFR32/Logging.cpp b/src/platform/EFR32/Logging.cpp index ad78dfae0a033a..249b64019e8479 100644 --- a/src/platform/EFR32/Logging.cpp +++ b/src/platform/EFR32/Logging.cpp @@ -104,25 +104,25 @@ static void PrintLog(const char * msg) /** * Initialize Segger RTT for logging */ -extern "C" void efr32LogInit(void) -{ -#if EFR32_LOG_ENABLED -#if LOG_RTT_BUFFER_INDEX != 0 - SEGGER_RTT_ConfigUpBuffer(LOG_RTT_BUFFER_INDEX, LOG_RTT_BUFFER_NAME, sLogBuffer, LOG_RTT_BUFFER_SIZE, - SEGGER_RTT_MODE_NO_BLOCK_TRIM); - - SEGGER_RTT_ConfigDownBuffer(LOG_RTT_BUFFER_INDEX, LOG_RTT_BUFFER_NAME, sCmdLineBuffer, LOG_RTT_BUFFER_SIZE, - SEGGER_RTT_MODE_NO_BLOCK_SKIP); -#else - SEGGER_RTT_SetFlagsUpBuffer(LOG_RTT_BUFFER_INDEX, SEGGER_RTT_MODE_NO_BLOCK_TRIM); -#endif - -#ifdef PW_RPC_ENABLED - PigweedLogger::init(); -#endif - sLogInitialized = true; -#endif // EFR32_LOG_ENABLED -} +// extern "C" void efr32LogInit(void) +// { +// #if EFR32_LOG_ENABLED +// #if LOG_RTT_BUFFER_INDEX != 0 +// SEGGER_RTT_ConfigUpBuffer(LOG_RTT_BUFFER_INDEX, LOG_RTT_BUFFER_NAME, sLogBuffer, LOG_RTT_BUFFER_SIZE, +// SEGGER_RTT_MODE_NO_BLOCK_TRIM); + +// SEGGER_RTT_ConfigDownBuffer(LOG_RTT_BUFFER_INDEX, LOG_RTT_BUFFER_NAME, sCmdLineBuffer, LOG_RTT_BUFFER_SIZE, +// SEGGER_RTT_MODE_NO_BLOCK_SKIP); +// #else +// SEGGER_RTT_SetFlagsUpBuffer(LOG_RTT_BUFFER_INDEX, SEGGER_RTT_MODE_NO_BLOCK_TRIM); +// #endif + +// #ifdef PW_RPC_ENABLED +// PigweedLogger::init(); +// #endif +// sLogInitialized = true; +// #endif // EFR32_LOG_ENABLED +// } /** * General-purpose logging function @@ -342,10 +342,10 @@ extern "C" void debugHardfault(uint32_t * sp) uint32_t psr = sp[7]; char formattedMsg[32]; - if (sLogInitialized == false) - { - efr32LogInit(); - } + // if (sLogInitialized == false) + // { + // efr32LogInit(); + // } snprintf(formattedMsg, sizeof formattedMsg, LOG_ERROR "HardFault:\n"); PrintLog(formattedMsg); diff --git a/src/platform/EFR32/args.gni b/src/platform/EFR32/args.gni index 18e4e068df4ccb..de7a0292eecda9 100644 --- a/src/platform/EFR32/args.gni +++ b/src/platform/EFR32/args.gni @@ -43,11 +43,9 @@ chip_with_lwip = false chip_build_tests = false -# HOW TO FIX THIS? openthread_core_config_platform_check_file = "openthread-core-efr32-config-check.h" openthread_project_core_config_file = "OpenThreadConfig.h" openthread_core_config_deps = [ "${chip_root}/examples/platform/efr32:openthread_core_config_efr32_chip_examples" ] -#openthread_external_platform = "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" chip_config_memory_management = "platform" diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index 914e7d96e6a674..e783e944a9a647 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -86,7 +86,6 @@ if (use_thread_cert_lib) public_configs = [ ":openthread_efr32_config" ] } - source_set("ot-efr32-cert") { include_dirs = [ @@ -110,6 +109,34 @@ if (use_thread_cert_lib) ] sources = [ + "${sl_openthread_root}/src/cli/cli.cpp", + "${sl_openthread_root}/src/cli/cli.hpp", + "${sl_openthread_root}/src/cli/cli_coap.cpp", + "${sl_openthread_root}/src/cli/cli_coap.hpp", + "${sl_openthread_root}/src/cli/cli_coap_secure.cpp", + "${sl_openthread_root}/src/cli/cli_coap_secure.hpp", + "${sl_openthread_root}/src/cli/cli_commissioner.cpp", + "${sl_openthread_root}/src/cli/cli_commissioner.hpp", + "${sl_openthread_root}/src/cli/cli_config.h", + "${sl_openthread_root}/src/cli/cli_dataset.cpp", + "${sl_openthread_root}/src/cli/cli_dataset.hpp", + "${sl_openthread_root}/src/cli/cli_history.cpp", + "${sl_openthread_root}/src/cli/cli_history.hpp", + "${sl_openthread_root}/src/cli/cli_joiner.cpp", + "${sl_openthread_root}/src/cli/cli_joiner.hpp", + "${sl_openthread_root}/src/cli/cli_network_data.cpp", + "${sl_openthread_root}/src/cli/cli_network_data.hpp", + "${sl_openthread_root}/src/cli/cli_output.cpp", + "${sl_openthread_root}/src/cli/cli_output.hpp", + "${sl_openthread_root}/src/cli/cli_srp_client.cpp", + "${sl_openthread_root}/src/cli/cli_srp_client.hpp", + "${sl_openthread_root}/src/cli/cli_srp_server.cpp", + "${sl_openthread_root}/src/cli/cli_srp_server.hpp", + "${sl_openthread_root}/src/cli/cli_tcp.cpp", + "${sl_openthread_root}/src/cli/cli_tcp.hpp", + "${sl_openthread_root}/src/cli/cli_udp.cpp", + "${sl_openthread_root}/src/cli/cli_udp.hpp", + "${sl_openthread_root}/src/cli/x509_cert_key.hpp", #"${sl_openthread_root}/src/core/openthread-core-config.h", #"${sl_openthread_root}/src/core/config/announce_sender.h", #"${sl_openthread_root}/src/core/config/backbone_router.h", @@ -122,7 +149,7 @@ if (use_thread_cert_lib) #"${sl_openthread_root}/examples/platforms/utils/settings.h", #"${sl_openthread_root}/examples/platforms/utils/soft_source_match_table.h", #"${sl_openthread_root}/examples/platforms/utils/uart.h", - #"${sl_openthread_root}/examples/apps/cli/cli_uart.cpp", + "${sl_openthread_root}/examples/apps/cli/cli_uart.cpp", #"${sl_openthread_root}/src/cli/cli_config.h", #"${sl_openthread_root}/src/cli/cli.cpp", #"${sl_openthread_root}/src/cli/cli.hpp", @@ -146,6 +173,7 @@ if (use_thread_cert_lib) # selected thread device type FTD or MTD XTD = "ftd" + public_configs += [ "${sl_openthread_root}:openthread_ftd_config" ] libs = [ "${sl_ot_efr32_root}/libs/libsl_ot_stack_${XTD}_${efr32_family}_gcc.a", diff --git a/third_party/silabs/ot-efr32-libs.gni b/third_party/silabs/ot-efr32-libs.gni index 5eb74462a70066..7a5cd1894635d8 100644 --- a/third_party/silabs/ot-efr32-libs.gni +++ b/third_party/silabs/ot-efr32-libs.gni @@ -19,5 +19,5 @@ declare_args() { # Enable the silabs openthread certified libs *IN CERTIFICATION PHASE* use_thread_cert_lib = false sl_ot_efr32_root = "${chip_root}/third_party/openthread/ot-efr32" - sl_openthread_root = "${chip_root}/third_party/openthread/repo" + sl_openthread_root = "${chip_root}/third_party/openthread/ot-efr32/openthread" } \ No newline at end of file From d3af12a7e8f7857a3442ce6cc9e3c64a3b3b9221 Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Fri, 29 Jul 2022 10:13:42 -0400 Subject: [PATCH 03/18] Fix and cleanup build system --- examples/chef/efr32/include/AppConfig.h | 2 +- .../efr32/include/AppConfig.h | 2 +- examples/lighting-app/efr32/BUILD.gn | 15 +++--- examples/lock-app/efr32/include/AppConfig.h | 2 +- .../efr32/include/AppConfig.h | 2 +- .../pigweed-app/efr32/include/AppConfig.h | 2 +- examples/platform/efr32/BUILD.gn | 12 ++--- examples/platform/efr32/efr32_utils.h | 2 +- examples/platform/efr32/init_efrPlatform.cpp | 3 +- examples/shell/efr32/include/AppConfig.h | 2 +- examples/window-app/efr32/include/AppConfig.h | 2 +- scripts/examples/gn_efr32_example.sh | 2 +- src/inet/BUILD.gn | 17 ++----- src/platform/BUILD.gn | 19 ++++++++ src/platform/EFR32/BUILD.gn | 18 ++------ src/platform/EFR32/Logging.cpp | 46 +++++++++---------- src/platform/EFR32/args.gni | 3 +- src/platform/device.gni | 2 + src/test_driver/efr32/include/AppConfig.h | 2 +- third_party/openthread/platforms/BUILD.gn | 1 - .../openthread/platforms/efr32/BUILD.gn | 2 - third_party/silabs/BUILD.gn | 9 ++-- third_party/silabs/ot-efr32-libs.gni | 23 ---------- 23 files changed, 80 insertions(+), 110 deletions(-) delete mode 100644 third_party/silabs/ot-efr32-libs.gni diff --git a/examples/chef/efr32/include/AppConfig.h b/examples/chef/efr32/include/AppConfig.h index 91501d889a6234..946b593cab50a4 100644 --- a/examples/chef/efr32/include/AppConfig.h +++ b/examples/chef/efr32/include/AppConfig.h @@ -32,7 +32,7 @@ extern "C" { #endif -void efr32LogInit(void); +void efr32InitLog(void); void efr32Log(const char * aFormat, ...); #define EFR32_LOG(...) efr32Log(__VA_ARGS__); diff --git a/examples/light-switch-app/efr32/include/AppConfig.h b/examples/light-switch-app/efr32/include/AppConfig.h index 91501d889a6234..946b593cab50a4 100644 --- a/examples/light-switch-app/efr32/include/AppConfig.h +++ b/examples/light-switch-app/efr32/include/AppConfig.h @@ -32,7 +32,7 @@ extern "C" { #endif -void efr32LogInit(void); +void efr32InitLog(void); void efr32Log(const char * aFormat, ...); #define EFR32_LOG(...) efr32Log(__VA_ARGS__); diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index ed632706a11933..0a34c78ef0a498 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -21,7 +21,6 @@ import("${build_root}/config/defaults.gni") import("${efr32_sdk_build_root}/efr32_executable.gni") import("${efr32_sdk_build_root}/efr32_board.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") -import("${efr32_sdk_build_root}/ot-efr32-libs.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") @@ -205,29 +204,27 @@ efr32_executable("lighting_app") { # OpenThread Settings if (chip_enable_openthread) { - if (use_thread_cert_lib) { - print("DEP use_thread_cert_lib") + deps += [ + "${chip_root}/src/platform:ot_device_deps", + "${examples_plat_dir}:efr-matter-shell", + ] + + if (chip_use_ot_lib) { deps += [ "${efr32_sdk_build_root}:openthread_system", - "${efr32_sdk_build_root}:ot-efr32-cert", - "${examples_plat_dir}:efr-matter-shell", ] } else { - print("not thread cert lib") deps += [ "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${examples_plat_dir}:efr-matter-shell", ] if (chip_openthread_ftd) { deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", ] } else { deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", ] } } diff --git a/examples/lock-app/efr32/include/AppConfig.h b/examples/lock-app/efr32/include/AppConfig.h index 852083cb9cbd91..096560abefe349 100644 --- a/examples/lock-app/efr32/include/AppConfig.h +++ b/examples/lock-app/efr32/include/AppConfig.h @@ -32,7 +32,7 @@ extern "C" { #endif -void efr32LogInit(void); +void efr32InitLog(void); void efr32Log(const char * aFormat, ...); #define EFR32_LOG(...) efr32Log(__VA_ARGS__); diff --git a/examples/persistent-storage/efr32/include/AppConfig.h b/examples/persistent-storage/efr32/include/AppConfig.h index 74a5ae90e43c83..ae2846d90c6caa 100644 --- a/examples/persistent-storage/efr32/include/AppConfig.h +++ b/examples/persistent-storage/efr32/include/AppConfig.h @@ -24,7 +24,7 @@ extern "C" { #endif -void efr32LogInit(void); +void efr32InitLog(void); void efr32Log(const char * aFormat, ...); #define EFR32_LOG(...) efr32Log(__VA_ARGS__); diff --git a/examples/pigweed-app/efr32/include/AppConfig.h b/examples/pigweed-app/efr32/include/AppConfig.h index 61a5430dafeeb8..8935b7f3bb7284 100644 --- a/examples/pigweed-app/efr32/include/AppConfig.h +++ b/examples/pigweed-app/efr32/include/AppConfig.h @@ -39,7 +39,7 @@ extern "C" { #endif -void efr32LogInit(void); +void efr32InitLog(void); void efr32Log(const char * aFormat, ...); #define EFR32_LOG(...) efr32Log(__VA_ARGS__); void appError(int err); diff --git a/examples/platform/efr32/BUILD.gn b/examples/platform/efr32/BUILD.gn index 6cc2ead6566e7f..e9ea275242c01f 100644 --- a/examples/platform/efr32/BUILD.gn +++ b/examples/platform/efr32/BUILD.gn @@ -15,8 +15,8 @@ import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") import("${chip_root}/src/lib/lib.gni") +import("${chip_root}/src/platform/device.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") -import("${efr32_sdk_build_root}/ot-efr32-libs.gni") config("chip_examples_project_config") { include_dirs = [ "project_include" ] @@ -45,25 +45,19 @@ source_set("openthread_core_config_efr32_chip_examples") { public_deps = [ "${efr32_sdk_build_root}:efr32_sdk" ] - if (use_thread_cert_lib) + if (chip_use_ot_lib == true) { - print("openthread_core_config_efr32_chip_examples cert") - public_deps += [ #TOFIX + public_deps += [ "${chip_root}/third_party/silabs:openthread_core_config_efr32", ] } else { - print("openthread_core_config_efr32_chip_examples not cert") public_deps += [ "${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32", ] } - defines = [ - "OPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"OpenThreadConfig.h\"", - ] - public_configs = [ ":chip_examples_project_config" ] } diff --git a/examples/platform/efr32/efr32_utils.h b/examples/platform/efr32/efr32_utils.h index 610bde3e4e2511..98087091d9c0e9 100644 --- a/examples/platform/efr32/efr32_utils.h +++ b/examples/platform/efr32/efr32_utils.h @@ -24,7 +24,7 @@ extern "C" { #endif -void efr32LogInit(void); +void efr32InitLog(void); void efr32Log(const char * aFormat, ...); #define EFR32_LOG(...) efr32Log(__VA_ARGS__); diff --git a/examples/platform/efr32/init_efrPlatform.cpp b/examples/platform/efr32/init_efrPlatform.cpp index 14c1a7f889018e..0e81e5dcd74dad 100644 --- a/examples/platform/efr32/init_efrPlatform.cpp +++ b/examples/platform/efr32/init_efrPlatform.cpp @@ -76,8 +76,7 @@ void init_efrPlatform(void) #endif #if EFR32_LOG_ENABLED - // TO DO IF DEF - // efr32LogInit(); + efr32InitLog(); #endif } diff --git a/examples/shell/efr32/include/AppConfig.h b/examples/shell/efr32/include/AppConfig.h index a14ec9f589f735..743c6eddbb18ad 100644 --- a/examples/shell/efr32/include/AppConfig.h +++ b/examples/shell/efr32/include/AppConfig.h @@ -54,7 +54,7 @@ extern "C" { #endif -void efr32LogInit(void); +void efr32InitLog(void); void efr32Log(const char * aFormat, ...); #define EFR32_LOG(...) efr32Log(__VA_ARGS__); diff --git a/examples/window-app/efr32/include/AppConfig.h b/examples/window-app/efr32/include/AppConfig.h index d8a68d9982e4b8..a9957cf77b5bb9 100644 --- a/examples/window-app/efr32/include/AppConfig.h +++ b/examples/window-app/efr32/include/AppConfig.h @@ -57,7 +57,7 @@ extern "C" { #define COVER_LIFT_TILT_TIMEOUT 500 #endif -void efr32LogInit(void); +void efr32InitLog(void); void efr32Log(const char * aFormat, ...); #define EFR32_LOG(...) efr32Log(__VA_ARGS__); diff --git a/scripts/examples/gn_efr32_example.sh b/scripts/examples/gn_efr32_example.sh index d88a5a4efa0b45..3d750eadbac739 100755 --- a/scripts/examples/gn_efr32_example.sh +++ b/scripts/examples/gn_efr32_example.sh @@ -151,7 +151,7 @@ else shift ;; --use_ot_lib) - optArgs+="use_thread_cert_lib=true openthread_external_platform=\"""\" " + optArgs+="chip_use_ot_lib=true openthread_external_platform=\"""\" " shift ;; *) diff --git a/src/inet/BUILD.gn b/src/inet/BUILD.gn index 948c30ee1f8aac..7e0e227953fb02 100644 --- a/src/inet/BUILD.gn +++ b/src/inet/BUILD.gn @@ -22,7 +22,6 @@ import("${chip_root}/build/chip/buildconfig_header.gni") import("${chip_root}/build/chip/tests.gni") import("${chip_root}/src/lwip/lwip.gni") import("${chip_root}/src/platform/device.gni") -import("${chip_root}/third_party/silabs/ot-efr32-libs.gni") import("inet.gni") if (chip_system_config_use_open_thread_inet_endpoints) { @@ -109,19 +108,9 @@ static_library("inet") { } if (chip_system_config_use_open_thread_inet_endpoints) { - if (use_thread_cert_lib){ - public_deps += - [ "${chip_root}/third_party/silabs/:ot-efr32-cert" ] - } else { - print(" SHOULD NOT BE HERE IN INET") - 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" ] - } - } + public_deps += [ + "${chip_root}/src/platform:ot_device_deps", + ] } if (chip_inet_config_enable_tcp_endpoint) { diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index 31e25b41a6a5df..c85a7f076cd29c 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -457,3 +457,22 @@ if (chip_device_platform != "none") { public_deps = [ ":platform_buildconfig" ] } } + +if (chip_enable_openthread) +{ + group("ot_device_deps") + { + if (chip_use_ot_lib){ + assert(chip_ot_lib_source_set != "", "Provide the location of your ot lib source set using the arg chip_ot_lib_source_set") + public_deps = chip_ot_lib_source_set + } else { + 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" ] + } + } + } +} \ No newline at end of file diff --git a/src/platform/EFR32/BUILD.gn b/src/platform/EFR32/BUILD.gn index 3f1e446a4a5462..4ef688604226c1 100644 --- a/src/platform/EFR32/BUILD.gn +++ b/src/platform/EFR32/BUILD.gn @@ -17,7 +17,6 @@ import("//build_overrides/pigweed.gni") import("//build_overrides/efr32_sdk.gni") import("${chip_root}/src/platform/device.gni") -import("${efr32_sdk_build_root}/ot-efr32-libs.gni") import("${chip_root}/build/chip/buildconfig_header.gni") import("${chip_root}/src/crypto/crypto.gni") @@ -100,19 +99,12 @@ static_library("EFR32") { "$dir_pw_kvs", ] if (chip_enable_openthread) { - if (use_thread_cert_lib){ - public_deps += - [ "${efr32_sdk_build_root}:ot-efr32-cert" ] - } else { - print("SHOULD NOT BE HERE IN src/platform/EFR32/build.gn") + public_deps += [ + "${chip_root}/src/platform:ot_device_deps", + ] + + if (chip_use_ot_lib == false){ public_deps += [ "${chip_root}/third_party/openthread/platforms:openthread_system"] - 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 += [ diff --git a/src/platform/EFR32/Logging.cpp b/src/platform/EFR32/Logging.cpp index 249b64019e8479..ad0711fe930961 100644 --- a/src/platform/EFR32/Logging.cpp +++ b/src/platform/EFR32/Logging.cpp @@ -104,25 +104,25 @@ static void PrintLog(const char * msg) /** * Initialize Segger RTT for logging */ -// extern "C" void efr32LogInit(void) -// { -// #if EFR32_LOG_ENABLED -// #if LOG_RTT_BUFFER_INDEX != 0 -// SEGGER_RTT_ConfigUpBuffer(LOG_RTT_BUFFER_INDEX, LOG_RTT_BUFFER_NAME, sLogBuffer, LOG_RTT_BUFFER_SIZE, -// SEGGER_RTT_MODE_NO_BLOCK_TRIM); - -// SEGGER_RTT_ConfigDownBuffer(LOG_RTT_BUFFER_INDEX, LOG_RTT_BUFFER_NAME, sCmdLineBuffer, LOG_RTT_BUFFER_SIZE, -// SEGGER_RTT_MODE_NO_BLOCK_SKIP); -// #else -// SEGGER_RTT_SetFlagsUpBuffer(LOG_RTT_BUFFER_INDEX, SEGGER_RTT_MODE_NO_BLOCK_TRIM); -// #endif - -// #ifdef PW_RPC_ENABLED -// PigweedLogger::init(); -// #endif -// sLogInitialized = true; -// #endif // EFR32_LOG_ENABLED -// } +extern "C" void efr32InitLog(void) +{ +#if EFR32_LOG_ENABLED +#if LOG_RTT_BUFFER_INDEX != 0 + SEGGER_RTT_ConfigUpBuffer(LOG_RTT_BUFFER_INDEX, LOG_RTT_BUFFER_NAME, sLogBuffer, LOG_RTT_BUFFER_SIZE, + SEGGER_RTT_MODE_NO_BLOCK_TRIM); + + SEGGER_RTT_ConfigDownBuffer(LOG_RTT_BUFFER_INDEX, LOG_RTT_BUFFER_NAME, sCmdLineBuffer, LOG_RTT_BUFFER_SIZE, + SEGGER_RTT_MODE_NO_BLOCK_SKIP); +#else + SEGGER_RTT_SetFlagsUpBuffer(LOG_RTT_BUFFER_INDEX, SEGGER_RTT_MODE_NO_BLOCK_TRIM); +#endif + +#ifdef PW_RPC_ENABLED + PigweedLogger::init(); +#endif + sLogInitialized = true; +#endif // EFR32_LOG_ENABLED +} /** * General-purpose logging function @@ -342,10 +342,10 @@ extern "C" void debugHardfault(uint32_t * sp) uint32_t psr = sp[7]; char formattedMsg[32]; - // if (sLogInitialized == false) - // { - // efr32LogInit(); - // } + if (sLogInitialized == false) + { + efr32InitLog(); + } snprintf(formattedMsg, sizeof formattedMsg, LOG_ERROR "HardFault:\n"); PrintLog(formattedMsg); diff --git a/src/platform/EFR32/args.gni b/src/platform/EFR32/args.gni index de7a0292eecda9..8beca3324623cf 100644 --- a/src/platform/EFR32/args.gni +++ b/src/platform/EFR32/args.gni @@ -15,7 +15,6 @@ import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") -import("${efr32_sdk_build_root}/ot-efr32-libs.gni") import("${chip_root}/examples/platform/efr32/args.gni") import("${chip_root}/src/crypto/crypto.gni") @@ -47,6 +46,8 @@ openthread_core_config_platform_check_file = "openthread-core-efr32-config-check openthread_project_core_config_file = "OpenThreadConfig.h" openthread_core_config_deps = [ "${chip_root}/examples/platform/efr32:openthread_core_config_efr32_chip_examples" ] +chip_ot_lib_source_set = [ "${efr32_sdk_build_root}:ot-efr32-cert" ] + chip_config_memory_management = "platform" pw_build_LINK_DEPS = [ diff --git a/src/platform/device.gni b/src/platform/device.gni index 0592a6720e13c0..9b87a4f5ecb692 100755 --- a/src/platform/device.gni +++ b/src/platform/device.gni @@ -56,6 +56,8 @@ declare_args() { declare_args() { chip_openthread_ftd = chip_enable_openthread + chip_use_ot_lib = false + chip_ot_lib_source_set = "" # Enable wifi support. chip_enable_wifi = diff --git a/src/test_driver/efr32/include/AppConfig.h b/src/test_driver/efr32/include/AppConfig.h index 302dba47799e5e..3b83d375b46219 100644 --- a/src/test_driver/efr32/include/AppConfig.h +++ b/src/test_driver/efr32/include/AppConfig.h @@ -25,7 +25,7 @@ extern "C" { #endif -void efr32LogInit(void); +void efr32InitLog(void); void efr32Log(const char * aFormat, ...); #define EFR32_LOG(...) efr32Log(__VA_ARGS__); void appError(int err); diff --git a/third_party/openthread/platforms/BUILD.gn b/third_party/openthread/platforms/BUILD.gn index c4748e3b837182..3e0e4d2da2dfc7 100644 --- a/third_party/openthread/platforms/BUILD.gn +++ b/third_party/openthread/platforms/BUILD.gn @@ -41,7 +41,6 @@ source_set("libopenthread-platform") { } static_library("libopenthread-platform-utils") { - print("I SHOULDN'T BE HERE") sources = [ "${openthread_root}/examples/platforms/utils/code_utils.h", "${openthread_root}/examples/platforms/utils/debug_uart.c", diff --git a/third_party/openthread/platforms/efr32/BUILD.gn b/third_party/openthread/platforms/efr32/BUILD.gn index 77f2e0702ede83..140070a57b9d8a 100644 --- a/third_party/openthread/platforms/efr32/BUILD.gn +++ b/third_party/openthread/platforms/efr32/BUILD.gn @@ -48,8 +48,6 @@ source_set("openthread_core_config_efr32") { } source_set("libopenthread-efr32") { - - print("I SHOULD NOT USE libopenthread-efr32") sources = [ "${openthread_efr32_root}/src/src/alarm.c", "${openthread_efr32_root}/src/src/crypto.c", diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index e783e944a9a647..455cf470b4acf6 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -12,14 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//build_overrides/chip.gni") +import("//build_overrides/jlink.gni") import("//build_overrides/efr32_sdk.gni") +import("${chip_root}/src/platform/device.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") -import("${efr32_sdk_build_root}/ot-efr32-libs.gni") -import("//build_overrides/jlink.gni") declare_args() { # Build target to use for efr32 SDK. Use this to set global SDK defines. efr32_sdk_target = "" + sl_ot_efr32_root = "${chip_root}/third_party/openthread/ot-efr32" + sl_openthread_root = "${chip_root}/third_party/openthread/ot-efr32/openthread" } assert(efr32_sdk_target != "", "efr32_sdk_target must be specified") @@ -28,7 +31,7 @@ group("efr32_sdk") { public_deps = [ efr32_sdk_target ] } -if (use_thread_cert_lib) +if (chip_use_ot_lib) { config("libopenthread-platform_config") { include_dirs = [ "${sl_openthread_root}/examples/platforms" ] diff --git a/third_party/silabs/ot-efr32-libs.gni b/third_party/silabs/ot-efr32-libs.gni deleted file mode 100644 index 7a5cd1894635d8..00000000000000 --- a/third_party/silabs/ot-efr32-libs.gni +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2022 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/efr32_sdk.gni") - -declare_args() { - # Enable the silabs openthread certified libs *IN CERTIFICATION PHASE* - use_thread_cert_lib = false - sl_ot_efr32_root = "${chip_root}/third_party/openthread/ot-efr32" - sl_openthread_root = "${chip_root}/third_party/openthread/ot-efr32/openthread" -} \ No newline at end of file From ba25d9af5c80afb94176dd992b05da6d8743e12a Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Fri, 29 Jul 2022 15:34:39 -0400 Subject: [PATCH 04/18] Fix efr32 path to internal thread source without breaking other platforms. Add new ot support to all efr32 examples --- .gitmodules | 3 +- examples/chef/efr32/.gn | 3 +- examples/chef/efr32/BUILD.gn | 28 +++++++++---- examples/light-switch-app/efr32/.gn | 2 + examples/light-switch-app/efr32/BUILD.gn | 28 +++++++++---- examples/lighting-app/efr32/BUILD.gn | 8 +++- examples/lock-app/efr32/.gn | 2 + examples/lock-app/efr32/BUILD.gn | 28 +++++++++---- examples/window-app/efr32/.gn | 2 + examples/window-app/efr32/BUILD.gn | 28 +++++++++---- src/platform/BUILD.gn | 4 +- src/platform/EFR32/args.gni | 1 + src/test_driver/efr32/.gn | 3 +- src/test_driver/efr32/BUILD.gn | 35 ++++++++++++---- .../openthread/platforms/efr32/BUILD.gn | 6 +-- third_party/openthread/repo | 2 +- third_party/silabs/BUILD.gn | 42 +++---------------- 17 files changed, 136 insertions(+), 89 deletions(-) diff --git a/.gitmodules b/.gitmodules index 3f38531818eb5c..b88a992fc3f0b9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -33,8 +33,7 @@ branch = main [submodule "openthread"] path = third_party/openthread/repo - url = https://github.com/SiliconLabs/openthread.git - branch = matter_sve + url = https://github.com/openthread/openthread.git [submodule "ot-br-posix"] path = third_party/ot-br-posix/repo url = https://github.com/openthread/ot-br-posix.git diff --git a/examples/chef/efr32/.gn b/examples/chef/efr32/.gn index 0ff42d50e06ef0..a08dc58656fd7d 100644 --- a/examples/chef/efr32/.gn +++ b/examples/chef/efr32/.gn @@ -13,7 +13,7 @@ # limitations under the License. import("//build_overrides/build.gni") - +import("//build_overrides/chip.gni") # The location of the build configuration file. buildconfig = "${build_root}/config/BUILDCONFIG.gn" @@ -24,5 +24,6 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_openthread_ftd = true + openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/examples/chef/efr32/BUILD.gn b/examples/chef/efr32/BUILD.gn index e938574e195aa6..023e3074a860d4 100644 --- a/examples/chef/efr32/BUILD.gn +++ b/examples/chef/efr32/BUILD.gn @@ -27,6 +27,10 @@ import("${chip_root}/src/platform/device.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/app/chip_data_model.gni") +if(chip_enable_openthread){ + import("//build_overrides/openthread.gni") +} + if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") import("$dir_pw_build/target_types.gni") @@ -205,21 +209,29 @@ efr32_executable("chef_app") { # OpenThread Settings if (chip_enable_openthread) { - deps += [ - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", + deps += [ + "${chip_root}/src/platform:ot_device_deps", "${examples_plat_dir}:efr-matter-shell", ] - if (chip_openthread_ftd) { + + if (chip_use_ot_lib) { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + "${efr32_sdk_build_root}:openthread_system", ] } else { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", ] + if (chip_openthread_ftd) { + deps += [ + "${openthread_root}:libopenthread-cli-ftd", + ] + } else { + deps += [ + "${openthread_root}:libopenthread-cli-mtd", + ] + } } } diff --git a/examples/light-switch-app/efr32/.gn b/examples/light-switch-app/efr32/.gn index 0ff42d50e06ef0..99fe27c53705e6 100644 --- a/examples/light-switch-app/efr32/.gn +++ b/examples/light-switch-app/efr32/.gn @@ -13,6 +13,7 @@ # limitations under the License. import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") # The location of the build configuration file. buildconfig = "${build_root}/config/BUILDCONFIG.gn" @@ -24,5 +25,6 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_openthread_ftd = true + openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/examples/light-switch-app/efr32/BUILD.gn b/examples/light-switch-app/efr32/BUILD.gn index b3fb8fdd5b86c8..44468cc2c22653 100644 --- a/examples/light-switch-app/efr32/BUILD.gn +++ b/examples/light-switch-app/efr32/BUILD.gn @@ -24,6 +24,10 @@ import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") +if(chip_enable_openthread){ + import("//build_overrides/openthread.gni") +} + if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") import("$dir_pw_build/target_types.gni") @@ -198,21 +202,29 @@ efr32_executable("light_switch_app") { # OpenThread Settings if (chip_enable_openthread) { - deps += [ - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", + deps += [ + "${chip_root}/src/platform:ot_device_deps", "${examples_plat_dir}:efr-matter-shell", ] - if (chip_openthread_ftd) { + + if (chip_use_ot_lib) { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + "${efr32_sdk_build_root}:openthread_system", ] } else { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", ] + if (chip_openthread_ftd) { + deps += [ + "${openthread_root}:libopenthread-cli-ftd", + ] + } else { + deps += [ + "$${openthread_root}:libopenthread-cli-mtd", + ] + } } } diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index 0a34c78ef0a498..3a8553ed7229b3 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -25,6 +25,10 @@ import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") +if(chip_enable_openthread){ + import("//build_overrides/openthread.gni") +} + if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") import("$dir_pw_build/target_types.gni") @@ -220,11 +224,11 @@ efr32_executable("lighting_app") { ] if (chip_openthread_ftd) { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${openthread_root}:libopenthread-cli-ftd", ] } else { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${openthread_root}:libopenthread-cli-mtd", ] } } diff --git a/examples/lock-app/efr32/.gn b/examples/lock-app/efr32/.gn index 0ff42d50e06ef0..99fe27c53705e6 100644 --- a/examples/lock-app/efr32/.gn +++ b/examples/lock-app/efr32/.gn @@ -13,6 +13,7 @@ # limitations under the License. import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") # The location of the build configuration file. buildconfig = "${build_root}/config/BUILDCONFIG.gn" @@ -24,5 +25,6 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_openthread_ftd = true + openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index a739b266110543..6299083ad479b3 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -24,6 +24,10 @@ import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") +if(chip_enable_openthread){ + import("//build_overrides/openthread.gni") +} + if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") import("$dir_pw_build/target_types.gni") @@ -200,21 +204,29 @@ efr32_executable("lock_app") { # OpenThread Settings if (chip_enable_openthread) { - deps += [ - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", + deps += [ + "${chip_root}/src/platform:ot_device_deps", "${examples_plat_dir}:efr-matter-shell", ] - if (chip_openthread_ftd) { + + if (chip_use_ot_lib) { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + "${efr32_sdk_build_root}:openthread_system", ] } else { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", ] + if (chip_openthread_ftd) { + deps += [ + "${openthread_root}:libopenthread-cli-ftd", + ] + } else { + deps += [ + "${openthread_root}:libopenthread-cli-mtd", + ] + } } } diff --git a/examples/window-app/efr32/.gn b/examples/window-app/efr32/.gn index 0ff42d50e06ef0..99fe27c53705e6 100644 --- a/examples/window-app/efr32/.gn +++ b/examples/window-app/efr32/.gn @@ -13,6 +13,7 @@ # limitations under the License. import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") # The location of the build configuration file. buildconfig = "${build_root}/config/BUILDCONFIG.gn" @@ -24,5 +25,6 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_openthread_ftd = true + openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/examples/window-app/efr32/BUILD.gn b/examples/window-app/efr32/BUILD.gn index fad09d7f4d3ce7..98be3b8c5dfca5 100644 --- a/examples/window-app/efr32/BUILD.gn +++ b/examples/window-app/efr32/BUILD.gn @@ -24,6 +24,10 @@ import("${efr32_sdk_build_root}/efr32_sdk.gni") assert(current_os == "freertos") +if(chip_enable_openthread){ + import("//build_overrides/openthread.gni") +} + project_dir = "${chip_root}/examples/window-app" efr32_project_dir = "${project_dir}/efr32" examples_plat_dir = "${chip_root}/examples/platform/efr32" @@ -186,21 +190,29 @@ efr32_executable("window_app") { # OpenThread Settings if (chip_enable_openthread) { - deps += [ - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", + deps += [ + "${chip_root}/src/platform:ot_device_deps", "${examples_plat_dir}:efr-matter-shell", ] - if (chip_openthread_ftd) { + + if (chip_use_ot_lib) { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + "${efr32_sdk_build_root}:openthread_system", ] } else { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", ] + if (chip_openthread_ftd) { + deps += [ + "${openthread_root}:libopenthread-cli-ftd", + ] + } else { + deps += [ + "$${openthread_root}:libopenthread-cli-mtd", + ] + } } } diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index c85a7f076cd29c..cb452e005e1684 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -468,10 +468,10 @@ if (chip_enable_openthread) } else { if (chip_openthread_ftd) { public_deps = - [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] + [ "${openthread_root}:libopenthread-ftd" ] } else { public_deps = - [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] + [ "${openthread_root}:libopenthread-mtd" ] } } } diff --git a/src/platform/EFR32/args.gni b/src/platform/EFR32/args.gni index 8beca3324623cf..6a4ba52f9c64c6 100644 --- a/src/platform/EFR32/args.gni +++ b/src/platform/EFR32/args.gni @@ -42,6 +42,7 @@ chip_with_lwip = false chip_build_tests = false +openthread_root = "${chip_root}/third_party/openthread/ot-efr32/openthread" openthread_core_config_platform_check_file = "openthread-core-efr32-config-check.h" openthread_project_core_config_file = "OpenThreadConfig.h" openthread_core_config_deps = [ "${chip_root}/examples/platform/efr32:openthread_core_config_efr32_chip_examples" ] diff --git a/src/test_driver/efr32/.gn b/src/test_driver/efr32/.gn index 81cec9d11a421b..a69e19bfce4890 100644 --- a/src/test_driver/efr32/.gn +++ b/src/test_driver/efr32/.gn @@ -13,6 +13,7 @@ # limitations under the License. import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") # The location of the build configuration file. buildconfig = "${build_root}/config/BUILDCONFIG.gn" @@ -23,6 +24,6 @@ check_system_includes = true default_args = { target_cpu = "arm" target_os = "freertos" - + openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/src/test_driver/efr32/BUILD.gn b/src/test_driver/efr32/BUILD.gn index d794b4b0ef2485..0db7131501ecd7 100644 --- a/src/test_driver/efr32/BUILD.gn +++ b/src/test_driver/efr32/BUILD.gn @@ -16,6 +16,7 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") +import("//build_overrides/openthread.gni") import("${build_root}/config/defaults.gni") import("${efr32_sdk_build_root}/efr32_executable.gni") @@ -94,16 +95,32 @@ efr32_executable("efr32_device_tests") { "${nlunit_test_root}:nlunit-test", ] - if (chip_openthread_ftd) { - deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", - ] - } else { - deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + # OpenThread Settings + if (chip_enable_openthread) { + deps += [ + "${chip_root}/src/platform:ot_device_deps", + "${examples_plat_dir}:efr-matter-shell", ] + + if (chip_use_ot_lib) { + deps += [ + "${efr32_sdk_build_root}:openthread_system", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", + ] + if (chip_openthread_ftd) { + deps += [ + "${openthread_root}:libopenthread-cli-ftd", + ] + } else { + deps += [ + "$${openthread_root}:libopenthread-cli-mtd", + ] + } + } } deps += pw_build_LINK_DEPS diff --git a/third_party/openthread/platforms/efr32/BUILD.gn b/third_party/openthread/platforms/efr32/BUILD.gn index 140070a57b9d8a..178e9b0fb66fd0 100644 --- a/third_party/openthread/platforms/efr32/BUILD.gn +++ b/third_party/openthread/platforms/efr32/BUILD.gn @@ -39,7 +39,7 @@ source_set("openthread_core_config_efr32") { sources = [ "${openthread_efr32_root}/src/src/openthread-core-efr32-config-check.h", "${openthread_efr32_root}/src/src/openthread-core-efr32-config.h", - "${openthread_root}/src/cli/cli_config.h", + "${openthread_efr32_root}/openthread/src/cli/cli_config.h", ] public_deps = [ "${efr32_sdk_build_root}:efr32_sdk" ] @@ -58,12 +58,12 @@ source_set("libopenthread-efr32") { "${openthread_efr32_root}/src/src/security_manager.c", "${openthread_efr32_root}/src/src/sleep.c", "${openthread_efr32_root}/src/src/system.c", - "${openthread_root}/examples/apps/cli/cli_uart.cpp", + "${openthread_efr32_root}/openthread/examples/apps/cli/cli_uart.cpp", ] public_deps = [ ":openthread_core_config_efr32", - "${openthread_root}/src/core:libopenthread_core_headers", + "${openthread_efr32_root}/openthread/src/core:libopenthread_core_headers", "..:libopenthread-platform", "..:libopenthread-platform-utils", ] diff --git a/third_party/openthread/repo b/third_party/openthread/repo index 12046001b12522..2ce3d3bf021856 160000 --- a/third_party/openthread/repo +++ b/third_party/openthread/repo @@ -1 +1 @@ -Subproject commit 12046001b125221342151f70eb3addb43faa479a +Subproject commit 2ce3d3bf0218566484be2e9943b95c755cefebe3 diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index 455cf470b4acf6..3180d3f3db5684 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -91,26 +91,6 @@ if (chip_use_ot_lib) source_set("ot-efr32-cert") { - include_dirs = [ - #"${sl_openthread_root}/src", - #"${sl_openthread_root}/src/cli", - #"${sl_openthread_root}/src/core", - #"${sl_openthread_root}/src/core/border_router", - #"${sl_openthread_root}/src/core/coap", - #"${sl_openthread_root}/src/core/common", - #"${sl_openthread_root}/src/core/config", - #"${sl_openthread_root}/src/core/crypto", - #"${sl_openthread_root}/src/core/diags", - #"${sl_openthread_root}/src/core/mac", - #"${sl_openthread_root}/src/core/meshcop", - #"${sl_openthread_root}/src/core/net", - #"${sl_openthread_root}/src/core/radio", - #"${sl_openthread_root}/src/core/thread", - #"${sl_openthread_root}/include/openthread", - #"${sl_openthread_root}/include/openthread/platform", - #"${sl_openthread_root}/examples/platforms", - ] - sources = [ "${sl_openthread_root}/src/cli/cli.cpp", "${sl_openthread_root}/src/cli/cli.hpp", @@ -140,22 +120,7 @@ if (chip_use_ot_lib) "${sl_openthread_root}/src/cli/cli_udp.cpp", "${sl_openthread_root}/src/cli/cli_udp.hpp", "${sl_openthread_root}/src/cli/x509_cert_key.hpp", - #"${sl_openthread_root}/src/core/openthread-core-config.h", - #"${sl_openthread_root}/src/core/config/announce_sender.h", - #"${sl_openthread_root}/src/core/config/backbone_router.h", - #"${sl_openthread_root}/src/core/config/border_router.h" - #"${sl_openthread_root}/examples/platforms/openthread-system.h", - #"${sl_openthread_root}/examples/platforms/utils/code_utils.h", - #"${sl_openthread_root}/examples/platforms/utils/encoding.h", - #"${sl_openthread_root}/examples/platforms/utils/logging_rtt.h", - #"${sl_openthread_root}/examples/platforms/utils/mac_frame.h", - #"${sl_openthread_root}/examples/platforms/utils/settings.h", - #"${sl_openthread_root}/examples/platforms/utils/soft_source_match_table.h", - #"${sl_openthread_root}/examples/platforms/utils/uart.h", "${sl_openthread_root}/examples/apps/cli/cli_uart.cpp", - #"${sl_openthread_root}/src/cli/cli_config.h", - #"${sl_openthread_root}/src/cli/cli.cpp", - #"${sl_openthread_root}/src/cli/cli.hpp", ] public_configs = [ @@ -176,7 +141,12 @@ if (chip_use_ot_lib) # selected thread device type FTD or MTD XTD = "ftd" - public_configs += [ "${sl_openthread_root}:openthread_ftd_config" ] + if (chip_openthread_ftd == false) + { + XTD = "mtd" + } + + public_configs += [ "${sl_openthread_root}:openthread_${XTD}_config" ] libs = [ "${sl_ot_efr32_root}/libs/libsl_ot_stack_${XTD}_${efr32_family}_gcc.a", From 38b32c91ce5c07750eae878d0d0c738d5d1b2e5f Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Fri, 29 Jul 2022 15:36:01 -0400 Subject: [PATCH 05/18] restyle --- examples/chef/efr32/.gn | 4 +- examples/chef/efr32/BUILD.gn | 16 +++----- examples/light-switch-app/efr32/.gn | 3 +- examples/light-switch-app/efr32/BUILD.gn | 16 +++----- examples/lighting-app/efr32/.gn | 3 +- examples/lighting-app/efr32/BUILD.gn | 18 +++------ examples/lock-app/efr32/.gn | 3 +- examples/lock-app/efr32/BUILD.gn | 16 +++----- examples/platform/efr32/BUILD.gn | 16 +++----- examples/window-app/efr32/.gn | 3 +- examples/window-app/efr32/BUILD.gn | 16 +++----- src/inet/BUILD.gn | 4 +- src/platform/BUILD.gn | 22 +++++------ src/platform/EFR32/BUILD.gn | 13 +++---- src/platform/EFR32/args.gni | 3 +- src/test_driver/efr32/.gn | 3 +- src/test_driver/efr32/BUILD.gn | 16 +++----- .../openthread/platforms/efr32/BUILD.gn | 4 +- third_party/silabs/BUILD.gn | 37 +++++++++---------- 19 files changed, 87 insertions(+), 129 deletions(-) diff --git a/examples/chef/efr32/.gn b/examples/chef/efr32/.gn index a08dc58656fd7d..ae71c73f3c06aa 100644 --- a/examples/chef/efr32/.gn +++ b/examples/chef/efr32/.gn @@ -14,6 +14,7 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") + # The location of the build configuration file. buildconfig = "${build_root}/config/BUILDCONFIG.gn" @@ -24,6 +25,7 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_openthread_ftd = true - openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" + openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/examples/chef/efr32/BUILD.gn b/examples/chef/efr32/BUILD.gn index 023e3074a860d4..30d3ef0d59749c 100644 --- a/examples/chef/efr32/BUILD.gn +++ b/examples/chef/efr32/BUILD.gn @@ -27,7 +27,7 @@ import("${chip_root}/src/platform/device.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/app/chip_data_model.gni") -if(chip_enable_openthread){ +if (chip_enable_openthread) { import("//build_overrides/openthread.gni") } @@ -209,28 +209,22 @@ efr32_executable("chef_app") { # OpenThread Settings if (chip_enable_openthread) { - deps += [ + deps += [ "${chip_root}/src/platform:ot_device_deps", "${examples_plat_dir}:efr-matter-shell", ] if (chip_use_ot_lib) { - deps += [ - "${efr32_sdk_build_root}:openthread_system", - ] + deps += [ "${efr32_sdk_build_root}:openthread_system" ] } else { deps += [ "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", ] if (chip_openthread_ftd) { - deps += [ - "${openthread_root}:libopenthread-cli-ftd", - ] + deps += [ "${openthread_root}:libopenthread-cli-ftd" ] } else { - deps += [ - "${openthread_root}:libopenthread-cli-mtd", - ] + deps += [ "${openthread_root}:libopenthread-cli-mtd" ] } } } diff --git a/examples/light-switch-app/efr32/.gn b/examples/light-switch-app/efr32/.gn index 99fe27c53705e6..ae71c73f3c06aa 100644 --- a/examples/light-switch-app/efr32/.gn +++ b/examples/light-switch-app/efr32/.gn @@ -25,6 +25,7 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_openthread_ftd = true - openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" + openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/examples/light-switch-app/efr32/BUILD.gn b/examples/light-switch-app/efr32/BUILD.gn index 44468cc2c22653..96f4fee8bfa27e 100644 --- a/examples/light-switch-app/efr32/BUILD.gn +++ b/examples/light-switch-app/efr32/BUILD.gn @@ -24,7 +24,7 @@ import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") -if(chip_enable_openthread){ +if (chip_enable_openthread) { import("//build_overrides/openthread.gni") } @@ -202,28 +202,22 @@ efr32_executable("light_switch_app") { # OpenThread Settings if (chip_enable_openthread) { - deps += [ + deps += [ "${chip_root}/src/platform:ot_device_deps", "${examples_plat_dir}:efr-matter-shell", ] if (chip_use_ot_lib) { - deps += [ - "${efr32_sdk_build_root}:openthread_system", - ] + deps += [ "${efr32_sdk_build_root}:openthread_system" ] } else { deps += [ "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", ] if (chip_openthread_ftd) { - deps += [ - "${openthread_root}:libopenthread-cli-ftd", - ] + deps += [ "${openthread_root}:libopenthread-cli-ftd" ] } else { - deps += [ - "$${openthread_root}:libopenthread-cli-mtd", - ] + deps += [ "$${openthread_root}:libopenthread-cli-mtd" ] } } } diff --git a/examples/lighting-app/efr32/.gn b/examples/lighting-app/efr32/.gn index 99fe27c53705e6..ae71c73f3c06aa 100644 --- a/examples/lighting-app/efr32/.gn +++ b/examples/lighting-app/efr32/.gn @@ -25,6 +25,7 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_openthread_ftd = true - openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" + openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index 3a8553ed7229b3..c4fb515d633900 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -18,14 +18,14 @@ import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") import("${build_root}/config/defaults.gni") -import("${efr32_sdk_build_root}/efr32_executable.gni") import("${efr32_sdk_build_root}/efr32_board.gni") +import("${efr32_sdk_build_root}/efr32_executable.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") -if(chip_enable_openthread){ +if (chip_enable_openthread) { import("//build_overrides/openthread.gni") } @@ -208,28 +208,22 @@ efr32_executable("lighting_app") { # OpenThread Settings if (chip_enable_openthread) { - deps += [ + deps += [ "${chip_root}/src/platform:ot_device_deps", "${examples_plat_dir}:efr-matter-shell", ] if (chip_use_ot_lib) { - deps += [ - "${efr32_sdk_build_root}:openthread_system", - ] + deps += [ "${efr32_sdk_build_root}:openthread_system" ] } else { deps += [ "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", ] if (chip_openthread_ftd) { - deps += [ - "${openthread_root}:libopenthread-cli-ftd", - ] + deps += [ "${openthread_root}:libopenthread-cli-ftd" ] } else { - deps += [ - "${openthread_root}:libopenthread-cli-mtd", - ] + deps += [ "${openthread_root}:libopenthread-cli-mtd" ] } } } diff --git a/examples/lock-app/efr32/.gn b/examples/lock-app/efr32/.gn index 99fe27c53705e6..ae71c73f3c06aa 100644 --- a/examples/lock-app/efr32/.gn +++ b/examples/lock-app/efr32/.gn @@ -25,6 +25,7 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_openthread_ftd = true - openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" + openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index 6299083ad479b3..9f62fe4d0f36e7 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -24,7 +24,7 @@ import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") -if(chip_enable_openthread){ +if (chip_enable_openthread) { import("//build_overrides/openthread.gni") } @@ -204,28 +204,22 @@ efr32_executable("lock_app") { # OpenThread Settings if (chip_enable_openthread) { - deps += [ + deps += [ "${chip_root}/src/platform:ot_device_deps", "${examples_plat_dir}:efr-matter-shell", ] if (chip_use_ot_lib) { - deps += [ - "${efr32_sdk_build_root}:openthread_system", - ] + deps += [ "${efr32_sdk_build_root}:openthread_system" ] } else { deps += [ "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", ] if (chip_openthread_ftd) { - deps += [ - "${openthread_root}:libopenthread-cli-ftd", - ] + deps += [ "${openthread_root}:libopenthread-cli-ftd" ] } else { - deps += [ - "${openthread_root}:libopenthread-cli-mtd", - ] + deps += [ "${openthread_root}:libopenthread-cli-mtd" ] } } } diff --git a/examples/platform/efr32/BUILD.gn b/examples/platform/efr32/BUILD.gn index e9ea275242c01f..2a1aa8f80f34b3 100644 --- a/examples/platform/efr32/BUILD.gn +++ b/examples/platform/efr32/BUILD.gn @@ -45,17 +45,11 @@ source_set("openthread_core_config_efr32_chip_examples") { public_deps = [ "${efr32_sdk_build_root}:efr32_sdk" ] - if (chip_use_ot_lib == true) - { - public_deps += [ - "${chip_root}/third_party/silabs:openthread_core_config_efr32", - ] - } - else - { - public_deps += [ - "${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32", - ] + if (chip_use_ot_lib == true) { + public_deps += + [ "${chip_root}/third_party/silabs:openthread_core_config_efr32" ] + } else { + public_deps += [ "${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32" ] } public_configs = [ ":chip_examples_project_config" ] diff --git a/examples/window-app/efr32/.gn b/examples/window-app/efr32/.gn index 99fe27c53705e6..ae71c73f3c06aa 100644 --- a/examples/window-app/efr32/.gn +++ b/examples/window-app/efr32/.gn @@ -25,6 +25,7 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_openthread_ftd = true - openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" + openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/examples/window-app/efr32/BUILD.gn b/examples/window-app/efr32/BUILD.gn index 98be3b8c5dfca5..3efec4af9c090d 100644 --- a/examples/window-app/efr32/BUILD.gn +++ b/examples/window-app/efr32/BUILD.gn @@ -24,7 +24,7 @@ import("${efr32_sdk_build_root}/efr32_sdk.gni") assert(current_os == "freertos") -if(chip_enable_openthread){ +if (chip_enable_openthread) { import("//build_overrides/openthread.gni") } @@ -190,28 +190,22 @@ efr32_executable("window_app") { # OpenThread Settings if (chip_enable_openthread) { - deps += [ + deps += [ "${chip_root}/src/platform:ot_device_deps", "${examples_plat_dir}:efr-matter-shell", ] if (chip_use_ot_lib) { - deps += [ - "${efr32_sdk_build_root}:openthread_system", - ] + deps += [ "${efr32_sdk_build_root}:openthread_system" ] } else { deps += [ "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", ] if (chip_openthread_ftd) { - deps += [ - "${openthread_root}:libopenthread-cli-ftd", - ] + deps += [ "${openthread_root}:libopenthread-cli-ftd" ] } else { - deps += [ - "$${openthread_root}:libopenthread-cli-mtd", - ] + deps += [ "$${openthread_root}:libopenthread-cli-mtd" ] } } } diff --git a/src/inet/BUILD.gn b/src/inet/BUILD.gn index 7e0e227953fb02..97a5e7f46e9887 100644 --- a/src/inet/BUILD.gn +++ b/src/inet/BUILD.gn @@ -108,9 +108,7 @@ static_library("inet") { } if (chip_system_config_use_open_thread_inet_endpoints) { - public_deps += [ - "${chip_root}/src/platform:ot_device_deps", - ] + public_deps += [ "${chip_root}/src/platform:ot_device_deps" ] } if (chip_inet_config_enable_tcp_endpoint) { diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index cb452e005e1684..1cd08417dbdd65 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -458,21 +458,19 @@ if (chip_device_platform != "none") { } } -if (chip_enable_openthread) -{ - group("ot_device_deps") - { - if (chip_use_ot_lib){ - assert(chip_ot_lib_source_set != "", "Provide the location of your ot lib source set using the arg chip_ot_lib_source_set") - public_deps = chip_ot_lib_source_set +if (chip_enable_openthread) { + group("ot_device_deps") { + if (chip_use_ot_lib) { + assert( + chip_ot_lib_source_set != "", + "Provide the location of your ot lib source set using the arg chip_ot_lib_source_set") + public_deps = chip_ot_lib_source_set } else { if (chip_openthread_ftd) { - public_deps = - [ "${openthread_root}:libopenthread-ftd" ] + public_deps = [ "${openthread_root}:libopenthread-ftd" ] } else { - public_deps = - [ "${openthread_root}:libopenthread-mtd" ] + public_deps = [ "${openthread_root}:libopenthread-mtd" ] } } } -} \ No newline at end of file +} diff --git a/src/platform/EFR32/BUILD.gn b/src/platform/EFR32/BUILD.gn index 4ef688604226c1..7eceb171b4fe1e 100644 --- a/src/platform/EFR32/BUILD.gn +++ b/src/platform/EFR32/BUILD.gn @@ -13,8 +13,8 @@ # limitations under the License. import("//build_overrides/chip.gni") -import("//build_overrides/pigweed.gni") import("//build_overrides/efr32_sdk.gni") +import("//build_overrides/pigweed.gni") import("${chip_root}/src/platform/device.gni") @@ -99,12 +99,11 @@ static_library("EFR32") { "$dir_pw_kvs", ] if (chip_enable_openthread) { - public_deps += [ - "${chip_root}/src/platform:ot_device_deps", - ] - - if (chip_use_ot_lib == false){ - public_deps += [ "${chip_root}/third_party/openthread/platforms:openthread_system"] + public_deps += [ "${chip_root}/src/platform:ot_device_deps" ] + + if (chip_use_ot_lib == false) { + public_deps += + [ "${chip_root}/third_party/openthread/platforms:openthread_system" ] } sources += [ diff --git a/src/platform/EFR32/args.gni b/src/platform/EFR32/args.gni index 6a4ba52f9c64c6..52c9cdc38698d8 100644 --- a/src/platform/EFR32/args.gni +++ b/src/platform/EFR32/args.gni @@ -43,7 +43,8 @@ chip_with_lwip = false chip_build_tests = false openthread_root = "${chip_root}/third_party/openthread/ot-efr32/openthread" -openthread_core_config_platform_check_file = "openthread-core-efr32-config-check.h" +openthread_core_config_platform_check_file = + "openthread-core-efr32-config-check.h" openthread_project_core_config_file = "OpenThreadConfig.h" openthread_core_config_deps = [ "${chip_root}/examples/platform/efr32:openthread_core_config_efr32_chip_examples" ] diff --git a/src/test_driver/efr32/.gn b/src/test_driver/efr32/.gn index a69e19bfce4890..ea000c8c2bef29 100644 --- a/src/test_driver/efr32/.gn +++ b/src/test_driver/efr32/.gn @@ -24,6 +24,7 @@ check_system_includes = true default_args = { target_cpu = "arm" target_os = "freertos" - openthread_external_platform="${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" + openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/src/test_driver/efr32/BUILD.gn b/src/test_driver/efr32/BUILD.gn index 0db7131501ecd7..3d1874b1bf23b7 100644 --- a/src/test_driver/efr32/BUILD.gn +++ b/src/test_driver/efr32/BUILD.gn @@ -15,8 +15,8 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") -import("//build_overrides/pigweed.gni") import("//build_overrides/openthread.gni") +import("//build_overrides/pigweed.gni") import("${build_root}/config/defaults.gni") import("${efr32_sdk_build_root}/efr32_executable.gni") @@ -97,28 +97,22 @@ efr32_executable("efr32_device_tests") { # OpenThread Settings if (chip_enable_openthread) { - deps += [ + deps += [ "${chip_root}/src/platform:ot_device_deps", "${examples_plat_dir}:efr-matter-shell", ] if (chip_use_ot_lib) { - deps += [ - "${efr32_sdk_build_root}:openthread_system", - ] + deps += [ "${efr32_sdk_build_root}:openthread_system" ] } else { deps += [ "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", ] if (chip_openthread_ftd) { - deps += [ - "${openthread_root}:libopenthread-cli-ftd", - ] + deps += [ "${openthread_root}:libopenthread-cli-ftd" ] } else { - deps += [ - "$${openthread_root}:libopenthread-cli-mtd", - ] + deps += [ "$${openthread_root}:libopenthread-cli-mtd" ] } } } diff --git a/third_party/openthread/platforms/efr32/BUILD.gn b/third_party/openthread/platforms/efr32/BUILD.gn index 178e9b0fb66fd0..b6dba5b98d4351 100644 --- a/third_party/openthread/platforms/efr32/BUILD.gn +++ b/third_party/openthread/platforms/efr32/BUILD.gn @@ -37,9 +37,9 @@ config("openthread_efr32_config") { source_set("openthread_core_config_efr32") { sources = [ + "${openthread_efr32_root}/openthread/src/cli/cli_config.h", "${openthread_efr32_root}/src/src/openthread-core-efr32-config-check.h", "${openthread_efr32_root}/src/src/openthread-core-efr32-config.h", - "${openthread_efr32_root}/openthread/src/cli/cli_config.h", ] public_deps = [ "${efr32_sdk_build_root}:efr32_sdk" ] @@ -49,6 +49,7 @@ source_set("openthread_core_config_efr32") { source_set("libopenthread-efr32") { sources = [ + "${openthread_efr32_root}/openthread/examples/apps/cli/cli_uart.cpp", "${openthread_efr32_root}/src/src/alarm.c", "${openthread_efr32_root}/src/src/crypto.c", "${openthread_efr32_root}/src/src/entropy.c", @@ -58,7 +59,6 @@ source_set("libopenthread-efr32") { "${openthread_efr32_root}/src/src/security_manager.c", "${openthread_efr32_root}/src/src/sleep.c", "${openthread_efr32_root}/src/src/system.c", - "${openthread_efr32_root}/openthread/examples/apps/cli/cli_uart.cpp", ] public_deps = [ diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index 3180d3f3db5684..b2ea4380148884 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -13,8 +13,8 @@ # limitations under the License. import("//build_overrides/chip.gni") -import("//build_overrides/jlink.gni") import("//build_overrides/efr32_sdk.gni") +import("//build_overrides/jlink.gni") import("${chip_root}/src/platform/device.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") @@ -22,7 +22,7 @@ declare_args() { # Build target to use for efr32 SDK. Use this to set global SDK defines. efr32_sdk_target = "" sl_ot_efr32_root = "${chip_root}/third_party/openthread/ot-efr32" - sl_openthread_root = "${chip_root}/third_party/openthread/ot-efr32/openthread" + sl_openthread_root = "${chip_root}/third_party/openthread/ot-efr32/openthread" } assert(efr32_sdk_target != "", "efr32_sdk_target must be specified") @@ -31,8 +31,7 @@ group("efr32_sdk") { public_deps = [ efr32_sdk_target ] } -if (chip_use_ot_lib) -{ +if (chip_use_ot_lib) { config("libopenthread-platform_config") { include_dirs = [ "${sl_openthread_root}/examples/platforms" ] } @@ -74,24 +73,26 @@ if (chip_use_ot_lib) "${sl_ot_efr32_root}/src/cli", "${sl_ot_efr32_root}/src/src", ] - } source_set("openthread_core_config_efr32") { sources = [ + "${sl_openthread_root}/src/cli/cli_config.h", "${sl_ot_efr32_root}/src/src/openthread-core-efr32-config-check.h", "${sl_ot_efr32_root}/src/src/openthread-core-efr32-config.h", - "${sl_openthread_root}/src/cli/cli_config.h", ] - public_deps = [ "${efr32_sdk_build_root}:efr32_sdk", ":libopenthread-platform", ] + public_deps = [ + ":libopenthread-platform", + "${efr32_sdk_build_root}:efr32_sdk", + ] public_configs = [ ":openthread_efr32_config" ] } - source_set("ot-efr32-cert") - { + source_set("ot-efr32-cert") { sources = [ + "${sl_openthread_root}/examples/apps/cli/cli_uart.cpp", "${sl_openthread_root}/src/cli/cli.cpp", "${sl_openthread_root}/src/cli/cli.hpp", "${sl_openthread_root}/src/cli/cli_coap.cpp", @@ -120,32 +121,28 @@ if (chip_use_ot_lib) "${sl_openthread_root}/src/cli/cli_udp.cpp", "${sl_openthread_root}/src/cli/cli_udp.hpp", "${sl_openthread_root}/src/cli/x509_cert_key.hpp", - "${sl_openthread_root}/examples/apps/cli/cli_uart.cpp", ] - public_configs = [ + public_configs = [ ":openthread_efr32_config", ":libopenthread-platform_config", ] public_deps = [ + ":libopenthread-platform", ":openthread_core_config_efr32", - ":libopenthread-platform", - "${sl_openthread_root}/src/core/:libopenthread_core_headers", "${segger_rtt_root}:segger_rtt", + "${sl_openthread_root}/src/core/:libopenthread_core_headers", ] - deps = [ - "${efr32_sdk_build_root}:efr32_sdk", - ] + deps = [ "${efr32_sdk_build_root}:efr32_sdk" ] # selected thread device type FTD or MTD XTD = "ftd" - if (chip_openthread_ftd == false) - { + if (chip_openthread_ftd == false) { XTD = "mtd" } - + public_configs += [ "${sl_openthread_root}:openthread_${XTD}_config" ] libs = [ @@ -153,4 +150,4 @@ if (chip_use_ot_lib) "${sl_ot_efr32_root}/libs/libsl_platform_${XTD}_${efr32_family}_gcc.a", ] } -} \ No newline at end of file +} From 009a6e9d60d8b16fd6a86a6f1fefd39bbb884d8b Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Fri, 29 Jul 2022 16:51:59 -0400 Subject: [PATCH 06/18] add recursive submodule update for efr to pull the openthread repo for ot-efr32 (temporary) --- .github/workflows/examples-efr32.yaml | 2 +- .gitmodules | 1 + third_party/cyw30739_sdk/repos/30739A0 | 2 +- third_party/openthread/ot-efr32 | 2 +- third_party/openthread/ot-ifx | 2 +- third_party/silabs/matter_support | 2 +- third_party/ti_simplelink_sdk/repo_cc32xx | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 16aaaa42a189d4..320dad29dadd31 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -48,7 +48,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform efr32 + run: scripts/checkout_submodules.py --shallow --recursive --platform efr32 # - name: Out of Tree verification # run: third_party/silabs/out_of_tree_verification.sh diff --git a/.gitmodules b/.gitmodules index b88a992fc3f0b9..abde0e5f8cdfd5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -34,6 +34,7 @@ [submodule "openthread"] path = third_party/openthread/repo url = https://github.com/openthread/openthread.git + branch = main [submodule "ot-br-posix"] path = third_party/ot-br-posix/repo url = https://github.com/openthread/ot-br-posix.git diff --git a/third_party/cyw30739_sdk/repos/30739A0 b/third_party/cyw30739_sdk/repos/30739A0 index 0b1cbd5ad614be..c233760b419d55 160000 --- a/third_party/cyw30739_sdk/repos/30739A0 +++ b/third_party/cyw30739_sdk/repos/30739A0 @@ -1 +1 @@ -Subproject commit 0b1cbd5ad614be9b315f3bd4e1b8512df2c4502f +Subproject commit c233760b419d556632430380e3645fad1766ca22 diff --git a/third_party/openthread/ot-efr32 b/third_party/openthread/ot-efr32 index f993e86d2d4fdb..fd77faf7a3443f 160000 --- a/third_party/openthread/ot-efr32 +++ b/third_party/openthread/ot-efr32 @@ -1 +1 @@ -Subproject commit f993e86d2d4fdb3ee57410bbac54da75dc6870bc +Subproject commit fd77faf7a3443f7941dfd9e9713aea09eb08e9b9 diff --git a/third_party/openthread/ot-ifx b/third_party/openthread/ot-ifx index 2ee7240000f9bc..64bc0568bbb713 160000 --- a/third_party/openthread/ot-ifx +++ b/third_party/openthread/ot-ifx @@ -1 +1 @@ -Subproject commit 2ee7240000f9bc6a876f3f4b31f02ca82dca5f43 +Subproject commit 64bc0568bbb7136244f2ae5e58ae074b64392e9b diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index c9d65e0111fb77..a7801b3fa49327 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit c9d65e0111fb7708d41f86bc999bb22de43b5915 +Subproject commit a7801b3fa493270b6832061ec9997eca3767ba67 diff --git a/third_party/ti_simplelink_sdk/repo_cc32xx b/third_party/ti_simplelink_sdk/repo_cc32xx index 13532baa294744..e5fbefba9c3c3a 160000 --- a/third_party/ti_simplelink_sdk/repo_cc32xx +++ b/third_party/ti_simplelink_sdk/repo_cc32xx @@ -1 +1 @@ -Subproject commit 13532baa2947440ced2f2abefd6a57b478f5100d +Subproject commit e5fbefba9c3c3afa9c2c967b713c77e282d560fe From 75110aaa31abc0944e9215061797bfda1d0b9b2a Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Mon, 1 Aug 2022 13:57:13 -0400 Subject: [PATCH 07/18] fix for wifi builds --- examples/platform/efr32/BUILD.gn | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/examples/platform/efr32/BUILD.gn b/examples/platform/efr32/BUILD.gn index 2a1aa8f80f34b3..fa6b7a8fd14dc3 100644 --- a/examples/platform/efr32/BUILD.gn +++ b/examples/platform/efr32/BUILD.gn @@ -41,18 +41,20 @@ config("chip_examples_project_config") { } source_set("openthread_core_config_efr32_chip_examples") { - sources = [ "project_include/OpenThreadConfig.h" ] + if (chip_enable_openthread) { + sources = [ "project_include/OpenThreadConfig.h" ] - public_deps = [ "${efr32_sdk_build_root}:efr32_sdk" ] + public_deps = [ "${efr32_sdk_build_root}:efr32_sdk" ] - if (chip_use_ot_lib == true) { - public_deps += - [ "${chip_root}/third_party/silabs:openthread_core_config_efr32" ] - } else { - public_deps += [ "${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32" ] - } + if (chip_use_ot_lib == true) { + public_deps += + [ "${chip_root}/third_party/silabs:openthread_core_config_efr32" ] + } else { + public_deps += [ "${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32" ] + } - public_configs = [ ":chip_examples_project_config" ] + public_configs = [ ":chip_examples_project_config" ] + } } source_set("efr-matter-shell") { From ce4e0364224315d74dc66d2dab2e6c2fa5ce5fde Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Tue, 2 Aug 2022 09:08:28 -0400 Subject: [PATCH 08/18] Fix assert with ot lib --- examples/platform/efr32/init_efrPlatform.cpp | 8 +++--- src/platform/EFR32/BLEManagerImpl.cpp | 26 ++++++++++++++----- .../EFR32/btconf/in_place_ota_dfu.xml | 12 --------- .../{btconf => }/gatt_configuration.btconf | 1 + src/platform/EFR32/gatt_db.c | 6 ++--- 5 files changed, 28 insertions(+), 25 deletions(-) delete mode 100644 src/platform/EFR32/btconf/in_place_ota_dfu.xml rename src/platform/EFR32/{btconf => }/gatt_configuration.btconf (98%) diff --git a/examples/platform/efr32/init_efrPlatform.cpp b/examples/platform/efr32/init_efrPlatform.cpp index 0e81e5dcd74dad..d0fb913165c469 100644 --- a/examples/platform/efr32/init_efrPlatform.cpp +++ b/examples/platform/efr32/init_efrPlatform.cpp @@ -64,11 +64,7 @@ void initAntenna(void); void init_efrPlatform(void) { -#if CHIP_ENABLE_OPENTHREAD - otSysInit(0, NULL); -#else sl_system_init(); -#endif sl_mbedtls_init(); #if DISPLAY_ENABLED @@ -78,6 +74,10 @@ void init_efrPlatform(void) #if EFR32_LOG_ENABLED efr32InitLog(); #endif + +#if CHIP_ENABLE_OPENTHREAD + sl_ot_sys_init(); +#endif // CHIP_ENABLE_OPENTHREAD } #ifdef __cplusplus diff --git a/src/platform/EFR32/BLEManagerImpl.cpp b/src/platform/EFR32/BLEManagerImpl.cpp index 344d6c58a7d362..72d55817042c16 100644 --- a/src/platform/EFR32/BLEManagerImpl.cpp +++ b/src/platform/EFR32/BLEManagerImpl.cpp @@ -423,6 +423,12 @@ void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) } break; + case DeviceEventType::kCHIPoBLENotifyConfirm: { + ChipLogProgress(DeviceLayer, "_OnPlatformEvent kCHIPoBLENotifyConfirm"); + HandleTxConfirmationEvent(event->CHIPoBLENotifyConfirm.ConId); + } + break; + default: ChipLogProgress(DeviceLayer, "_OnPlatformEvent default: event->Type = %d", event->Type); break; @@ -473,16 +479,24 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU sl_status_t ret; uint16_t cId = (UUIDsMatch(&ChipUUID_CHIPoBLEChar_RX, charId) ? gattdb_CHIPoBLEChar_Rx : gattdb_CHIPoBLEChar_Tx); uint8_t timerHandle = GetTimerHandle(conId, true); + ChipDeviceEvent event; VerifyOrExit(((conState != NULL) && (conState->subscribed != 0)), err = CHIP_ERROR_INVALID_ARGUMENT); VerifyOrExit(timerHandle != kMaxConnections, err = CHIP_ERROR_NO_MEMORY); - // start timer for light indication confirmation. Long delay for spake2 indication + // start timer for light notification confirmation. Long delay for spake2 indication sl_bt_system_set_lazy_soft_timer(TIMER_S_2_TIMERTICK(6), 0, timerHandle, true); - ret = sl_bt_gatt_server_send_indication(conId, cId, (data->DataLength()), data->Start()); + ret = sl_bt_gatt_server_send_notification(conId, cId, (data->DataLength()), data->Start()); err = MapBLEError(ret); + if (err == CHIP_NO_ERROR) + { + event.Type = DeviceEventType::kCHIPoBLENotifyConfirm; + event.CHIPoBLENotifyConfirm.ConId = conId; + err = PlatformMgr().PostEvent(&event); + } + exit: if (err != CHIP_NO_ERROR) { @@ -859,20 +873,20 @@ void BLEManagerImpl::HandleTXCharCCCDWrite(volatile sl_bt_msg_t * evt) { CHIP_ERROR err = CHIP_NO_ERROR; CHIPoBLEConState * bleConnState; - bool isIndicationEnabled = false; + bool isDisabled; ChipDeviceEvent event; bleConnState = GetConnectionState(evt->data.evt_gatt_server_user_write_request.connection); VerifyOrExit(bleConnState != NULL, err = CHIP_ERROR_NO_MEMORY); // Determine if the client is enabling or disabling notification/indication. - isIndicationEnabled = (evt->data.evt_gatt_server_characteristic_status.client_config_flags == sl_bt_gatt_indication); + isDisabled = (evt->data.evt_gatt_server_characteristic_status.client_config_flags == sl_bt_gatt_disable); ChipLogProgress(DeviceLayer, "HandleTXcharCCCDWrite - Config Flags value : %d", evt->data.evt_gatt_server_characteristic_status.client_config_flags); - ChipLogProgress(DeviceLayer, "CHIPoBLE %s received", isIndicationEnabled ? "subscribe" : "unsubscribe"); + ChipLogProgress(DeviceLayer, "CHIPoBLE %s received", isDisabled ? "unsubscribe" : "subscribe"); - if (isIndicationEnabled) + if (!isDisabled) { // If indications are not already enabled for the connection... if (!bleConnState->subscribed) diff --git a/src/platform/EFR32/btconf/in_place_ota_dfu.xml b/src/platform/EFR32/btconf/in_place_ota_dfu.xml deleted file mode 100644 index 28ca5930597228..00000000000000 --- a/src/platform/EFR32/btconf/in_place_ota_dfu.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - Abstract: The Silicon Labs OTA Service enables in-place over-the-air firmware update of the device. - - Abstract: Silicon Labs OTA Control. - - - - - - - \ No newline at end of file diff --git a/src/platform/EFR32/btconf/gatt_configuration.btconf b/src/platform/EFR32/gatt_configuration.btconf similarity index 98% rename from src/platform/EFR32/btconf/gatt_configuration.btconf rename to src/platform/EFR32/gatt_configuration.btconf index 060af956d3893b..b6e4af590a8ae3 100644 --- a/src/platform/EFR32/btconf/gatt_configuration.btconf +++ b/src/platform/EFR32/gatt_configuration.btconf @@ -81,6 +81,7 @@ + diff --git a/src/platform/EFR32/gatt_db.c b/src/platform/EFR32/gatt_db.c index 110b069e2c23d7..aa10ec56fa920d 100644 --- a/src/platform/EFR32/gatt_db.c +++ b/src/platform/EFR32/gatt_db.c @@ -55,7 +55,7 @@ GATT_DATA(const sli_bt_gattdb_value_t gattdb_attribute_field_28) = { .len = 16, 0x1d, } }; GATT_DATA(sli_bt_gattdb_attribute_chrvalue_t - gattdb_attribute_field_24) = { .properties = 0x2e, + gattdb_attribute_field_24) = { .properties = 0x3e, .max_len = 247, .len = 1, .data = { @@ -353,7 +353,7 @@ GATT_DATA(const sli_bt_gattdb_attribute_t gattdb_attributes_map[]) = { .caps = 0xffff, .state = 0x00, .datatype = 0x05, - .characteristic = { .properties = 0x2e, .char_uuid = 0x8001 } }, + .characteristic = { .properties = 0x3e, .char_uuid = 0x8001 } }, { .handle = 0x19, .uuid = 0x8001, .permissions = 0x807, @@ -367,7 +367,7 @@ GATT_DATA(const sli_bt_gattdb_attribute_t gattdb_attributes_map[]) = { .caps = 0xffff, .state = 0x00, .datatype = 0x03, - .configdata = { .flags = 0x02, .clientconfig_index = 0x01 } }, + .configdata = { .flags = 0x03, .clientconfig_index = 0x01 } }, { .handle = 0x1b, .uuid = 0x0002, .permissions = 0x801, From 276c60dc77cb05ed7da63438a53eb425f379e4ca Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Wed, 3 Aug 2022 11:08:39 -0400 Subject: [PATCH 09/18] Use plaform dmp lib --- third_party/silabs/BUILD.gn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index b2ea4380148884..32f264a0fac9a4 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -69,9 +69,8 @@ if (chip_use_ot_lib) { include_dirs = [ "${chip_root}/examples/platform/efr32", "${sdk_support_root}/matter/efr32/${efr32_family}/${efr32_board}", - "${sl_ot_efr32_root}/src/", - "${sl_ot_efr32_root}/src/cli", "${sl_ot_efr32_root}/src/src", + "${sl_openthread_root}/src/", ] } @@ -132,6 +131,7 @@ if (chip_use_ot_lib) { ":libopenthread-platform", ":openthread_core_config_efr32", "${segger_rtt_root}:segger_rtt", + "${sl_openthread_root}/include/openthread:openthread", "${sl_openthread_root}/src/core/:libopenthread_core_headers", ] @@ -147,7 +147,7 @@ if (chip_use_ot_lib) { libs = [ "${sl_ot_efr32_root}/libs/libsl_ot_stack_${XTD}_${efr32_family}_gcc.a", - "${sl_ot_efr32_root}/libs/libsl_platform_${XTD}_${efr32_family}_gcc.a", + "${sl_ot_efr32_root}/libs/libsl_platform_${XTD}_dmp_${efr32_family}_gcc.a", ] } } From a0e28dac3037b9cd988f2d8794b2e447594cfdec Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Mon, 8 Aug 2022 21:06:40 -0400 Subject: [PATCH 10/18] Update ot-efr32 hash for new libs --- src/platform/EFR32/BLEManagerImpl.cpp | 26 +++++-------------- .../{ => btconf}/gatt_configuration.btconf | 1 - .../EFR32/btconf/in_place_ota_dfu.xml | 12 +++++++++ src/platform/EFR32/gatt_db.c | 6 ++--- 4 files changed, 21 insertions(+), 24 deletions(-) rename src/platform/EFR32/{ => btconf}/gatt_configuration.btconf (98%) create mode 100644 src/platform/EFR32/btconf/in_place_ota_dfu.xml diff --git a/src/platform/EFR32/BLEManagerImpl.cpp b/src/platform/EFR32/BLEManagerImpl.cpp index 72d55817042c16..344d6c58a7d362 100644 --- a/src/platform/EFR32/BLEManagerImpl.cpp +++ b/src/platform/EFR32/BLEManagerImpl.cpp @@ -423,12 +423,6 @@ void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) } break; - case DeviceEventType::kCHIPoBLENotifyConfirm: { - ChipLogProgress(DeviceLayer, "_OnPlatformEvent kCHIPoBLENotifyConfirm"); - HandleTxConfirmationEvent(event->CHIPoBLENotifyConfirm.ConId); - } - break; - default: ChipLogProgress(DeviceLayer, "_OnPlatformEvent default: event->Type = %d", event->Type); break; @@ -479,24 +473,16 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU sl_status_t ret; uint16_t cId = (UUIDsMatch(&ChipUUID_CHIPoBLEChar_RX, charId) ? gattdb_CHIPoBLEChar_Rx : gattdb_CHIPoBLEChar_Tx); uint8_t timerHandle = GetTimerHandle(conId, true); - ChipDeviceEvent event; VerifyOrExit(((conState != NULL) && (conState->subscribed != 0)), err = CHIP_ERROR_INVALID_ARGUMENT); VerifyOrExit(timerHandle != kMaxConnections, err = CHIP_ERROR_NO_MEMORY); - // start timer for light notification confirmation. Long delay for spake2 indication + // start timer for light indication confirmation. Long delay for spake2 indication sl_bt_system_set_lazy_soft_timer(TIMER_S_2_TIMERTICK(6), 0, timerHandle, true); - ret = sl_bt_gatt_server_send_notification(conId, cId, (data->DataLength()), data->Start()); + ret = sl_bt_gatt_server_send_indication(conId, cId, (data->DataLength()), data->Start()); err = MapBLEError(ret); - if (err == CHIP_NO_ERROR) - { - event.Type = DeviceEventType::kCHIPoBLENotifyConfirm; - event.CHIPoBLENotifyConfirm.ConId = conId; - err = PlatformMgr().PostEvent(&event); - } - exit: if (err != CHIP_NO_ERROR) { @@ -873,20 +859,20 @@ void BLEManagerImpl::HandleTXCharCCCDWrite(volatile sl_bt_msg_t * evt) { CHIP_ERROR err = CHIP_NO_ERROR; CHIPoBLEConState * bleConnState; - bool isDisabled; + bool isIndicationEnabled = false; ChipDeviceEvent event; bleConnState = GetConnectionState(evt->data.evt_gatt_server_user_write_request.connection); VerifyOrExit(bleConnState != NULL, err = CHIP_ERROR_NO_MEMORY); // Determine if the client is enabling or disabling notification/indication. - isDisabled = (evt->data.evt_gatt_server_characteristic_status.client_config_flags == sl_bt_gatt_disable); + isIndicationEnabled = (evt->data.evt_gatt_server_characteristic_status.client_config_flags == sl_bt_gatt_indication); ChipLogProgress(DeviceLayer, "HandleTXcharCCCDWrite - Config Flags value : %d", evt->data.evt_gatt_server_characteristic_status.client_config_flags); - ChipLogProgress(DeviceLayer, "CHIPoBLE %s received", isDisabled ? "unsubscribe" : "subscribe"); + ChipLogProgress(DeviceLayer, "CHIPoBLE %s received", isIndicationEnabled ? "subscribe" : "unsubscribe"); - if (!isDisabled) + if (isIndicationEnabled) { // If indications are not already enabled for the connection... if (!bleConnState->subscribed) diff --git a/src/platform/EFR32/gatt_configuration.btconf b/src/platform/EFR32/btconf/gatt_configuration.btconf similarity index 98% rename from src/platform/EFR32/gatt_configuration.btconf rename to src/platform/EFR32/btconf/gatt_configuration.btconf index b6e4af590a8ae3..060af956d3893b 100644 --- a/src/platform/EFR32/gatt_configuration.btconf +++ b/src/platform/EFR32/btconf/gatt_configuration.btconf @@ -81,7 +81,6 @@ - diff --git a/src/platform/EFR32/btconf/in_place_ota_dfu.xml b/src/platform/EFR32/btconf/in_place_ota_dfu.xml new file mode 100644 index 00000000000000..28ca5930597228 --- /dev/null +++ b/src/platform/EFR32/btconf/in_place_ota_dfu.xml @@ -0,0 +1,12 @@ + + + Abstract: The Silicon Labs OTA Service enables in-place over-the-air firmware update of the device. + + Abstract: Silicon Labs OTA Control. + + + + + + + \ No newline at end of file diff --git a/src/platform/EFR32/gatt_db.c b/src/platform/EFR32/gatt_db.c index aa10ec56fa920d..110b069e2c23d7 100644 --- a/src/platform/EFR32/gatt_db.c +++ b/src/platform/EFR32/gatt_db.c @@ -55,7 +55,7 @@ GATT_DATA(const sli_bt_gattdb_value_t gattdb_attribute_field_28) = { .len = 16, 0x1d, } }; GATT_DATA(sli_bt_gattdb_attribute_chrvalue_t - gattdb_attribute_field_24) = { .properties = 0x3e, + gattdb_attribute_field_24) = { .properties = 0x2e, .max_len = 247, .len = 1, .data = { @@ -353,7 +353,7 @@ GATT_DATA(const sli_bt_gattdb_attribute_t gattdb_attributes_map[]) = { .caps = 0xffff, .state = 0x00, .datatype = 0x05, - .characteristic = { .properties = 0x3e, .char_uuid = 0x8001 } }, + .characteristic = { .properties = 0x2e, .char_uuid = 0x8001 } }, { .handle = 0x19, .uuid = 0x8001, .permissions = 0x807, @@ -367,7 +367,7 @@ GATT_DATA(const sli_bt_gattdb_attribute_t gattdb_attributes_map[]) = { .caps = 0xffff, .state = 0x00, .datatype = 0x03, - .configdata = { .flags = 0x03, .clientconfig_index = 0x01 } }, + .configdata = { .flags = 0x02, .clientconfig_index = 0x01 } }, { .handle = 0x1b, .uuid = 0x0002, .permissions = 0x801, From c830946107f0003ebe3fa603f3cba9d4f86442cd Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Fri, 12 Aug 2022 22:35:40 -0400 Subject: [PATCH 11/18] Addresse comment by correcting how and where a openthread_target can be set. Change efr32 build system with those changes --- examples/chef/efr32/BUILD.gn | 16 +++------------ examples/light-switch-app/efr32/BUILD.gn | 16 +++------------ examples/lighting-app/efr32/BUILD.gn | 16 +++------------ examples/lock-app/efr32/BUILD.gn | 16 +++------------ examples/platform/efr32/BUILD.gn | 5 ++--- examples/thermostat/efr32/BUILD.gn | 16 ++++----------- examples/window-app/efr32/BUILD.gn | 16 +++------------ scripts/examples/gn_efr32_example.sh | 4 +++- src/inet/BUILD.gn | 3 ++- src/platform/BUILD.gn | 17 ---------------- src/platform/EFR32/BUILD.gn | 8 ++------ src/platform/EFR32/args.gni | 2 -- src/platform/device.gni | 2 -- src/test_driver/efr32/BUILD.gn | 18 +++-------------- third_party/openthread/BUILD.gn | 25 ++++++++++++++++++++++++ third_party/silabs/BUILD.gn | 12 +++++++++++- third_party/silabs/efr32_sdk.gni | 3 +++ 17 files changed, 70 insertions(+), 125 deletions(-) create mode 100644 third_party/openthread/BUILD.gn diff --git a/examples/chef/efr32/BUILD.gn b/examples/chef/efr32/BUILD.gn index 30d3ef0d59749c..b4cad9a8dfafac 100644 --- a/examples/chef/efr32/BUILD.gn +++ b/examples/chef/efr32/BUILD.gn @@ -210,22 +210,12 @@ efr32_executable("chef_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/src/platform:ot_device_deps", + "${chip_root}/third_party/openthread:openthread_device_deps", "${examples_plat_dir}:efr-matter-shell", ] - if (chip_use_ot_lib) { - deps += [ "${efr32_sdk_build_root}:openthread_system" ] - } else { - deps += [ - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - ] - if (chip_openthread_ftd) { - deps += [ "${openthread_root}:libopenthread-cli-ftd" ] - } else { - deps += [ "${openthread_root}:libopenthread-cli-mtd" ] - } + if (enable_openthread_cli) { + deps += [ "${efr32_sdk_build_root}:openthread_cli" ] } } diff --git a/examples/light-switch-app/efr32/BUILD.gn b/examples/light-switch-app/efr32/BUILD.gn index 96f4fee8bfa27e..cd12030c56f06d 100644 --- a/examples/light-switch-app/efr32/BUILD.gn +++ b/examples/light-switch-app/efr32/BUILD.gn @@ -203,22 +203,12 @@ efr32_executable("light_switch_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/src/platform:ot_device_deps", + "${chip_root}/third_party/openthread:openthread_device_deps", "${examples_plat_dir}:efr-matter-shell", ] - if (chip_use_ot_lib) { - deps += [ "${efr32_sdk_build_root}:openthread_system" ] - } else { - deps += [ - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - ] - if (chip_openthread_ftd) { - deps += [ "${openthread_root}:libopenthread-cli-ftd" ] - } else { - deps += [ "$${openthread_root}:libopenthread-cli-mtd" ] - } + if (enable_openthread_cli) { + deps += [ "${efr32_sdk_build_root}:openthread_cli" ] } } diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index c4fb515d633900..6d53d1aecfae77 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -209,22 +209,12 @@ efr32_executable("lighting_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/src/platform:ot_device_deps", + "${chip_root}/third_party/openthread:openthread_device_deps", "${examples_plat_dir}:efr-matter-shell", ] - if (chip_use_ot_lib) { - deps += [ "${efr32_sdk_build_root}:openthread_system" ] - } else { - deps += [ - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - ] - if (chip_openthread_ftd) { - deps += [ "${openthread_root}:libopenthread-cli-ftd" ] - } else { - deps += [ "${openthread_root}:libopenthread-cli-mtd" ] - } + if (enable_openthread_cli) { + deps += [ "${efr32_sdk_build_root}:openthread_cli" ] } } diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index 9f62fe4d0f36e7..df84852338e381 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -205,22 +205,12 @@ efr32_executable("lock_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/src/platform:ot_device_deps", + "${chip_root}/third_party/openthread:openthread_device_deps", "${examples_plat_dir}:efr-matter-shell", ] - if (chip_use_ot_lib) { - deps += [ "${efr32_sdk_build_root}:openthread_system" ] - } else { - deps += [ - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - ] - if (chip_openthread_ftd) { - deps += [ "${openthread_root}:libopenthread-cli-ftd" ] - } else { - deps += [ "${openthread_root}:libopenthread-cli-mtd" ] - } + if (enable_openthread_cli) { + deps += [ "${efr32_sdk_build_root}:openthread_cli" ] } } diff --git a/examples/platform/efr32/BUILD.gn b/examples/platform/efr32/BUILD.gn index fa6b7a8fd14dc3..b6551ed6d090a9 100644 --- a/examples/platform/efr32/BUILD.gn +++ b/examples/platform/efr32/BUILD.gn @@ -46,9 +46,8 @@ source_set("openthread_core_config_efr32_chip_examples") { public_deps = [ "${efr32_sdk_build_root}:efr32_sdk" ] - if (chip_use_ot_lib == true) { - public_deps += - [ "${chip_root}/third_party/silabs:openthread_core_config_efr32" ] + if (use_silabs_thread_lib == true) { + public_deps += [ "${efr32_sdk_build_root}:openthread_core_config_efr32" ] } else { public_deps += [ "${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32" ] } diff --git a/examples/thermostat/efr32/BUILD.gn b/examples/thermostat/efr32/BUILD.gn index 90f61b99ca1ad6..ac491a2ab04e7c 100644 --- a/examples/thermostat/efr32/BUILD.gn +++ b/examples/thermostat/efr32/BUILD.gn @@ -195,20 +195,12 @@ efr32_executable("thermostat_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", + "${chip_root}/third_party/openthread:openthread_device_deps", "${examples_plat_dir}:efr-matter-shell", ] - if (chip_openthread_ftd) { - deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", - ] - } else { - deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", - ] + + if (enable_openthread_cli) { + deps += [ "${efr32_sdk_build_root}:openthread_cli" ] } } diff --git a/examples/window-app/efr32/BUILD.gn b/examples/window-app/efr32/BUILD.gn index 3efec4af9c090d..c838467c164a7d 100644 --- a/examples/window-app/efr32/BUILD.gn +++ b/examples/window-app/efr32/BUILD.gn @@ -191,22 +191,12 @@ efr32_executable("window_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/src/platform:ot_device_deps", + "${chip_root}/third_party/openthread:openthread_device_deps", "${examples_plat_dir}:efr-matter-shell", ] - if (chip_use_ot_lib) { - deps += [ "${efr32_sdk_build_root}:openthread_system" ] - } else { - deps += [ - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - ] - if (chip_openthread_ftd) { - deps += [ "${openthread_root}:libopenthread-cli-ftd" ] - } else { - deps += [ "$${openthread_root}:libopenthread-cli-mtd" ] - } + if (enable_openthread_cli) { + deps += [ "${efr32_sdk_build_root}:openthread_cli" ] } } diff --git a/scripts/examples/gn_efr32_example.sh b/scripts/examples/gn_efr32_example.sh index 3d750eadbac739..5b47c945c771a8 100755 --- a/scripts/examples/gn_efr32_example.sh +++ b/scripts/examples/gn_efr32_example.sh @@ -34,6 +34,7 @@ set -x env USE_WIFI=false +SILABS_THREAD_TARGET=\""../silabs:ot-efr32-cert"\" USAGE="./scripts/examples/gn_efr32_example.sh []" if [ "$#" == "0" ]; then @@ -103,6 +104,7 @@ if [ "$#" == "0" ]; then --additional_data_advertising enable Addition data advertissing and rotating device ID --use_ot_lib + use the silabs openthread library " elif [ "$#" -lt "2" ]; then echo "Invalid number of arguments @@ -151,7 +153,7 @@ else shift ;; --use_ot_lib) - optArgs+="chip_use_ot_lib=true openthread_external_platform=\"""\" " + optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" " shift ;; *) diff --git a/src/inet/BUILD.gn b/src/inet/BUILD.gn index 97a5e7f46e9887..f539ee6139648f 100644 --- a/src/inet/BUILD.gn +++ b/src/inet/BUILD.gn @@ -108,7 +108,8 @@ static_library("inet") { } if (chip_system_config_use_open_thread_inet_endpoints) { - public_deps += [ "${chip_root}/src/platform:ot_device_deps" ] + public_deps += + [ "${chip_root}/third_party/openthread:openthread_device_deps" ] } if (chip_inet_config_enable_tcp_endpoint) { diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index 1cd08417dbdd65..31e25b41a6a5df 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -457,20 +457,3 @@ if (chip_device_platform != "none") { public_deps = [ ":platform_buildconfig" ] } } - -if (chip_enable_openthread) { - group("ot_device_deps") { - if (chip_use_ot_lib) { - assert( - chip_ot_lib_source_set != "", - "Provide the location of your ot lib source set using the arg chip_ot_lib_source_set") - public_deps = chip_ot_lib_source_set - } else { - if (chip_openthread_ftd) { - public_deps = [ "${openthread_root}:libopenthread-ftd" ] - } else { - public_deps = [ "${openthread_root}:libopenthread-mtd" ] - } - } - } -} diff --git a/src/platform/EFR32/BUILD.gn b/src/platform/EFR32/BUILD.gn index 7eceb171b4fe1e..795734138e0b95 100644 --- a/src/platform/EFR32/BUILD.gn +++ b/src/platform/EFR32/BUILD.gn @@ -99,12 +99,8 @@ static_library("EFR32") { "$dir_pw_kvs", ] if (chip_enable_openthread) { - public_deps += [ "${chip_root}/src/platform:ot_device_deps" ] - - if (chip_use_ot_lib == false) { - public_deps += - [ "${chip_root}/third_party/openthread/platforms:openthread_system" ] - } + public_deps += + [ "${chip_root}/third_party/openthread:openthread_device_deps" ] sources += [ "../OpenThread/OpenThreadUtils.cpp", diff --git a/src/platform/EFR32/args.gni b/src/platform/EFR32/args.gni index 52c9cdc38698d8..699d1417fc70a8 100644 --- a/src/platform/EFR32/args.gni +++ b/src/platform/EFR32/args.gni @@ -48,8 +48,6 @@ openthread_core_config_platform_check_file = openthread_project_core_config_file = "OpenThreadConfig.h" openthread_core_config_deps = [ "${chip_root}/examples/platform/efr32:openthread_core_config_efr32_chip_examples" ] -chip_ot_lib_source_set = [ "${efr32_sdk_build_root}:ot-efr32-cert" ] - chip_config_memory_management = "platform" pw_build_LINK_DEPS = [ diff --git a/src/platform/device.gni b/src/platform/device.gni index 9b87a4f5ecb692..0592a6720e13c0 100755 --- a/src/platform/device.gni +++ b/src/platform/device.gni @@ -56,8 +56,6 @@ declare_args() { declare_args() { chip_openthread_ftd = chip_enable_openthread - chip_use_ot_lib = false - chip_ot_lib_source_set = "" # Enable wifi support. chip_enable_wifi = diff --git a/src/test_driver/efr32/BUILD.gn b/src/test_driver/efr32/BUILD.gn index 3d1874b1bf23b7..9339e727804741 100644 --- a/src/test_driver/efr32/BUILD.gn +++ b/src/test_driver/efr32/BUILD.gn @@ -89,8 +89,6 @@ efr32_executable("efr32_device_tests") { "${chip_root}/src:tests", "${chip_root}/src/lib", "${chip_root}/src/lib/support:testing", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", "${examples_plat_dir}/pw_sys_io:pw_sys_io_efr32", "${nlunit_test_root}:nlunit-test", ] @@ -98,22 +96,12 @@ efr32_executable("efr32_device_tests") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/src/platform:ot_device_deps", + "${chip_root}/third_party/openthread:openthread_device_deps", "${examples_plat_dir}:efr-matter-shell", ] - if (chip_use_ot_lib) { - deps += [ "${efr32_sdk_build_root}:openthread_system" ] - } else { - deps += [ - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - ] - if (chip_openthread_ftd) { - deps += [ "${openthread_root}:libopenthread-cli-ftd" ] - } else { - deps += [ "$${openthread_root}:libopenthread-cli-mtd" ] - } + if (enable_openthread_cli) { + deps += [ "${efr32_sdk_build_root}:openthread_cli" ] } } diff --git a/third_party/openthread/BUILD.gn b/third_party/openthread/BUILD.gn new file mode 100644 index 00000000000000..7ecf95dc6f1e89 --- /dev/null +++ b/third_party/openthread/BUILD.gn @@ -0,0 +1,25 @@ +import("//build_overrides/chip.gni") +import("//build_overrides/openthread.gni") + +import("${chip_root}/src/platform/device.gni") + +declare_args() { + # Use a different target, such as a prebuilt Thread library. + chip_openthread_target = "" +} + +group("openthread_device_deps") { + if (chip_openthread_target != "") { + public_deps = [ chip_openthread_target ] + } else { + public_deps = [ + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", + ] + if (chip_openthread_ftd) { + public_deps += [ "${openthread_root}:libopenthread-ftd" ] + } else { + public_deps += [ "${openthread_root}:libopenthread-mtd" ] + } + } +} \ No newline at end of file diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index 32f264a0fac9a4..5c5de855043a1b 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -31,7 +31,17 @@ group("efr32_sdk") { public_deps = [ efr32_sdk_target ] } -if (chip_use_ot_lib) { +group("openthread_cli") { + if (use_silabs_thread_lib == false) { + if (chip_openthread_ftd) { + public_deps = [ "${sl_openthread_root}:libopenthread-cli-ftd" ] + } else { + public_deps = [ "${sl_openthread_root}:libopenthread-cli-mtd" ] + } + } +} + +if (use_silabs_thread_lib) { config("libopenthread-platform_config") { include_dirs = [ "${sl_openthread_root}/examples/platforms" ] } diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index e4af7e65333a28..727ecea7acd5ef 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -24,6 +24,9 @@ declare_args() { # Location of the efr32 SDK. efr32_sdk_root = "${chip_root}/third_party/silabs/gecko_sdk" sdk_support_root = "${chip_root}/third_party/silabs/matter_support" + + #Build openthread with prebuilt silabs lib + use_silabs_thread_lib = false enable_openthread_cli = true kvs_max_entries = 75 From a9179b288133dac90b1e801b9db54468b0565564 Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Fri, 12 Aug 2022 22:46:49 -0400 Subject: [PATCH 12/18] restyle --- third_party/openthread/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/openthread/BUILD.gn b/third_party/openthread/BUILD.gn index 7ecf95dc6f1e89..7c25798474cedc 100644 --- a/third_party/openthread/BUILD.gn +++ b/third_party/openthread/BUILD.gn @@ -22,4 +22,4 @@ group("openthread_device_deps") { public_deps += [ "${openthread_root}:libopenthread-mtd" ] } } -} \ No newline at end of file +} From 5ab1100a1880e1c44833b2794cfff36995db4770 Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Fri, 12 Aug 2022 23:02:03 -0400 Subject: [PATCH 13/18] some cleanup --- examples/chef/efr32/BUILD.gn | 4 ---- examples/light-switch-app/efr32/BUILD.gn | 4 ---- examples/lighting-app/efr32/BUILD.gn | 4 ---- examples/lock-app/efr32/BUILD.gn | 4 ---- examples/window-app/efr32/BUILD.gn | 4 ---- 5 files changed, 20 deletions(-) diff --git a/examples/chef/efr32/BUILD.gn b/examples/chef/efr32/BUILD.gn index b4cad9a8dfafac..cdde6c204a71f0 100644 --- a/examples/chef/efr32/BUILD.gn +++ b/examples/chef/efr32/BUILD.gn @@ -27,10 +27,6 @@ import("${chip_root}/src/platform/device.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/app/chip_data_model.gni") -if (chip_enable_openthread) { - import("//build_overrides/openthread.gni") -} - if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") import("$dir_pw_build/target_types.gni") diff --git a/examples/light-switch-app/efr32/BUILD.gn b/examples/light-switch-app/efr32/BUILD.gn index cd12030c56f06d..4a5bd7b9b959bd 100644 --- a/examples/light-switch-app/efr32/BUILD.gn +++ b/examples/light-switch-app/efr32/BUILD.gn @@ -24,10 +24,6 @@ import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") -if (chip_enable_openthread) { - import("//build_overrides/openthread.gni") -} - if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") import("$dir_pw_build/target_types.gni") diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index 6d53d1aecfae77..5c10137834cc35 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -25,10 +25,6 @@ import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") -if (chip_enable_openthread) { - import("//build_overrides/openthread.gni") -} - if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") import("$dir_pw_build/target_types.gni") diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index df84852338e381..3f341496608e2c 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -24,10 +24,6 @@ import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") -if (chip_enable_openthread) { - import("//build_overrides/openthread.gni") -} - if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") import("$dir_pw_build/target_types.gni") diff --git a/examples/window-app/efr32/BUILD.gn b/examples/window-app/efr32/BUILD.gn index c838467c164a7d..f295c14d19d9e6 100644 --- a/examples/window-app/efr32/BUILD.gn +++ b/examples/window-app/efr32/BUILD.gn @@ -24,10 +24,6 @@ import("${efr32_sdk_build_root}/efr32_sdk.gni") assert(current_os == "freertos") -if (chip_enable_openthread) { - import("//build_overrides/openthread.gni") -} - project_dir = "${chip_root}/examples/window-app" efr32_project_dir = "${project_dir}/efr32" examples_plat_dir = "${chip_root}/examples/platform/efr32" From 50701f4cf7e0434f4e4edc7813affa0f36e4055c Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Fri, 12 Aug 2022 23:24:12 -0400 Subject: [PATCH 14/18] more cleanup --- examples/lighting-app/efr32/BUILD.gn | 1 - src/platform/EFR32/BUILD.gn | 1 - src/platform/EFR32/args.gni | 1 + src/test_driver/efr32/BUILD.gn | 1 - 4 files changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index 5c10137834cc35..05833cfe8ffca9 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -18,7 +18,6 @@ import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") import("${build_root}/config/defaults.gni") -import("${efr32_sdk_build_root}/efr32_board.gni") import("${efr32_sdk_build_root}/efr32_executable.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") diff --git a/src/platform/EFR32/BUILD.gn b/src/platform/EFR32/BUILD.gn index 795734138e0b95..73cda01e955f26 100644 --- a/src/platform/EFR32/BUILD.gn +++ b/src/platform/EFR32/BUILD.gn @@ -13,7 +13,6 @@ # limitations under the License. import("//build_overrides/chip.gni") -import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") import("${chip_root}/src/platform/device.gni") diff --git a/src/platform/EFR32/args.gni b/src/platform/EFR32/args.gni index 699d1417fc70a8..7b80e77e100190 100644 --- a/src/platform/EFR32/args.gni +++ b/src/platform/EFR32/args.gni @@ -15,6 +15,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") + import("${chip_root}/examples/platform/efr32/args.gni") import("${chip_root}/src/crypto/crypto.gni") diff --git a/src/test_driver/efr32/BUILD.gn b/src/test_driver/efr32/BUILD.gn index 9339e727804741..ebba9b292a5667 100644 --- a/src/test_driver/efr32/BUILD.gn +++ b/src/test_driver/efr32/BUILD.gn @@ -15,7 +15,6 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") -import("//build_overrides/openthread.gni") import("//build_overrides/pigweed.gni") import("${build_root}/config/defaults.gni") From c9922667526ea57a4443d90fcb8c6b5883938713 Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Sat, 13 Aug 2022 01:23:03 -0400 Subject: [PATCH 15/18] Fix wifi build --- third_party/silabs/BUILD.gn | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index 5c5de855043a1b..f847171e020902 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -31,12 +31,14 @@ group("efr32_sdk") { public_deps = [ efr32_sdk_target ] } -group("openthread_cli") { - if (use_silabs_thread_lib == false) { - if (chip_openthread_ftd) { - public_deps = [ "${sl_openthread_root}:libopenthread-cli-ftd" ] - } else { - public_deps = [ "${sl_openthread_root}:libopenthread-cli-mtd" ] +if (chip_enable_openthread) { + group("openthread_cli") { + if (use_silabs_thread_lib == false) { + if (chip_openthread_ftd) { + public_deps = [ "${sl_openthread_root}:libopenthread-cli-ftd" ] + } else { + public_deps = [ "${sl_openthread_root}:libopenthread-cli-mtd" ] + } } } } From c3355cf6d925d9d5bd2f6476f8e09a95b7ee5227 Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Mon, 15 Aug 2022 17:20:00 -0400 Subject: [PATCH 16/18] addresses PR comments --- examples/chef/efr32/.gn | 2 -- examples/chef/efr32/BUILD.gn | 6 +----- examples/chef/efr32/args.gni | 2 ++ examples/light-switch-app/efr32/.gn | 2 -- examples/light-switch-app/efr32/BUILD.gn | 6 +----- examples/light-switch-app/efr32/args.gni | 2 ++ examples/lighting-app/efr32/.gn | 2 -- examples/lighting-app/efr32/BUILD.gn | 5 +---- examples/lighting-app/efr32/args.gni | 3 +++ examples/lock-app/efr32/.gn | 2 -- examples/lock-app/efr32/BUILD.gn | 6 +----- examples/lock-app/efr32/args.gni | 2 ++ examples/platform/efr32/BUILD.gn | 2 +- examples/thermostat/efr32/BUILD.gn | 6 +----- examples/window-app/efr32/.gn | 2 -- examples/window-app/efr32/BUILD.gn | 6 +----- examples/window-app/efr32/args.gni | 2 ++ src/inet/BUILD.gn | 2 +- src/platform/EFR32/BUILD.gn | 4 +++- src/test_driver/efr32/.gn | 2 -- src/test_driver/efr32/BUILD.gn | 6 +----- src/test_driver/efr32/args.gni | 3 +++ third_party/openthread/BUILD.gn | 2 +- third_party/silabs/BUILD.gn | 4 ++-- 24 files changed, 29 insertions(+), 52 deletions(-) diff --git a/examples/chef/efr32/.gn b/examples/chef/efr32/.gn index ae71c73f3c06aa..291da0198d8cc8 100644 --- a/examples/chef/efr32/.gn +++ b/examples/chef/efr32/.gn @@ -25,7 +25,5 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_openthread_ftd = true - openthread_external_platform = - "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/examples/chef/efr32/BUILD.gn b/examples/chef/efr32/BUILD.gn index cdde6c204a71f0..efaace05910a0b 100644 --- a/examples/chef/efr32/BUILD.gn +++ b/examples/chef/efr32/BUILD.gn @@ -206,13 +206,9 @@ efr32_executable("chef_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/third_party/openthread:openthread_device_deps", + "${chip_root}/third_party/openthread:openthread", "${examples_plat_dir}:efr-matter-shell", ] - - if (enable_openthread_cli) { - deps += [ "${efr32_sdk_build_root}:openthread_cli" ] - } } if (chip_enable_ota_requestor) { diff --git a/examples/chef/efr32/args.gni b/examples/chef/efr32/args.gni index 7d077dce704c2f..6f6b3d248ee53b 100644 --- a/examples/chef/efr32/args.gni +++ b/examples/chef/efr32/args.gni @@ -24,3 +24,5 @@ pw_rpc_CONFIG = "$dir_pw_rpc:disable_global_mutex" pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log:check_backend" chip_enable_openthread = true +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" diff --git a/examples/light-switch-app/efr32/.gn b/examples/light-switch-app/efr32/.gn index ae71c73f3c06aa..291da0198d8cc8 100644 --- a/examples/light-switch-app/efr32/.gn +++ b/examples/light-switch-app/efr32/.gn @@ -25,7 +25,5 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_openthread_ftd = true - openthread_external_platform = - "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/examples/light-switch-app/efr32/BUILD.gn b/examples/light-switch-app/efr32/BUILD.gn index 4a5bd7b9b959bd..026dc46d13195c 100644 --- a/examples/light-switch-app/efr32/BUILD.gn +++ b/examples/light-switch-app/efr32/BUILD.gn @@ -199,13 +199,9 @@ efr32_executable("light_switch_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/third_party/openthread:openthread_device_deps", + "${chip_root}/third_party/openthread:openthread", "${examples_plat_dir}:efr-matter-shell", ] - - if (enable_openthread_cli) { - deps += [ "${efr32_sdk_build_root}:openthread_cli" ] - } } # Attestation Credentials diff --git a/examples/light-switch-app/efr32/args.gni b/examples/light-switch-app/efr32/args.gni index 7df1c5e400f56f..8e1885d95d18d4 100644 --- a/examples/light-switch-app/efr32/args.gni +++ b/examples/light-switch-app/efr32/args.gni @@ -24,3 +24,5 @@ pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log:check_backend" chip_enable_openthread = true pw_rpc_CONFIG = "$dir_pw_rpc:disable_global_mutex" +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" diff --git a/examples/lighting-app/efr32/.gn b/examples/lighting-app/efr32/.gn index ae71c73f3c06aa..291da0198d8cc8 100644 --- a/examples/lighting-app/efr32/.gn +++ b/examples/lighting-app/efr32/.gn @@ -25,7 +25,5 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_openthread_ftd = true - openthread_external_platform = - "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index 05833cfe8ffca9..15f6e0171c5aaa 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -204,13 +204,10 @@ efr32_executable("lighting_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/third_party/openthread:openthread_device_deps", + "${chip_root}/third_party/openthread:openthread", "${examples_plat_dir}:efr-matter-shell", ] - if (enable_openthread_cli) { - deps += [ "${efr32_sdk_build_root}:openthread_cli" ] - } } if (chip_enable_ota_requestor) { diff --git a/examples/lighting-app/efr32/args.gni b/examples/lighting-app/efr32/args.gni index 7df1c5e400f56f..9121d153beeb5c 100644 --- a/examples/lighting-app/efr32/args.gni +++ b/examples/lighting-app/efr32/args.gni @@ -24,3 +24,6 @@ pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log:check_backend" chip_enable_openthread = true pw_rpc_CONFIG = "$dir_pw_rpc:disable_global_mutex" + +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" \ No newline at end of file diff --git a/examples/lock-app/efr32/.gn b/examples/lock-app/efr32/.gn index ae71c73f3c06aa..291da0198d8cc8 100644 --- a/examples/lock-app/efr32/.gn +++ b/examples/lock-app/efr32/.gn @@ -25,7 +25,5 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_openthread_ftd = true - openthread_external_platform = - "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index 3f341496608e2c..c98bebfed6d942 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -201,13 +201,9 @@ efr32_executable("lock_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/third_party/openthread:openthread_device_deps", + "${chip_root}/third_party/openthread:openthread", "${examples_plat_dir}:efr-matter-shell", ] - - if (enable_openthread_cli) { - deps += [ "${efr32_sdk_build_root}:openthread_cli" ] - } } if (chip_enable_ota_requestor) { diff --git a/examples/lock-app/efr32/args.gni b/examples/lock-app/efr32/args.gni index b4a0322c442f40..9ff5e1fd3992f1 100644 --- a/examples/lock-app/efr32/args.gni +++ b/examples/lock-app/efr32/args.gni @@ -24,3 +24,5 @@ chip_enable_openthread = true pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log:check_backend" pw_rpc_CONFIG = "$dir_pw_rpc:disable_global_mutex" +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" diff --git a/examples/platform/efr32/BUILD.gn b/examples/platform/efr32/BUILD.gn index b6551ed6d090a9..d1522f93d6d686 100644 --- a/examples/platform/efr32/BUILD.gn +++ b/examples/platform/efr32/BUILD.gn @@ -46,7 +46,7 @@ source_set("openthread_core_config_efr32_chip_examples") { public_deps = [ "${efr32_sdk_build_root}:efr32_sdk" ] - if (use_silabs_thread_lib == true) { + if (use_silabs_thread_lib) { public_deps += [ "${efr32_sdk_build_root}:openthread_core_config_efr32" ] } else { public_deps += [ "${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32" ] diff --git a/examples/thermostat/efr32/BUILD.gn b/examples/thermostat/efr32/BUILD.gn index ac491a2ab04e7c..fe2be76adf88a8 100644 --- a/examples/thermostat/efr32/BUILD.gn +++ b/examples/thermostat/efr32/BUILD.gn @@ -195,13 +195,9 @@ efr32_executable("thermostat_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/third_party/openthread:openthread_device_deps", + "${chip_root}/third_party/openthread:openthread", "${examples_plat_dir}:efr-matter-shell", ] - - if (enable_openthread_cli) { - deps += [ "${efr32_sdk_build_root}:openthread_cli" ] - } } # Attestation Credentials diff --git a/examples/window-app/efr32/.gn b/examples/window-app/efr32/.gn index ae71c73f3c06aa..291da0198d8cc8 100644 --- a/examples/window-app/efr32/.gn +++ b/examples/window-app/efr32/.gn @@ -25,7 +25,5 @@ default_args = { target_cpu = "arm" target_os = "freertos" chip_openthread_ftd = true - openthread_external_platform = - "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/examples/window-app/efr32/BUILD.gn b/examples/window-app/efr32/BUILD.gn index f295c14d19d9e6..bcd17e3b6dddcf 100644 --- a/examples/window-app/efr32/BUILD.gn +++ b/examples/window-app/efr32/BUILD.gn @@ -187,13 +187,9 @@ efr32_executable("window_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/third_party/openthread:openthread_device_deps", + "${chip_root}/third_party/openthread:openthread", "${examples_plat_dir}:efr-matter-shell", ] - - if (enable_openthread_cli) { - deps += [ "${efr32_sdk_build_root}:openthread_cli" ] - } } if (chip_enable_ota_requestor) { diff --git a/examples/window-app/efr32/args.gni b/examples/window-app/efr32/args.gni index 0b7ef403df72cd..26f97a8076d141 100644 --- a/examples/window-app/efr32/args.gni +++ b/examples/window-app/efr32/args.gni @@ -23,3 +23,5 @@ chip_enable_ota_requestor = true pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log:check_backend" chip_enable_openthread = true +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" diff --git a/src/inet/BUILD.gn b/src/inet/BUILD.gn index f539ee6139648f..7f3c76cb76a6cf 100644 --- a/src/inet/BUILD.gn +++ b/src/inet/BUILD.gn @@ -109,7 +109,7 @@ static_library("inet") { if (chip_system_config_use_open_thread_inet_endpoints) { public_deps += - [ "${chip_root}/third_party/openthread:openthread_device_deps" ] + [ "${chip_root}/third_party/openthread:openthread" ] } if (chip_inet_config_enable_tcp_endpoint) { diff --git a/src/platform/EFR32/BUILD.gn b/src/platform/EFR32/BUILD.gn index 73cda01e955f26..9f89fb128c911f 100644 --- a/src/platform/EFR32/BUILD.gn +++ b/src/platform/EFR32/BUILD.gn @@ -99,7 +99,9 @@ static_library("EFR32") { ] if (chip_enable_openthread) { public_deps += - [ "${chip_root}/third_party/openthread:openthread_device_deps" ] + [ "${chip_root}/third_party/openthread:openthread" ] + + deps += [ "${chip_root}/third_party/silabs:openthread_cli" ] sources += [ "../OpenThread/OpenThreadUtils.cpp", diff --git a/src/test_driver/efr32/.gn b/src/test_driver/efr32/.gn index ea000c8c2bef29..2c4e61509ee369 100644 --- a/src/test_driver/efr32/.gn +++ b/src/test_driver/efr32/.gn @@ -24,7 +24,5 @@ check_system_includes = true default_args = { target_cpu = "arm" target_os = "freertos" - openthread_external_platform = - "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" import("//args.gni") } diff --git a/src/test_driver/efr32/BUILD.gn b/src/test_driver/efr32/BUILD.gn index ebba9b292a5667..45e4aff6fe40a7 100644 --- a/src/test_driver/efr32/BUILD.gn +++ b/src/test_driver/efr32/BUILD.gn @@ -95,13 +95,9 @@ efr32_executable("efr32_device_tests") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/third_party/openthread:openthread_device_deps", + "${chip_root}/third_party/openthread:openthread", "${examples_plat_dir}:efr-matter-shell", ] - - if (enable_openthread_cli) { - deps += [ "${efr32_sdk_build_root}:openthread_cli" ] - } } deps += pw_build_LINK_DEPS diff --git a/src/test_driver/efr32/args.gni b/src/test_driver/efr32/args.gni index 8addd1383ed934..8db9c5e87eb212 100644 --- a/src/test_driver/efr32/args.gni +++ b/src/test_driver/efr32/args.gni @@ -27,6 +27,9 @@ chip_enable_openthread = true chip_openthread_ftd = true chip_monolithic_tests = true +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" + #Fix me : Test driver should use same config as examples # Problem : Linker issue if set to true chip_system_config_use_open_thread_inet_endpoints = false diff --git a/third_party/openthread/BUILD.gn b/third_party/openthread/BUILD.gn index 7c25798474cedc..752f245738a750 100644 --- a/third_party/openthread/BUILD.gn +++ b/third_party/openthread/BUILD.gn @@ -8,7 +8,7 @@ declare_args() { chip_openthread_target = "" } -group("openthread_device_deps") { +group("openthread") { if (chip_openthread_target != "") { public_deps = [ chip_openthread_target ] } else { diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index f847171e020902..c4f96d18d339f5 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -33,7 +33,7 @@ group("efr32_sdk") { if (chip_enable_openthread) { group("openthread_cli") { - if (use_silabs_thread_lib == false) { + if (!use_silabs_thread_lib) { if (chip_openthread_ftd) { public_deps = [ "${sl_openthread_root}:libopenthread-cli-ftd" ] } else { @@ -151,7 +151,7 @@ if (use_silabs_thread_lib) { # selected thread device type FTD or MTD XTD = "ftd" - if (chip_openthread_ftd == false) { + if (!chip_openthread_ftd) { XTD = "mtd" } From 3bfc7f2408147fdb4c5f4a3528d1040bacdb1d8f Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Mon, 15 Aug 2022 19:45:26 -0400 Subject: [PATCH 17/18] restyle --- examples/chef/efr32/args.gni | 2 +- examples/lighting-app/efr32/BUILD.gn | 1 - examples/lighting-app/efr32/args.gni | 2 +- src/inet/BUILD.gn | 3 +-- src/platform/EFR32/BUILD.gn | 3 +-- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/examples/chef/efr32/args.gni b/examples/chef/efr32/args.gni index 6f6b3d248ee53b..4e322f1022501b 100644 --- a/examples/chef/efr32/args.gni +++ b/examples/chef/efr32/args.gni @@ -25,4 +25,4 @@ pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log:check_backend" chip_enable_openthread = true openthread_external_platform = - "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index 15f6e0171c5aaa..81a25554eb9ba2 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -207,7 +207,6 @@ efr32_executable("lighting_app") { "${chip_root}/third_party/openthread:openthread", "${examples_plat_dir}:efr-matter-shell", ] - } if (chip_enable_ota_requestor) { diff --git a/examples/lighting-app/efr32/args.gni b/examples/lighting-app/efr32/args.gni index 9121d153beeb5c..1e5ed4ca14102c 100644 --- a/examples/lighting-app/efr32/args.gni +++ b/examples/lighting-app/efr32/args.gni @@ -26,4 +26,4 @@ chip_enable_openthread = true pw_rpc_CONFIG = "$dir_pw_rpc:disable_global_mutex" openthread_external_platform = - "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" \ No newline at end of file + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" diff --git a/src/inet/BUILD.gn b/src/inet/BUILD.gn index 7f3c76cb76a6cf..5a85beb667c25b 100644 --- a/src/inet/BUILD.gn +++ b/src/inet/BUILD.gn @@ -108,8 +108,7 @@ static_library("inet") { } if (chip_system_config_use_open_thread_inet_endpoints) { - public_deps += - [ "${chip_root}/third_party/openthread:openthread" ] + public_deps += [ "${chip_root}/third_party/openthread:openthread" ] } if (chip_inet_config_enable_tcp_endpoint) { diff --git a/src/platform/EFR32/BUILD.gn b/src/platform/EFR32/BUILD.gn index 9f89fb128c911f..e406ce994eedee 100644 --- a/src/platform/EFR32/BUILD.gn +++ b/src/platform/EFR32/BUILD.gn @@ -98,8 +98,7 @@ static_library("EFR32") { "$dir_pw_kvs", ] if (chip_enable_openthread) { - public_deps += - [ "${chip_root}/third_party/openthread:openthread" ] + public_deps += [ "${chip_root}/third_party/openthread:openthread" ] deps += [ "${chip_root}/third_party/silabs:openthread_cli" ] From 0d180e901962c606188e23b22757893ed14cb4f7 Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Mon, 15 Aug 2022 19:55:11 -0400 Subject: [PATCH 18/18] rebase and fix conflict --- examples/chef/efr32/.gn | 1 - examples/light-switch-app/efr32/.gn | 1 - examples/lighting-app/efr32/.gn | 1 - examples/lock-app/efr32/.gn | 1 - examples/window-app/efr32/.gn | 1 - scripts/checkout_submodules.py | 6 ++++-- src/test_driver/efr32/.gn | 1 - third_party/cyw30739_sdk/repos/30739A0 | 2 +- third_party/openthread/ot-ifx | 2 +- third_party/silabs/matter_support | 2 +- third_party/ti_simplelink_sdk/repo_cc32xx | 2 +- 11 files changed, 8 insertions(+), 12 deletions(-) diff --git a/examples/chef/efr32/.gn b/examples/chef/efr32/.gn index 291da0198d8cc8..0ff42d50e06ef0 100644 --- a/examples/chef/efr32/.gn +++ b/examples/chef/efr32/.gn @@ -13,7 +13,6 @@ # limitations under the License. import("//build_overrides/build.gni") -import("//build_overrides/chip.gni") # The location of the build configuration file. buildconfig = "${build_root}/config/BUILDCONFIG.gn" diff --git a/examples/light-switch-app/efr32/.gn b/examples/light-switch-app/efr32/.gn index 291da0198d8cc8..0ff42d50e06ef0 100644 --- a/examples/light-switch-app/efr32/.gn +++ b/examples/light-switch-app/efr32/.gn @@ -13,7 +13,6 @@ # limitations under the License. import("//build_overrides/build.gni") -import("//build_overrides/chip.gni") # The location of the build configuration file. buildconfig = "${build_root}/config/BUILDCONFIG.gn" diff --git a/examples/lighting-app/efr32/.gn b/examples/lighting-app/efr32/.gn index 291da0198d8cc8..0ff42d50e06ef0 100644 --- a/examples/lighting-app/efr32/.gn +++ b/examples/lighting-app/efr32/.gn @@ -13,7 +13,6 @@ # limitations under the License. import("//build_overrides/build.gni") -import("//build_overrides/chip.gni") # The location of the build configuration file. buildconfig = "${build_root}/config/BUILDCONFIG.gn" diff --git a/examples/lock-app/efr32/.gn b/examples/lock-app/efr32/.gn index 291da0198d8cc8..0ff42d50e06ef0 100644 --- a/examples/lock-app/efr32/.gn +++ b/examples/lock-app/efr32/.gn @@ -13,7 +13,6 @@ # limitations under the License. import("//build_overrides/build.gni") -import("//build_overrides/chip.gni") # The location of the build configuration file. buildconfig = "${build_root}/config/BUILDCONFIG.gn" diff --git a/examples/window-app/efr32/.gn b/examples/window-app/efr32/.gn index 291da0198d8cc8..0ff42d50e06ef0 100644 --- a/examples/window-app/efr32/.gn +++ b/examples/window-app/efr32/.gn @@ -13,7 +13,6 @@ # limitations under the License. import("//build_overrides/build.gni") -import("//build_overrides/chip.gni") # The location of the build configuration file. buildconfig = "${build_root}/config/BUILDCONFIG.gn" diff --git a/scripts/checkout_submodules.py b/scripts/checkout_submodules.py index 486a3e7b3b355d..b150b8df71253e 100755 --- a/scripts/checkout_submodules.py +++ b/scripts/checkout_submodules.py @@ -74,7 +74,7 @@ def make_chip_root_safe_directory() -> None: subprocess.check_call(['git', 'config', '--global', '--add', 'safe.directory', CHIP_ROOT]) -def checkout_modules(modules: list, shallow: bool, force: bool) -> None: +def checkout_modules(modules: list, shallow: bool, force: bool, recursive: bool) -> None: names = [module.name.replace('submodule "', '').replace('"', '') for module in modules] names = ', '.join(names) logging.info(f'Checking out: {names}') @@ -82,6 +82,7 @@ def checkout_modules(modules: list, shallow: bool, force: bool) -> None: cmd = ['git', '-C', CHIP_ROOT, 'submodule', 'update', '--init'] cmd += ['--depth', '1'] if shallow else [] cmd += ['--force'] if force else [] + cmd += ['--recursive'] if recursive else [] cmd += [module.path for module in modules] subprocess.check_call(cmd) @@ -109,6 +110,7 @@ def main(): parser.add_argument('--force', action='store_true', help='Perform action despite of warnings') parser.add_argument('--deinit-unmatched', action='store_true', help='Deinitialize submodules for non-matching platforms') + parser.add_argument('--recursive', action='store_true', help='Recursive init of the listed submodules') args = parser.parse_args() modules = list(load_module_info()) @@ -117,7 +119,7 @@ def main(): unmatched_modules = [m for m in modules if not module_matches_platforms(m, selected_platforms)] make_chip_root_safe_directory() - checkout_modules(selected_modules, args.shallow, args.force) + checkout_modules(selected_modules, args.shallow, args.force, args.recursive) if args.deinit_unmatched: deinit_modules(unmatched_modules, args.force) diff --git a/src/test_driver/efr32/.gn b/src/test_driver/efr32/.gn index 2c4e61509ee369..7bb85d530fae5c 100644 --- a/src/test_driver/efr32/.gn +++ b/src/test_driver/efr32/.gn @@ -13,7 +13,6 @@ # limitations under the License. import("//build_overrides/build.gni") -import("//build_overrides/chip.gni") # The location of the build configuration file. buildconfig = "${build_root}/config/BUILDCONFIG.gn" diff --git a/third_party/cyw30739_sdk/repos/30739A0 b/third_party/cyw30739_sdk/repos/30739A0 index c233760b419d55..0b1cbd5ad614be 160000 --- a/third_party/cyw30739_sdk/repos/30739A0 +++ b/third_party/cyw30739_sdk/repos/30739A0 @@ -1 +1 @@ -Subproject commit c233760b419d556632430380e3645fad1766ca22 +Subproject commit 0b1cbd5ad614be9b315f3bd4e1b8512df2c4502f diff --git a/third_party/openthread/ot-ifx b/third_party/openthread/ot-ifx index 64bc0568bbb713..2ee7240000f9bc 160000 --- a/third_party/openthread/ot-ifx +++ b/third_party/openthread/ot-ifx @@ -1 +1 @@ -Subproject commit 64bc0568bbb7136244f2ae5e58ae074b64392e9b +Subproject commit 2ee7240000f9bc6a876f3f4b31f02ca82dca5f43 diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index a7801b3fa49327..c9d65e0111fb77 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit a7801b3fa493270b6832061ec9997eca3767ba67 +Subproject commit c9d65e0111fb7708d41f86bc999bb22de43b5915 diff --git a/third_party/ti_simplelink_sdk/repo_cc32xx b/third_party/ti_simplelink_sdk/repo_cc32xx index e5fbefba9c3c3a..13532baa294744 160000 --- a/third_party/ti_simplelink_sdk/repo_cc32xx +++ b/third_party/ti_simplelink_sdk/repo_cc32xx @@ -1 +1 @@ -Subproject commit e5fbefba9c3c3afa9c2c967b713c77e282d560fe +Subproject commit 13532baa2947440ced2f2abefd6a57b478f5100d