diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 320dad29dadd31..16aaaa42a189d4 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 --recursive --platform efr32 + run: scripts/checkout_submodules.py --shallow --platform efr32 # - name: Out of Tree verification # run: third_party/silabs/out_of_tree_verification.sh diff --git a/.gitmodules b/.gitmodules index abde0e5f8cdfd5..16d589e739d539 100644 --- a/.gitmodules +++ b/.gitmodules @@ -78,8 +78,7 @@ platforms = qpg [submodule "third_party/openthread/ot-efr32"] path = third_party/openthread/ot-efr32 - url = https://github.com/SiliconLabs/ot-efr32.git - branch = matter_sve + url = https://github.com/openthread/ot-efr32.git platforms = efr32 [submodule "third_party/openthread/ot-ifx"] path = third_party/openthread/ot-ifx diff --git a/examples/chef/efr32/BUILD.gn b/examples/chef/efr32/BUILD.gn index efaace05910a0b..e938574e195aa6 100644 --- a/examples/chef/efr32/BUILD.gn +++ b/examples/chef/efr32/BUILD.gn @@ -206,9 +206,21 @@ efr32_executable("chef_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/third_party/openthread:openthread", + "${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", + ] + } } if (chip_enable_ota_requestor) { diff --git a/examples/chef/efr32/args.gni b/examples/chef/efr32/args.gni index 4e322f1022501b..7d077dce704c2f 100644 --- a/examples/chef/efr32/args.gni +++ b/examples/chef/efr32/args.gni @@ -24,5 +24,3 @@ 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/chef/efr32/include/AppConfig.h b/examples/chef/efr32/include/AppConfig.h index 946b593cab50a4..91501d889a6234 100644 --- a/examples/chef/efr32/include/AppConfig.h +++ b/examples/chef/efr32/include/AppConfig.h @@ -32,7 +32,7 @@ extern "C" { #endif -void efr32InitLog(void); +void efr32LogInit(void); void efr32Log(const char * aFormat, ...); #define EFR32_LOG(...) efr32Log(__VA_ARGS__); diff --git a/examples/light-switch-app/efr32/BUILD.gn b/examples/light-switch-app/efr32/BUILD.gn index 026dc46d13195c..b3fb8fdd5b86c8 100644 --- a/examples/light-switch-app/efr32/BUILD.gn +++ b/examples/light-switch-app/efr32/BUILD.gn @@ -199,9 +199,21 @@ efr32_executable("light_switch_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/third_party/openthread:openthread", + "${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", + ] + } } # Attestation Credentials diff --git a/examples/light-switch-app/efr32/args.gni b/examples/light-switch-app/efr32/args.gni index 8e1885d95d18d4..7df1c5e400f56f 100644 --- a/examples/light-switch-app/efr32/args.gni +++ b/examples/light-switch-app/efr32/args.gni @@ -24,5 +24,3 @@ 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/light-switch-app/efr32/include/AppConfig.h b/examples/light-switch-app/efr32/include/AppConfig.h index 946b593cab50a4..91501d889a6234 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 efr32InitLog(void); +void efr32LogInit(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 81a25554eb9ba2..9a9e4c15b8f33c 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -204,9 +204,21 @@ efr32_executable("lighting_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/third_party/openthread:openthread", + "${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", + ] + } } if (chip_enable_ota_requestor) { diff --git a/examples/lighting-app/efr32/args.gni b/examples/lighting-app/efr32/args.gni index 1e5ed4ca14102c..7df1c5e400f56f 100644 --- a/examples/lighting-app/efr32/args.gni +++ b/examples/lighting-app/efr32/args.gni @@ -24,6 +24,3 @@ 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/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index c98bebfed6d942..a739b266110543 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -201,9 +201,21 @@ efr32_executable("lock_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/third_party/openthread:openthread", + "${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", + ] + } } if (chip_enable_ota_requestor) { diff --git a/examples/lock-app/efr32/args.gni b/examples/lock-app/efr32/args.gni index 9ff5e1fd3992f1..b4a0322c442f40 100644 --- a/examples/lock-app/efr32/args.gni +++ b/examples/lock-app/efr32/args.gni @@ -24,5 +24,3 @@ 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/lock-app/efr32/include/AppConfig.h b/examples/lock-app/efr32/include/AppConfig.h index 096560abefe349..852083cb9cbd91 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 efr32InitLog(void); +void efr32LogInit(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 ae2846d90c6caa..74a5ae90e43c83 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 efr32InitLog(void); +void efr32LogInit(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 8935b7f3bb7284..61a5430dafeeb8 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 efr32InitLog(void); +void efr32LogInit(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 d1522f93d6d686..ba36aeff00c83b 100644 --- a/examples/platform/efr32/BUILD.gn +++ b/examples/platform/efr32/BUILD.gn @@ -15,7 +15,6 @@ 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") config("chip_examples_project_config") { @@ -41,19 +40,14 @@ config("chip_examples_project_config") { } source_set("openthread_core_config_efr32_chip_examples") { - if (chip_enable_openthread) { - sources = [ "project_include/OpenThreadConfig.h" ] + sources = [ "project_include/OpenThreadConfig.h" ] - public_deps = [ "${efr32_sdk_build_root}:efr32_sdk" ] - - 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" ] - } + public_deps = [ + "${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32", + "${efr32_sdk_build_root}:efr32_sdk", + ] - public_configs = [ ":chip_examples_project_config" ] - } + public_configs = [ ":chip_examples_project_config" ] } source_set("efr-matter-shell") { diff --git a/examples/platform/efr32/efr32_utils.h b/examples/platform/efr32/efr32_utils.h index 98087091d9c0e9..610bde3e4e2511 100644 --- a/examples/platform/efr32/efr32_utils.h +++ b/examples/platform/efr32/efr32_utils.h @@ -24,7 +24,7 @@ extern "C" { #endif -void efr32InitLog(void); +void efr32LogInit(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 d0fb913165c469..f251f48f5dbab1 100644 --- a/examples/platform/efr32/init_efrPlatform.cpp +++ b/examples/platform/efr32/init_efrPlatform.cpp @@ -72,11 +72,13 @@ void init_efrPlatform(void) #endif #if EFR32_LOG_ENABLED - efr32InitLog(); + efr32LogInit(); #endif #if CHIP_ENABLE_OPENTHREAD - sl_ot_sys_init(); + efr32RadioInit(); + efr32AlarmInit(); + efr32MiscInit(); #endif // CHIP_ENABLE_OPENTHREAD } diff --git a/examples/shell/efr32/include/AppConfig.h b/examples/shell/efr32/include/AppConfig.h index 743c6eddbb18ad..a14ec9f589f735 100644 --- a/examples/shell/efr32/include/AppConfig.h +++ b/examples/shell/efr32/include/AppConfig.h @@ -54,7 +54,7 @@ extern "C" { #endif -void efr32InitLog(void); +void efr32LogInit(void); void efr32Log(const char * aFormat, ...); #define EFR32_LOG(...) efr32Log(__VA_ARGS__); diff --git a/examples/thermostat/efr32/BUILD.gn b/examples/thermostat/efr32/BUILD.gn index fe2be76adf88a8..90f61b99ca1ad6 100644 --- a/examples/thermostat/efr32/BUILD.gn +++ b/examples/thermostat/efr32/BUILD.gn @@ -195,9 +195,21 @@ efr32_executable("thermostat_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/third_party/openthread:openthread", + "${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", + ] + } } # Attestation Credentials diff --git a/examples/window-app/efr32/BUILD.gn b/examples/window-app/efr32/BUILD.gn index bcd17e3b6dddcf..fad09d7f4d3ce7 100644 --- a/examples/window-app/efr32/BUILD.gn +++ b/examples/window-app/efr32/BUILD.gn @@ -187,9 +187,21 @@ efr32_executable("window_app") { # OpenThread Settings if (chip_enable_openthread) { deps += [ - "${chip_root}/third_party/openthread:openthread", + "${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", + ] + } } if (chip_enable_ota_requestor) { diff --git a/examples/window-app/efr32/args.gni b/examples/window-app/efr32/args.gni index 26f97a8076d141..0b7ef403df72cd 100644 --- a/examples/window-app/efr32/args.gni +++ b/examples/window-app/efr32/args.gni @@ -23,5 +23,3 @@ 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/examples/window-app/efr32/include/AppConfig.h b/examples/window-app/efr32/include/AppConfig.h index a9957cf77b5bb9..d8a68d9982e4b8 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 efr32InitLog(void); +void efr32LogInit(void); void efr32Log(const char * aFormat, ...); #define EFR32_LOG(...) efr32Log(__VA_ARGS__); diff --git a/scripts/checkout_submodules.py b/scripts/checkout_submodules.py index b150b8df71253e..486a3e7b3b355d 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, recursive: bool) -> None: +def checkout_modules(modules: list, shallow: bool, force: bool) -> None: names = [module.name.replace('submodule "', '').replace('"', '') for module in modules] names = ', '.join(names) logging.info(f'Checking out: {names}') @@ -82,7 +82,6 @@ def checkout_modules(modules: list, shallow: bool, force: bool, recursive: bool) 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) @@ -110,7 +109,6 @@ 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()) @@ -119,7 +117,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, args.recursive) + checkout_modules(selected_modules, args.shallow, args.force) if args.deinit_unmatched: deinit_modules(unmatched_modules, args.force) diff --git a/scripts/examples/gn_efr32_example.sh b/scripts/examples/gn_efr32_example.sh index 5b47c945c771a8..6882bba7d44d00 100755 --- a/scripts/examples/gn_efr32_example.sh +++ b/scripts/examples/gn_efr32_example.sh @@ -34,7 +34,6 @@ set -x env USE_WIFI=false -SILABS_THREAD_TARGET=\""../silabs:ot-efr32-cert"\" USAGE="./scripts/examples/gn_efr32_example.sh []" if [ "$#" == "0" ]; then @@ -103,8 +102,6 @@ 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 - use the silabs openthread library " elif [ "$#" -lt "2" ]; then echo "Invalid number of arguments @@ -152,10 +149,6 @@ else optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true " shift ;; - --use_ot_lib) - optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" " - shift - ;; *) if [ "$1" =~ *"use_rs911x=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then USE_WIFI=true diff --git a/src/inet/BUILD.gn b/src/inet/BUILD.gn index 5a85beb667c25b..6e671c0f7b358e 100644 --- a/src/inet/BUILD.gn +++ b/src/inet/BUILD.gn @@ -108,7 +108,13 @@ static_library("inet") { } if (chip_system_config_use_open_thread_inet_endpoints) { - public_deps += [ "${chip_root}/third_party/openthread:openthread" ] + 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" ] + } } if (chip_inet_config_enable_tcp_endpoint) { diff --git a/src/platform/EFR32/BUILD.gn b/src/platform/EFR32/BUILD.gn index e406ce994eedee..cf1b3b77bcec1c 100644 --- a/src/platform/EFR32/BUILD.gn +++ b/src/platform/EFR32/BUILD.gn @@ -97,10 +97,15 @@ static_library("EFR32") { "$dir_pw_checksum", "$dir_pw_kvs", ] - if (chip_enable_openthread) { - public_deps += [ "${chip_root}/third_party/openthread:openthread" ] - deps += [ "${chip_root}/third_party/silabs:openthread_cli" ] + if (chip_enable_openthread) { + if (chip_openthread_ftd) { + public_deps += + [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] + } else { + public_deps += + [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] + } sources += [ "../OpenThread/OpenThreadUtils.cpp", diff --git a/src/platform/EFR32/Logging.cpp b/src/platform/EFR32/Logging.cpp index ad0711fe930961..ad78dfae0a033a 100644 --- a/src/platform/EFR32/Logging.cpp +++ b/src/platform/EFR32/Logging.cpp @@ -104,7 +104,7 @@ static void PrintLog(const char * msg) /** * Initialize Segger RTT for logging */ -extern "C" void efr32InitLog(void) +extern "C" void efr32LogInit(void) { #if EFR32_LOG_ENABLED #if LOG_RTT_BUFFER_INDEX != 0 @@ -344,7 +344,7 @@ extern "C" void debugHardfault(uint32_t * sp) if (sLogInitialized == false) { - efr32InitLog(); + efr32LogInit(); } snprintf(formattedMsg, sizeof formattedMsg, LOG_ERROR "HardFault:\n"); diff --git a/src/platform/EFR32/ThreadStackManagerImpl.cpp b/src/platform/EFR32/ThreadStackManagerImpl.cpp index 16d792276644e4..a90db73b620d39 100644 --- a/src/platform/EFR32/ThreadStackManagerImpl.cpp +++ b/src/platform/EFR32/ThreadStackManagerImpl.cpp @@ -100,11 +100,6 @@ 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 7b80e77e100190..a66bd28acf86ef 100644 --- a/src/platform/EFR32/args.gni +++ b/src/platform/EFR32/args.gni @@ -43,12 +43,14 @@ 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" ] +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" + chip_config_memory_management = "platform" pw_build_LINK_DEPS = [ diff --git a/src/test_driver/efr32/.gn b/src/test_driver/efr32/.gn index 7bb85d530fae5c..81cec9d11a421b 100644 --- a/src/test_driver/efr32/.gn +++ b/src/test_driver/efr32/.gn @@ -23,5 +23,6 @@ check_system_includes = true default_args = { target_cpu = "arm" target_os = "freertos" + import("//args.gni") } diff --git a/src/test_driver/efr32/BUILD.gn b/src/test_driver/efr32/BUILD.gn index 45e4aff6fe40a7..d794b4b0ef2485 100644 --- a/src/test_driver/efr32/BUILD.gn +++ b/src/test_driver/efr32/BUILD.gn @@ -88,15 +88,21 @@ 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", ] - # OpenThread Settings - if (chip_enable_openthread) { + if (chip_openthread_ftd) { deps += [ - "${chip_root}/third_party/openthread:openthread", - "${examples_plat_dir}:efr-matter-shell", + "${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/src/test_driver/efr32/args.gni b/src/test_driver/efr32/args.gni index 8db9c5e87eb212..8addd1383ed934 100644 --- a/src/test_driver/efr32/args.gni +++ b/src/test_driver/efr32/args.gni @@ -27,9 +27,6 @@ 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/src/test_driver/efr32/include/AppConfig.h b/src/test_driver/efr32/include/AppConfig.h index 3b83d375b46219..302dba47799e5e 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 efr32InitLog(void); +void efr32LogInit(void); void efr32Log(const char * aFormat, ...); #define EFR32_LOG(...) efr32Log(__VA_ARGS__); void appError(int err); diff --git a/third_party/openthread/BUILD.gn b/third_party/openthread/BUILD.gn deleted file mode 100644 index 752f245738a750..00000000000000 --- a/third_party/openthread/BUILD.gn +++ /dev/null @@ -1,25 +0,0 @@ -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") { - 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" ] - } - } -} diff --git a/third_party/openthread/ot-efr32 b/third_party/openthread/ot-efr32 index fd77faf7a3443f..7a567da02a0785 160000 --- a/third_party/openthread/ot-efr32 +++ b/third_party/openthread/ot-efr32 @@ -1 +1 @@ -Subproject commit fd77faf7a3443f7941dfd9e9713aea09eb08e9b9 +Subproject commit 7a567da02a078546eb34136c1c44170c8832dd55 diff --git a/third_party/openthread/platforms/efr32/BUILD.gn b/third_party/openthread/platforms/efr32/BUILD.gn index b6dba5b98d4351..140070a57b9d8a 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_root}/src/cli/cli_config.h", ] public_deps = [ "${efr32_sdk_build_root}:efr32_sdk" ] @@ -49,7 +49,6 @@ 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", @@ -59,11 +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", ] public_deps = [ ":openthread_core_config_efr32", - "${openthread_efr32_root}/openthread/src/core:libopenthread_core_headers", + "${openthread_root}/src/core:libopenthread_core_headers", "..:libopenthread-platform", "..:libopenthread-platform-utils", ] diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index c4f96d18d339f5..718852a0a2f235 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -12,17 +12,12 @@ # 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") -import("//build_overrides/jlink.gni") -import("${chip_root}/src/platform/device.gni") import("${efr32_sdk_build_root}/efr32_sdk.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") @@ -30,136 +25,3 @@ assert(efr32_sdk_target != "", "efr32_sdk_target must be specified") group("efr32_sdk") { public_deps = [ efr32_sdk_target ] } - -if (chip_enable_openthread) { - group("openthread_cli") { - if (!use_silabs_thread_lib) { - 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" ] - } - - 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/src", - "${sl_openthread_root}/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", - ] - - public_deps = [ - ":libopenthread-platform", - "${efr32_sdk_build_root}:efr32_sdk", - ] - - public_configs = [ ":openthread_efr32_config" ] - } - - 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", - "${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", - ] - - public_configs = [ - ":openthread_efr32_config", - ":libopenthread-platform_config", - ] - - public_deps = [ - ":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", - ] - - deps = [ "${efr32_sdk_build_root}:efr32_sdk" ] - - # selected thread device type FTD or MTD - XTD = "ftd" - if (!chip_openthread_ftd) { - XTD = "mtd" - } - - public_configs += [ "${sl_openthread_root}:openthread_${XTD}_config" ] - - libs = [ - "${sl_ot_efr32_root}/libs/libsl_ot_stack_${XTD}_${efr32_family}_gcc.a", - "${sl_ot_efr32_root}/libs/libsl_platform_${XTD}_dmp_${efr32_family}_gcc.a", - ] - } -} diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 727ecea7acd5ef..e4af7e65333a28 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -24,9 +24,6 @@ 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