diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index ee4f04e8143846..17e0b5617b2230 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -109,11 +109,11 @@ jobs: run: | .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ efr32 BRD4187C lighting-app \ - out/efr32-brd4187c-light-rpc/chip-efr32-lighting-example.out \ + out/efr32-brd4187c-light-rpc/matter-silabs-lighting-example.out \ /tmp/bloat_reports/ .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ efr32 BRD4187C window-app \ - out/efr32-brd4187c-window-covering-additional_data_advertising/chip-efr32-window-example.out \ + out/efr32-brd4187c-window-covering-additional_data_advertising/matter-silabs-window-example.out \ /tmp/bloat_reports/ - name: Clean out build output run: rm -rf ./out @@ -122,7 +122,7 @@ jobs: run: | scripts/examples/gn_efr32_example.sh examples/lock-app/silabs/efr32/ out/lock_app_wifi_wf200 BRD4161A is_debug=false chip_logging=false --wifi wf200 --docker .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+wf200 lock-app \ - out/lock_app_wifi_wf200/BRD4161A/chip-efr32-lock-example.out /tmp/bloat_reports/ + out/lock_app_wifi_wf200/BRD4161A/matter-silabs-lock-example.out /tmp/bloat_reports/ - name: Clean out build output run: rm -rf ./out - name: Build example EFR32+RS9116 WiFi Lighting app for BRD4161A @@ -130,7 +130,7 @@ jobs: run: | scripts/examples/gn_efr32_example.sh examples/lighting-app/silabs/efr32/ out/lighting_app_wifi_rs9116 BRD4161A --wifi rs9116 --docker .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+rs9116 lighting-app \ - out/lighting_app_wifi_rs9116/BRD4161A/chip-efr32-lighting-example.out /tmp/bloat_reports/ + out/lighting_app_wifi_rs9116/BRD4161A/matter-silabs-lighting-example.out /tmp/bloat_reports/ - name: Clean out build output run: rm -rf ./out - name: Uploading Size Reports diff --git a/examples/chef/chef.py b/examples/chef/chef.py index 930309f8ddc07a..516d51e3abde4e 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -813,7 +813,7 @@ def main() -> int: elif (options.build_target == "silabs-thread") or (options.build_target == "silabs-wifi"): shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}/efr32") shell.run_cmd( - f"python3 out/{options.sample_device_type_name}/{silabs_board}/chip-efr32-chef-example.flash.py") + f"python3 out/{options.sample_device_type_name}/{silabs_board}/matter-silabs-chef-example.flash.py") shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}") elif (options.build_target == "ameba"): diff --git a/examples/chef/efr32/BUILD.gn b/examples/chef/efr32/BUILD.gn index d047f6e4b4286b..a7a30e2c6396f8 100644 --- a/examples/chef/efr32/BUILD.gn +++ b/examples/chef/efr32/BUILD.gn @@ -82,7 +82,7 @@ efr32_sdk("sdk") { } silabs_executable("chef_app") { - output_name = "chip-efr32-chef-example.out" + output_name = "matter-silabs-chef-example.out" include_dirs = [ "include" ] defines = [] diff --git a/examples/chef/efr32/args.gni b/examples/chef/efr32/args.gni index af4de711ae6876..70e1fb9bd3fac3 100644 --- a/examples/chef/efr32/args.gni +++ b/examples/chef/efr32/args.gni @@ -16,7 +16,7 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") import("${chip_root}/src/platform/efr32/args.gni") -efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_ota_requestor = true chip_enable_openthread = true diff --git a/examples/chef/efr32/build_for_wifi_args.gni b/examples/chef/efr32/build_for_wifi_args.gni index 27e3d837658720..9394037ba0ee38 100644 --- a/examples/chef/efr32/build_for_wifi_args.gni +++ b/examples/chef/efr32/build_for_wifi_args.gni @@ -13,8 +13,8 @@ # limitations under the License. import("//build_overrides/chip.gni") -efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_openthread = false -import("${chip_root}/src/platform/efr32/wifi_args.gni") +import("${chip_root}/src/platform/silabs/wifi_args.gni") chip_enable_ota_requestor = true diff --git a/examples/chef/efr32/with_pw_rpc.gni b/examples/chef/efr32/with_pw_rpc.gni index c705b92b12f6fd..2b0cddeca8f214 100644 --- a/examples/chef/efr32/with_pw_rpc.gni +++ b/examples/chef/efr32/with_pw_rpc.gni @@ -19,7 +19,7 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/efr32/lib/pw_rpc/pw_rpc.gni") import("${chip_root}/examples/platform/efr32/args.gni") -efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_pw_rpc = true chip_enable_openthread = true diff --git a/examples/light-switch-app/silabs/SiWx917/args.gni b/examples/light-switch-app/silabs/SiWx917/args.gni index 0e0bbe544fd35a..89e0768ff5eb6a 100644 --- a/examples/light-switch-app/silabs/SiWx917/args.gni +++ b/examples/light-switch-app/silabs/SiWx917/args.gni @@ -14,9 +14,9 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") -import("${chip_root}/src/platform/silabs/SiWx917/args.gni") +import("${chip_root}/src/platform/silabs/args.gni") -siwx917_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") app_data_model = "${chip_root}/examples/light-switch-app/light-switch-common" chip_enable_ota_requestor = true diff --git a/examples/light-switch-app/silabs/efr32/.gn b/examples/light-switch-app/silabs/efr32/.gn index 4c078f6acefdcc..b05216fc9d7eae 100644 --- a/examples/light-switch-app/silabs/efr32/.gn +++ b/examples/light-switch-app/silabs/efr32/.gn @@ -25,5 +25,5 @@ default_args = { target_os = "freertos" chip_openthread_ftd = true - import("//args.gni") + import("//openthread.gni") } diff --git a/examples/light-switch-app/silabs/efr32/BUILD.gn b/examples/light-switch-app/silabs/efr32/BUILD.gn index e989008ba0efb6..f7351646feb518 100644 --- a/examples/light-switch-app/silabs/efr32/BUILD.gn +++ b/examples/light-switch-app/silabs/efr32/BUILD.gn @@ -18,11 +18,11 @@ import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") import("${build_root}/config/defaults.gni") -import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${efr32_sdk_build_root}/silabs_executable.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") +import("${chip_root}/third_party/silabs/silabs_board.gni") if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") @@ -31,61 +31,93 @@ if (chip_enable_pw_rpc) { assert(current_os == "freertos") -efr32_project_dir = "${chip_root}/examples/light-switch-app/silabs/efr32" -examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" +silabs_project_dir = "${chip_root}/examples/light-switch-app/silabs/efr32" examples_common_plat_dir = "${chip_root}/examples/platform/silabs" -if (chip_enable_ble_rs911x) { - src_plat_dir = "${chip_root}/src/platform/silabs/efr32" + +if (wifi_soc) { + import("${chip_root}/third_party/silabs/SiWx917_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" +} else { + import("${efr32_sdk_build_root}/efr32_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" } -import("${examples_plat_dir}/args.gni") +import("${examples_common_plat_dir}/args.gni") declare_args() { # Dump memory usage at link time. chip_print_memory_usage = false } -efr32_sdk("sdk") { - sources = [ - "${efr32_project_dir}/include/CHIPProjectConfig.h", - "${examples_plat_dir}/FreeRTOSConfig.h", - ] +if (wifi_soc) { + siwx917_sdk("sdk") { + sources = [ + "${examples_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", + ] - include_dirs = [ - "${chip_root}/examples/light-switch-app/silabs/common", - "${chip_root}/src/platform/silabs/efr32", - "${efr32_project_dir}/include", - "${examples_plat_dir}", - "${chip_root}/src/lib", - "${examples_common_plat_dir}", - ] + include_dirs = [ + "${chip_root}/src/platform/silabs/SiWx917", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", + ] - if (use_wf200) { - # TODO efr32_sdk should not need a header from this location - include_dirs += [ "${examples_plat_dir}/wf200" ] + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } } - - if (chip_enable_ble_rs911x) { - # TODO efr32_sdk should not need a header from this location - include_dirs += [ - "${src_plat_dir}/rs911x", - "${examples_plat_dir}/rs911x", - "${examples_plat_dir}/rs911x/hal", +} else { + efr32_sdk("sdk") { + sources = [ + "${examples_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", ] - } - defines = [] - if (chip_enable_pw_rpc) { - defines += [ - "HAL_VCOM_ENABLE=1", - "PW_RPC_ENABLED", + include_dirs = [ + "${chip_root}/examples/light-switch-app/silabs/common", + "${chip_root}/src/platform/silabs/efr32", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", ] + + if (use_wf200) { + # TODO efr32_sdk should not need a header from this location + include_dirs += [ "${examples_plat_dir}/wf200" ] + } + + if (chip_enable_ble_rs911x) { + # TODO efr32_sdk should not need a header from this location + include_dirs += [ + "${chip_root}/src/platform/silabs/efr32/rs911x", + "${examples_plat_dir}/rs911x", + "${examples_plat_dir}/rs911x/hal", + ] + } + + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } } } silabs_executable("light_switch_app") { - output_name = "chip-efr32-light-switch-example.out" - include_dirs = [ "include" ] + output_name = "matter-silabs-light-switch-example.out" + include_dirs = [ + "include", + "${chip_root}/examples/light-switch-app/silabs/common/", + ] defines = [] sources = [ @@ -98,10 +130,15 @@ silabs_executable("light_switch_app") { deps = [ ":sdk", - "${examples_plat_dir}:efr32-common", app_data_model, ] + if (wifi_soc) { + deps += [ "${examples_plat_dir}:siwx917-common" ] + } else { + deps += [ "${examples_plat_dir}:efr32-common" ] + } + if (chip_build_libshell) { sources += [ "${chip_root}/examples/light-switch-app/silabs/common/ShellCommands.cpp", @@ -134,9 +171,14 @@ silabs_executable("light_switch_app") { "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc", - "${examples_plat_dir}/pw_sys_io:pw_sys_io_efr32", ] + if (wifi_soc) { + deps += [ "${examples_plat_dir}/pw_sys_io:pw_sys_io_siwx917" ] + } else { + deps += [ "${examples_plat_dir}/pw_sys_io:pw_sys_io_efr32" ] + } + deps += pw_build_LINK_DEPS include_dirs += [ @@ -169,10 +211,10 @@ silabs_executable("light_switch_app") { output_dir = root_out_dir } -group("efr32") { +group("silabs") { deps = [ ":light_switch_app" ] } group("default") { - deps = [ ":efr32" ] + deps = [ ":silabs" ] } diff --git a/examples/light-switch-app/silabs/efr32/README.md b/examples/light-switch-app/silabs/efr32/README.md index 6b7239ff263550..a5f71d14620277 100644 --- a/examples/light-switch-app/silabs/efr32/README.md +++ b/examples/light-switch-app/silabs/efr32/README.md @@ -162,7 +162,7 @@ arguments - On the command line: $ cd ~/connectedhomeip/examples/light-switch-app/silabs/efr32 - $ python3 out/debug/chip-efr32-light-switch-example.flash.py + $ python3 out/debug/matter-silabs-light-switch-example.flash.py - Or with the Ozone debugger, just load the .out file. diff --git a/examples/light-switch-app/silabs/efr32/build_for_wifi_args.gni b/examples/light-switch-app/silabs/efr32/build_for_wifi_args.gni index bac0164159fe10..ac70e16a8b484f 100644 --- a/examples/light-switch-app/silabs/efr32/build_for_wifi_args.gni +++ b/examples/light-switch-app/silabs/efr32/build_for_wifi_args.gni @@ -14,9 +14,9 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") -efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_openthread = false -import("${chip_root}/src/platform/silabs/efr32/wifi_args.gni") +import("${chip_root}/src/platform/silabs/wifi_args.gni") chip_enable_ota_requestor = true app_data_model = "${chip_root}/examples/light-switch-app/light-switch-common" diff --git a/examples/light-switch-app/silabs/efr32/openthread.gn b/examples/light-switch-app/silabs/efr32/openthread.gn new file mode 100644 index 00000000000000..b05216fc9d7eae --- /dev/null +++ b/examples/light-switch-app/silabs/efr32/openthread.gn @@ -0,0 +1,29 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + chip_openthread_ftd = true + + import("//openthread.gni") +} diff --git a/examples/light-switch-app/silabs/efr32/args.gni b/examples/light-switch-app/silabs/efr32/openthread.gni similarity index 93% rename from examples/light-switch-app/silabs/efr32/args.gni rename to examples/light-switch-app/silabs/efr32/openthread.gni index 779402128b46a7..344d0ea4973481 100644 --- a/examples/light-switch-app/silabs/efr32/args.gni +++ b/examples/light-switch-app/silabs/efr32/openthread.gni @@ -16,10 +16,11 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") import("${chip_root}/src/platform/silabs/efr32/args.gni") -efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") app_data_model = "${chip_root}/examples/light-switch-app/light-switch-common" chip_enable_ota_requestor = true chip_enable_openthread = true + openthread_external_platform = "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" diff --git a/examples/lighting-app/silabs/SiWx917/args.gni b/examples/lighting-app/silabs/SiWx917/args.gni index 3667aef09297db..7157754d68f864 100644 --- a/examples/lighting-app/silabs/SiWx917/args.gni +++ b/examples/lighting-app/silabs/SiWx917/args.gni @@ -14,8 +14,8 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") -siwx917_sdk_target = get_label_info(":sdk", "label_no_toolchain") -import("${chip_root}/src/platform/silabs/SiWx917/args.gni") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") +import("${chip_root}/src/platform/silabs/args.gni") app_data_model = "${chip_root}/examples/lighting-app/silabs/SiWx917/data_model:silabs-lighting" chip_enable_ota_requestor = true diff --git a/examples/lighting-app/silabs/SiWx917/with_pw_rpc.gni b/examples/lighting-app/silabs/SiWx917/with_pw_rpc.gni index 753a655dcd7668..a2f55709d5a7c4 100644 --- a/examples/lighting-app/silabs/SiWx917/with_pw_rpc.gni +++ b/examples/lighting-app/silabs/SiWx917/with_pw_rpc.gni @@ -19,7 +19,7 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/efr32/lib/pw_rpc/pw_rpc.gni") import("${chip_root}/examples/platform/silabs/SiWx917/args.gni") -siwx917_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") app_data_model = "${chip_root}/examples/lighting-app/lighting-common" chip_enable_pw_rpc = true diff --git a/examples/lighting-app/silabs/efr32/.gn b/examples/lighting-app/silabs/efr32/.gn index 4c078f6acefdcc..b05216fc9d7eae 100644 --- a/examples/lighting-app/silabs/efr32/.gn +++ b/examples/lighting-app/silabs/efr32/.gn @@ -25,5 +25,5 @@ default_args = { target_os = "freertos" chip_openthread_ftd = true - import("//args.gni") + import("//openthread.gni") } diff --git a/examples/lighting-app/silabs/efr32/BUILD.gn b/examples/lighting-app/silabs/efr32/BUILD.gn index 391226a9fc7bb9..32022379e8fc8f 100644 --- a/examples/lighting-app/silabs/efr32/BUILD.gn +++ b/examples/lighting-app/silabs/efr32/BUILD.gn @@ -18,11 +18,11 @@ import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") import("${build_root}/config/defaults.gni") -import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${efr32_sdk_build_root}/silabs_executable.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") +import("${chip_root}/third_party/silabs/silabs_board.gni") if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") @@ -31,15 +31,18 @@ if (chip_enable_pw_rpc) { assert(current_os == "freertos") -efr32_project_dir = "${chip_root}/examples/lighting-app/silabs/efr32" -examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" +silabs_project_dir = "${chip_root}/examples/lighting-app/silabs/efr32" examples_common_plat_dir = "${chip_root}/examples/platform/silabs" -if (chip_enable_ble_rs911x) { - src_plat_dir = "${chip_root}/src/platform/silabs/efr32" +if (wifi_soc) { + import("${chip_root}/third_party/silabs/SiWx917_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" +} else { + import("${efr32_sdk_build_root}/efr32_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" } -import("${examples_plat_dir}/args.gni") +import("${examples_common_plat_dir}/args.gni") declare_args() { # Dump memory usage at link time. @@ -60,45 +63,68 @@ if (slc_generate) { "list lines")) } -efr32_sdk("sdk") { - sources = [ - "${efr32_project_dir}/include/CHIPProjectConfig.h", - "${examples_plat_dir}/FreeRTOSConfig.h", - ] +if (wifi_soc) { + siwx917_sdk("sdk") { + sources = [ + "${examples_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", + ] - include_dirs = [ - "${chip_root}/src/platform/silabs/efr32", - "${efr32_project_dir}/include", - "${examples_plat_dir}", - "${chip_root}/src/lib", - "${examples_common_plat_dir}", - ] + include_dirs = [ + "${chip_root}/src/platform/silabs/SiWx917", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", + ] - if (use_wf200) { - # TODO efr32_sdk should not need a header from this location - include_dirs += [ "${examples_plat_dir}/wf200" ] + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } } - - if (chip_enable_ble_rs911x) { - # TODO efr32_sdk should not need a header from this location - include_dirs += [ - "${src_plat_dir}/rs911x", - "${examples_plat_dir}/rs911x", - "${examples_plat_dir}/rs911x/hal", +} else { + efr32_sdk("sdk") { + sources = [ + "${examples_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", ] - } - defines = [] - if (chip_enable_pw_rpc) { - defines += [ - "HAL_VCOM_ENABLE=1", - "PW_RPC_ENABLED", + include_dirs = [ + "${chip_root}/src/platform/silabs/efr32", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", ] + + if (use_wf200) { + # TODO efr32_sdk should not need a header from this location + include_dirs += [ "${examples_plat_dir}/wf200" ] + } + + if (chip_enable_ble_rs911x) { + # TODO efr32_sdk should not need a header from this location + include_dirs += [ + "${examples_plat_dir}/rs911x", + "${examples_plat_dir}/rs911x/hal", + ] + } + + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } } } - silabs_executable("lighting_app") { - output_name = "chip-efr32-lighting-example.out" + output_name = "matter-silabs-lighting-example.out" include_dirs = [ "include" ] defines = [] @@ -115,10 +141,15 @@ silabs_executable("lighting_app") { deps = [ ":sdk", - "${examples_plat_dir}:efr32-common", app_data_model, ] + if (wifi_soc) { + deps += [ "${examples_plat_dir}:siwx917-common" ] + } else { + deps += [ "${examples_plat_dir}:efr32-common" ] + } + if (chip_enable_pw_rpc) { defines += [ "PW_RPC_ENABLED", @@ -153,9 +184,14 @@ silabs_executable("lighting_app") { "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:ot_cli_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:thread_service.nanopb_rpc", - "${examples_plat_dir}/pw_sys_io:pw_sys_io_efr32", ] + if (wifi_soc) { + deps += [ "${examples_plat_dir}/pw_sys_io:pw_sys_io_siwx917" ] + } else { + deps += [ "${examples_plat_dir}/pw_sys_io:pw_sys_io_efr32" ] + } + deps += pw_build_LINK_DEPS include_dirs += [ @@ -188,10 +224,10 @@ silabs_executable("lighting_app") { output_dir = root_out_dir } -group("efr32") { +group("silabs") { deps = [ ":lighting_app" ] } group("default") { - deps = [ ":efr32" ] + deps = [ ":silabs" ] } diff --git a/examples/lighting-app/silabs/efr32/README.md b/examples/lighting-app/silabs/efr32/README.md index 382a69a7871a5c..d4293677238f33 100644 --- a/examples/lighting-app/silabs/efr32/README.md +++ b/examples/lighting-app/silabs/efr32/README.md @@ -156,7 +156,7 @@ arguments - On the command line: $ cd ~/connectedhomeip/examples/lighting-app/silabs/efr32 - $ python3 out/debug/chip-efr32-lighting-example.flash.py + $ python3 out/debug/matter-silabs-lighting-example.flash.py - Or with the Ozone debugger, just load the .out file. diff --git a/examples/lighting-app/silabs/efr32/build_for_wifi_args.gni b/examples/lighting-app/silabs/efr32/build_for_wifi_args.gni index c5097d7c1f5510..08cb8f35603b47 100644 --- a/examples/lighting-app/silabs/efr32/build_for_wifi_args.gni +++ b/examples/lighting-app/silabs/efr32/build_for_wifi_args.gni @@ -14,9 +14,9 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") -efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_openthread = false -import("${chip_root}/src/platform/silabs/efr32/wifi_args.gni") +import("${chip_root}/src/platform/silabs/wifi_args.gni") chip_enable_ota_requestor = true app_data_model = diff --git a/examples/lighting-app/silabs/efr32/openthread.gn b/examples/lighting-app/silabs/efr32/openthread.gn new file mode 100644 index 00000000000000..b05216fc9d7eae --- /dev/null +++ b/examples/lighting-app/silabs/efr32/openthread.gn @@ -0,0 +1,29 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + chip_openthread_ftd = true + + import("//openthread.gni") +} diff --git a/examples/lighting-app/silabs/efr32/args.gni b/examples/lighting-app/silabs/efr32/openthread.gni similarity index 93% rename from examples/lighting-app/silabs/efr32/args.gni rename to examples/lighting-app/silabs/efr32/openthread.gni index cdea54a9ff90cb..e7783cb5d09727 100644 --- a/examples/lighting-app/silabs/efr32/args.gni +++ b/examples/lighting-app/silabs/efr32/openthread.gni @@ -16,7 +16,7 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") import("${chip_root}/src/platform/silabs/efr32/args.gni") -efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") app_data_model = "${chip_root}/examples/lighting-app/silabs/efr32/data_model:silabs-lighting" diff --git a/examples/lighting-app/silabs/efr32/with_pw_rpc.gni b/examples/lighting-app/silabs/efr32/with_pw_rpc.gni index 3ee366c51ad498..bade7c7ea1f376 100644 --- a/examples/lighting-app/silabs/efr32/with_pw_rpc.gni +++ b/examples/lighting-app/silabs/efr32/with_pw_rpc.gni @@ -17,9 +17,9 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/efr32/lib/pw_rpc/pw_rpc.gni") -import("${chip_root}/examples/platform/silabs/efr32/args.gni") +import("${chip_root}/examples/platform/silabs/args.gni") -efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") app_data_model = "${chip_root}/examples/lighting-app/lighting-common" chip_enable_pw_rpc = true diff --git a/examples/lock-app/silabs/SiWx917/args.gni b/examples/lock-app/silabs/SiWx917/args.gni index 85b837f7ba72a3..e4bfe4d5dc7811 100644 --- a/examples/lock-app/silabs/SiWx917/args.gni +++ b/examples/lock-app/silabs/SiWx917/args.gni @@ -14,9 +14,9 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") -import("${chip_root}/src/platform/silabs/SiWx917/args.gni") +import("${chip_root}/src/platform/silabs/args.gni") -siwx917_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") app_data_model = "${chip_root}/examples/lock-app/lock-common" chip_enable_ota_requestor = true diff --git a/examples/lock-app/silabs/SiWx917/with_pw_rpc.gni b/examples/lock-app/silabs/SiWx917/with_pw_rpc.gni index ff81f847c35cdb..8a4c77792c4616 100644 --- a/examples/lock-app/silabs/SiWx917/with_pw_rpc.gni +++ b/examples/lock-app/silabs/SiWx917/with_pw_rpc.gni @@ -19,7 +19,7 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/efr32/lib/pw_rpc/pw_rpc.gni") import("${chip_root}/examples/platform/silabs/Siwx917/args.gni") -siwx917_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") app_data_model = "${chip_root}/examples/lock-app/lock-common" chip_enable_pw_rpc = true diff --git a/examples/lock-app/silabs/efr32/.gn b/examples/lock-app/silabs/efr32/.gn index 4c078f6acefdcc..b05216fc9d7eae 100644 --- a/examples/lock-app/silabs/efr32/.gn +++ b/examples/lock-app/silabs/efr32/.gn @@ -25,5 +25,5 @@ default_args = { target_os = "freertos" chip_openthread_ftd = true - import("//args.gni") + import("//openthread.gni") } diff --git a/examples/lock-app/silabs/efr32/BUILD.gn b/examples/lock-app/silabs/efr32/BUILD.gn index d70726b29d1b70..ab1479df760bb0 100644 --- a/examples/lock-app/silabs/efr32/BUILD.gn +++ b/examples/lock-app/silabs/efr32/BUILD.gn @@ -18,11 +18,11 @@ import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") import("${build_root}/config/defaults.gni") -import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${efr32_sdk_build_root}/silabs_executable.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") +import("${chip_root}/third_party/silabs/silabs_board.gni") if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") @@ -31,60 +31,88 @@ if (chip_enable_pw_rpc) { assert(current_os == "freertos") -efr32_project_dir = "${chip_root}/examples/lock-app/silabs/efr32" -examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" +silabs_project_dir = "${chip_root}/examples/lock-app/silabs/efr32" examples_common_plat_dir = "${chip_root}/examples/platform/silabs" -if (chip_enable_ble_rs911x) { - src_plat_dir = "${chip_root}/src/platform/silabs/efr32" +if (wifi_soc) { + import("${chip_root}/third_party/silabs/SiWx917_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" +} else { + import("${efr32_sdk_build_root}/efr32_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" } -import("${examples_plat_dir}/args.gni") +import("${examples_common_plat_dir}/args.gni") declare_args() { # Dump memory usage at link time. chip_print_memory_usage = false } -efr32_sdk("sdk") { - sources = [ - "${efr32_project_dir}/include/CHIPProjectConfig.h", - "${examples_plat_dir}/FreeRTOSConfig.h", - ] +if (wifi_soc) { + siwx917_sdk("sdk") { + sources = [ + "${examples_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", + ] - include_dirs = [ - "${chip_root}/src/platform/silabs/efr32", - "${efr32_project_dir}/include", - "${examples_plat_dir}", - "${chip_root}/src/lib", - "${examples_common_plat_dir}", - ] + include_dirs = [ + "${chip_root}/src/platform/silabs/SiWx917", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", + ] - if (use_wf200) { - # TODO efr32_sdk should not need a header from this location - include_dirs += [ "${examples_plat_dir}/wf200" ] + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } } - - if (chip_enable_ble_rs911x) { - # TODO efr32_sdk should not need a header from this location - include_dirs += [ - "${src_plat_dir}/rs911x", - "${examples_plat_dir}/rs911x", - "${examples_plat_dir}/rs911x/hal", +} else { + efr32_sdk("sdk") { + sources = [ + "${examples_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", ] - } - defines = [] - if (chip_enable_pw_rpc) { - defines += [ - "HAL_VCOM_ENABLE=1", - "PW_RPC_ENABLED", + include_dirs = [ + "${chip_root}/src/platform/silabs/efr32", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", ] + + if (use_wf200) { + # TODO efr32_sdk should not need a header from this location + include_dirs += [ "${examples_plat_dir}/wf200" ] + } + + if (chip_enable_ble_rs911x) { + # TODO efr32_sdk should not need a header from this location + include_dirs += [ + "${src_plat_dir}/rs911x", + "${examples_plat_dir}/rs911x", + "${examples_plat_dir}/rs911x/hal", + ] + } + + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } } } silabs_executable("lock_app") { - output_name = "chip-efr32-lock-example.out" + output_name = "matter-silabs-lock-example.out" include_dirs = [ "include" ] defines = [] @@ -101,10 +129,15 @@ silabs_executable("lock_app") { deps = [ ":sdk", - "${examples_plat_dir}:efr32-common", app_data_model, ] + if (wifi_soc) { + deps += [ "${examples_plat_dir}:siwx917-common" ] + } else { + deps += [ "${examples_plat_dir}:efr32-common" ] + } + if (chip_enable_pw_rpc) { defines += [ "PW_RPC_ENABLED", @@ -135,9 +168,14 @@ silabs_executable("lock_app") { "${chip_root}/examples/common/pigweed:locking_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:ot_cli_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:thread_service.nanopb_rpc", - "${examples_plat_dir}/pw_sys_io:pw_sys_io_efr32", ] + if (wifi_soc) { + deps += [ "${examples_plat_dir}/pw_sys_io:pw_sys_io_siwx917" ] + } else { + deps += [ "${examples_plat_dir}/pw_sys_io:pw_sys_io_efr32" ] + } + deps += pw_build_LINK_DEPS include_dirs += [ @@ -170,10 +208,10 @@ silabs_executable("lock_app") { output_dir = root_out_dir } -group("efr32") { +group("silabs") { deps = [ ":lock_app" ] } group("default") { - deps = [ ":efr32" ] + deps = [ ":silabs" ] } diff --git a/examples/lock-app/silabs/efr32/README.md b/examples/lock-app/silabs/efr32/README.md index 6c3fe8453ec3ee..46d6f87ef77fae 100644 --- a/examples/lock-app/silabs/efr32/README.md +++ b/examples/lock-app/silabs/efr32/README.md @@ -172,7 +172,7 @@ arguments ``` $ cd ~/connectedhomeip/examples/lock-app/silabs/efr32 - $ python3 out/debug/chip-efr32-lock-example.flash.py + $ python3 out/debug/matter-silabs-lock-example.flash.py ``` - Or with the Ozone debugger, just load the .out file. diff --git a/examples/lock-app/silabs/efr32/args.gni b/examples/lock-app/silabs/efr32/args.gni index d72526e91d9867..75546366efa21b 100644 --- a/examples/lock-app/silabs/efr32/args.gni +++ b/examples/lock-app/silabs/efr32/args.gni @@ -16,7 +16,7 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") import("${chip_root}/src/platform/silabs/efr32/args.gni") -efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") app_data_model = "${chip_root}/examples/lock-app/lock-common" chip_enable_ota_requestor = true diff --git a/examples/lock-app/silabs/efr32/build_for_wifi_args.gni b/examples/lock-app/silabs/efr32/build_for_wifi_args.gni index f672499d83e259..3769c90066ad7a 100644 --- a/examples/lock-app/silabs/efr32/build_for_wifi_args.gni +++ b/examples/lock-app/silabs/efr32/build_for_wifi_args.gni @@ -14,9 +14,9 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") -efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_openthread = false -import("${chip_root}/src/platform/silabs/efr32/wifi_args.gni") +import("${chip_root}/src/platform/silabs/wifi_args.gni") chip_enable_ota_requestor = true app_data_model = "${chip_root}/examples/lock-app/lock-common" diff --git a/examples/lock-app/silabs/efr32/openthread.gn b/examples/lock-app/silabs/efr32/openthread.gn new file mode 100644 index 00000000000000..b05216fc9d7eae --- /dev/null +++ b/examples/lock-app/silabs/efr32/openthread.gn @@ -0,0 +1,29 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + chip_openthread_ftd = true + + import("//openthread.gni") +} diff --git a/examples/platform/silabs/efr32/args.gni b/examples/lock-app/silabs/efr32/openthread.gni similarity index 60% rename from examples/platform/silabs/efr32/args.gni rename to examples/lock-app/silabs/efr32/openthread.gni index 47d4cbb5c7bc20..9d7fbf28634308 100644 --- a/examples/platform/silabs/efr32/args.gni +++ b/examples/lock-app/silabs/efr32/openthread.gni @@ -13,14 +13,14 @@ # limitations under the License. import("//build_overrides/chip.gni") +import("${chip_root}/config/standalone/args.gni") +import("${chip_root}/src/platform/silabs/efr32/args.gni") -chip_ble_project_config_include = "" -chip_device_project_config_include = "" -chip_project_config_include = "" -chip_inet_project_config_include = "" -chip_system_project_config_include = "" +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") -declare_args() { - app_data_model = "" - use_base_app = true -} +app_data_model = "${chip_root}/examples/lock-app/lock-common" +chip_enable_ota_requestor = true +chip_enable_openthread = true + +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" diff --git a/examples/lock-app/silabs/efr32/with_pw_rpc.gni b/examples/lock-app/silabs/efr32/with_pw_rpc.gni index b691609e6bf2d0..2592790c03e2ce 100644 --- a/examples/lock-app/silabs/efr32/with_pw_rpc.gni +++ b/examples/lock-app/silabs/efr32/with_pw_rpc.gni @@ -17,9 +17,9 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/efr32/lib/pw_rpc/pw_rpc.gni") -import("${chip_root}/examples/platform/silabs/efr32/args.gni") +import("${chip_root}/examples/platform/silabs/args.gni") -efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") app_data_model = "${chip_root}/examples/lock-app/lock-common" chip_enable_pw_rpc = true diff --git a/examples/platform/silabs/SiWx917/BUILD.gn b/examples/platform/silabs/SiWx917/BUILD.gn index 3233ea7e88dd98..beefb835d64172 100644 --- a/examples/platform/silabs/SiWx917/BUILD.gn +++ b/examples/platform/silabs/SiWx917/BUILD.gn @@ -45,11 +45,12 @@ declare_args() { chip_default_wifi_psk = "" } -import("${silabs_common_plat_dir}/SiWx917/args.gni") +import("${chip_root}/src/platform/silabs/wifi_args.gni") +import("${silabs_common_plat_dir}/args.gni") # Sanity check assert(chip_enable_wifi) -import("${chip_root}/src/platform/silabs/SiWx917/args.gni") + wisemcu_sdk_root = "${chip_root}/third_party/silabs/wisemcu-wifi-bt-sdk" silabs_common_plat_dir = "${chip_root}/examples/platform/silabs" diff --git a/examples/platform/silabs/SiWx917/args.gni b/examples/platform/silabs/args.gni similarity index 100% rename from examples/platform/silabs/SiWx917/args.gni rename to examples/platform/silabs/args.gni diff --git a/examples/platform/silabs/efr32/BUILD.gn b/examples/platform/silabs/efr32/BUILD.gn index 549b2aeec9da5a..34f4f503008618 100644 --- a/examples/platform/silabs/efr32/BUILD.gn +++ b/examples/platform/silabs/efr32/BUILD.gn @@ -48,7 +48,7 @@ chip_persist_subscriptions = enable_sleepy_device silabs_common_plat_dir = "${chip_root}/examples/platform/silabs" -import("${silabs_common_plat_dir}/efr32/args.gni") +import("${silabs_common_plat_dir}/args.gni") # Sanity check assert(!(chip_enable_wifi && chip_enable_openthread)) @@ -58,7 +58,7 @@ assert(!(use_wf200 && chip_enable_openthread)) if (chip_enable_wifi) { assert(use_rs9116 || use_wf200 || use_SiWx917) - import("${chip_root}/src/platform/silabs/efr32/wifi_args.gni") + import("${chip_root}/src/platform/silabs/wifi_args.gni") if (use_rs9116) { wiseconnect_sdk_root = diff --git a/examples/thermostat/silabs/efr32/.gn b/examples/thermostat/silabs/efr32/.gn index 4c078f6acefdcc..b05216fc9d7eae 100644 --- a/examples/thermostat/silabs/efr32/.gn +++ b/examples/thermostat/silabs/efr32/.gn @@ -25,5 +25,5 @@ default_args = { target_os = "freertos" chip_openthread_ftd = true - import("//args.gni") + import("//openthread.gni") } diff --git a/examples/thermostat/silabs/efr32/BUILD.gn b/examples/thermostat/silabs/efr32/BUILD.gn index 4bf824c4812147..92063a31c878aa 100644 --- a/examples/thermostat/silabs/efr32/BUILD.gn +++ b/examples/thermostat/silabs/efr32/BUILD.gn @@ -18,11 +18,11 @@ import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") import("${build_root}/config/defaults.gni") -import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${efr32_sdk_build_root}/silabs_executable.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") +import("${chip_root}/third_party/silabs/silabs_board.gni") if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") @@ -31,14 +31,18 @@ if (chip_enable_pw_rpc) { assert(current_os == "freertos") -efr32_project_dir = "${chip_root}/examples/thermostat/silabs/efr32" -examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" +silabs_project_dir = "${chip_root}/examples/thermostat/silabs/efr32" examples_common_plat_dir = "${chip_root}/examples/platform/silabs" -if (chip_enable_ble_rs911x) { - src_plat_dir = "${chip_root}/src/platform/silabs/efr32" + +if (wifi_soc) { + import("${chip_root}/third_party/silabs/SiWx917_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" +} else { + import("${efr32_sdk_build_root}/efr32_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" } -import("${examples_plat_dir}/args.gni") +import("${examples_common_plat_dir}/args.gni") declare_args() { # Dump memory usage at link time. @@ -46,62 +50,86 @@ declare_args() { # Enable the temperature sensor # Some boards do not have a temperature sensor - use_temp_sensor = silabs_board != "BRD2703A" && silabs_board != "BRD4319A" && - silabs_board != "BRD2704A" + use_temp_sensor = false } -efr32_sdk("sdk") { - sources = [ - "${efr32_project_dir}/include/CHIPProjectConfig.h", - "${examples_plat_dir}/FreeRTOSConfig.h", - ] - - include_dirs = [ - "${chip_root}/src/platform/silabs/efr32", - "${efr32_project_dir}/include", - "${examples_plat_dir}", - "${chip_root}/src/lib", - "${examples_common_plat_dir}", - ] - - if (use_wf200) { - # TODO efr32_sdk should not need a header from this location - include_dirs += [ "${examples_plat_dir}/wf200" ] - } - - if (chip_enable_ble_rs911x) { - # TODO efr32_sdk should not need a header from this location - include_dirs += [ - "${src_plat_dir}/rs911x", - "${examples_plat_dir}/rs911x", - "${examples_plat_dir}/rs911x/hal", +if (wifi_soc) { + siwx917_sdk("sdk") { + sources = [ + "${examples_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", ] - } - defines = [] - if (chip_enable_pw_rpc) { - defines += [ - "HAL_VCOM_ENABLE=1", - "PW_RPC_ENABLED", + include_dirs = [ + "${chip_root}/src/platform/silabs/SiWx917", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", ] + + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } } +} else { + efr32_sdk("sdk") { + sources = [ + "${examples_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", + ] - if (use_temp_sensor) { - include_dirs += [ - "${efr32_sdk_root}/platform/driver/i2cspm/inc", - "${efr32_sdk_root}/app/bluetooth/common/sensor_rht", - "${efr32_sdk_root}/app/bluetooth/common/sensor_rht/config", - "${efr32_sdk_root}/hardware/driver/si70xx/inc", - "${efr32_sdk_root}/app/bluetooth/common/sensor_select", - "${efr32_sdk_root}/platform/common/config", + include_dirs = [ + "${chip_root}/src/platform/silabs/efr32", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", ] - defines += [ "USE_TEMP_SENSOR" ] + if (use_wf200) { + # TODO efr32_sdk should not need a header from this location + include_dirs += [ "${examples_plat_dir}/wf200" ] + } + + if (chip_enable_ble_rs911x) { + # TODO efr32_sdk should not need a header from this location + include_dirs += [ + "${chip_root}/src/platform/silabs/efr32/rs911x", + "${examples_plat_dir}/rs911x", + "${examples_plat_dir}/rs911x/hal", + ] + } + + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } + + if (use_temp_sensor) { + include_dirs += [ + "${efr32_sdk_root}/platform/driver/i2cspm/inc", + "${efr32_sdk_root}/app/bluetooth/common/sensor_rht", + "${efr32_sdk_root}/app/bluetooth/common/sensor_rht/config", + "${efr32_sdk_root}/hardware/driver/si70xx/inc", + "${efr32_sdk_root}/app/bluetooth/common/sensor_select", + "${efr32_sdk_root}/platform/common/config", + ] + + defines += [ "USE_TEMP_SENSOR" ] + } } } silabs_executable("thermostat_app") { - output_name = "chip-efr32-thermostat-example.out" + output_name = "matter-silabs-thermostat-example.out" include_dirs = [ "include" ] defines = [] @@ -130,10 +158,15 @@ silabs_executable("thermostat_app") { deps = [ ":sdk", - "${examples_plat_dir}:efr32-common", app_data_model, ] + if (wifi_soc) { + deps += [ "${examples_plat_dir}:siwx917-common" ] + } else { + deps += [ "${examples_plat_dir}:efr32-common" ] + } + if (chip_enable_pw_rpc) { defines += [ "PW_RPC_ENABLED", @@ -160,9 +193,14 @@ silabs_executable("thermostat_app") { "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc", - "${examples_plat_dir}/pw_sys_io:pw_sys_io_efr32", ] + if (wifi_soc) { + deps += [ "${examples_plat_dir}/pw_sys_io:pw_sys_io_siwx917" ] + } else { + deps += [ "${examples_plat_dir}/pw_sys_io:pw_sys_io_efr32" ] + } + deps += pw_build_LINK_DEPS include_dirs += [ @@ -195,10 +233,10 @@ silabs_executable("thermostat_app") { output_dir = root_out_dir } -group("efr32") { +group("silabs") { deps = [ ":thermostat_app" ] } group("default") { - deps = [ ":efr32" ] + deps = [ ":silabs" ] } diff --git a/examples/thermostat/silabs/efr32/README.md b/examples/thermostat/silabs/efr32/README.md index 8fafaa7827ba05..6cd6a3d11dfd59 100644 --- a/examples/thermostat/silabs/efr32/README.md +++ b/examples/thermostat/silabs/efr32/README.md @@ -162,7 +162,7 @@ arguments - On the command line: $ cd ~/connectedhomeip/examples/thermostat/silabs/efr32 - $ python3 out/debug/chip-efr32-thermostat-switch-example.flash.py + $ python3 out/debug/matter-silabs-thermostat-switch-example.flash.py - Or with the Ozone debugger, just load the .out file. diff --git a/examples/thermostat/silabs/efr32/build_for_wifi_args.gni b/examples/thermostat/silabs/efr32/build_for_wifi_args.gni index e284ff4ec53d63..db1e280b0b31d2 100644 --- a/examples/thermostat/silabs/efr32/build_for_wifi_args.gni +++ b/examples/thermostat/silabs/efr32/build_for_wifi_args.gni @@ -14,9 +14,8 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") -efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") -chip_enable_openthread = false -import("${chip_root}/src/platform/silabs/efr32/wifi_args.gni") - +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") +import("${chip_root}/src/platform/silabs/wifi_args.gni") +chip_enable_wifi = true chip_enable_ota_requestor = true app_data_model = "${chip_root}/examples/thermostat/thermostat-common" diff --git a/examples/thermostat/silabs/efr32/openthread.gn b/examples/thermostat/silabs/efr32/openthread.gn new file mode 100644 index 00000000000000..b05216fc9d7eae --- /dev/null +++ b/examples/thermostat/silabs/efr32/openthread.gn @@ -0,0 +1,29 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + chip_openthread_ftd = true + + import("//openthread.gni") +} diff --git a/examples/thermostat/silabs/efr32/args.gni b/examples/thermostat/silabs/efr32/openthread.gni similarity index 93% rename from examples/thermostat/silabs/efr32/args.gni rename to examples/thermostat/silabs/efr32/openthread.gni index 938707c94a4f81..1ceb53d9204877 100644 --- a/examples/thermostat/silabs/efr32/args.gni +++ b/examples/thermostat/silabs/efr32/openthread.gni @@ -16,7 +16,7 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") import("${chip_root}/src/platform/silabs/efr32/args.gni") -efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") app_data_model = "${chip_root}/examples/thermostat/thermostat-common" chip_enable_ota_requestor = true diff --git a/examples/window-app/silabs/SiWx917/args.gni b/examples/window-app/silabs/SiWx917/args.gni index c4fe64871e74c8..76712544639802 100644 --- a/examples/window-app/silabs/SiWx917/args.gni +++ b/examples/window-app/silabs/SiWx917/args.gni @@ -14,9 +14,9 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") -import("${chip_root}/src/platform/silabs/SiWx917/args.gni") +import("${chip_root}/src/platform/silabs/args.gni") -siwx917_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") app_data_model = "${chip_root}/examples/window-app/common:window-common" chip_enable_ota_requestor = true diff --git a/examples/window-app/silabs/efr32/.gn b/examples/window-app/silabs/efr32/.gn index 4c078f6acefdcc..b05216fc9d7eae 100644 --- a/examples/window-app/silabs/efr32/.gn +++ b/examples/window-app/silabs/efr32/.gn @@ -25,5 +25,5 @@ default_args = { target_os = "freertos" chip_openthread_ftd = true - import("//args.gni") + import("//openthread.gni") } diff --git a/examples/window-app/silabs/efr32/BUILD.gn b/examples/window-app/silabs/efr32/BUILD.gn index f965dc552c8641..ac16344b59c597 100644 --- a/examples/window-app/silabs/efr32/BUILD.gn +++ b/examples/window-app/silabs/efr32/BUILD.gn @@ -19,57 +19,85 @@ import("//build_overrides/pigweed.gni") import("${build_root}/config/defaults.gni") import("${chip_root}/src/platform/device.gni") -import("${efr32_sdk_build_root}/efr32_sdk.gni") +import("${chip_root}/third_party/silabs/silabs_board.gni") import("${efr32_sdk_build_root}/silabs_executable.gni") - assert(current_os == "freertos") project_dir = "${chip_root}/examples/window-app" -efr32_project_dir = "${project_dir}/silabs/efr32" -examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" +silabs_project_dir = "${project_dir}/silabs/efr32" examples_common_plat_dir = "${chip_root}/examples/platform/silabs" -if (chip_enable_ble_rs911x) { - src_plat_dir = "${chip_root}/src/platform/silabs/efr32" + +if (wifi_soc) { + import("${chip_root}/third_party/silabs/SiWx917_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" +} else { + import("${efr32_sdk_build_root}/efr32_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" } -import("${examples_plat_dir}/args.gni") +import("${examples_common_plat_dir}/args.gni") declare_args() { # Dump memory usage at link time. chip_print_memory_usage = false } -efr32_sdk("sdk") { - sources = [ - "${efr32_project_dir}/include/CHIPProjectConfig.h", - "${examples_plat_dir}/FreeRTOSConfig.h", - ] +if (wifi_soc) { + siwx917_sdk("sdk") { + sources = [ + "${examples_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", + ] - include_dirs = [ - "${chip_root}/src/platform/silabs/efr32", - "${efr32_project_dir}/include", - "${examples_plat_dir}", - "${chip_root}/src/lib", - "${examples_common_plat_dir}", - ] + include_dirs = [ + "${chip_root}/src/platform/silabs/SiWx917", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", + ] - if (use_wf200) { - # TODO efr32_sdk should not need a header from this location - include_dirs += [ "${examples_plat_dir}/wf200" ] + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } } +} else { + efr32_sdk("sdk") { + sources = [ + "${examples_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", + ] - if (chip_enable_ble_rs911x) { - # TODO efr32_sdk should not need a header from this location - include_dirs += [ - "${src_plat_dir}/rs911x", - "${examples_plat_dir}/rs911x", - "${examples_plat_dir}/rs911x/hal", + include_dirs = [ + "${chip_root}/src/platform/silabs/efr32", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", ] + + if (use_wf200) { + # TODO efr32_sdk should not need a header from this location + include_dirs += [ "${examples_plat_dir}/wf200" ] + } + + if (chip_enable_ble_rs911x) { + # TODO efr32_sdk should not need a header from this location + include_dirs += [ + "${chip_root}/src/platform/silabs/efr32/rs911x", + "${examples_plat_dir}/rs911x", + "${examples_plat_dir}/rs911x/hal", + ] + } } } silabs_executable("window_app") { - output_name = "chip-efr32-window-example.out" + output_name = "matter-silabs-window-example.out" output_dir = root_out_dir include_dirs = [ "include", @@ -90,10 +118,14 @@ silabs_executable("window_app") { deps = [ ":sdk", - "${examples_plat_dir}:efr32-common", app_data_model, ] + if (wifi_soc) { + deps += [ "${examples_plat_dir}:siwx917-common" ] + } else { + deps += [ "${examples_plat_dir}:efr32-common" ] + } ldscript = "${examples_plat_dir}/ldscripts/${silabs_family}.ld" inputs = [ ldscript ] @@ -116,10 +148,10 @@ silabs_executable("window_app") { } } -group("efr32") { +group("silabs") { deps = [ ":window_app" ] } group("default") { - deps = [ ":efr32" ] + deps = [ ":silabs" ] } diff --git a/examples/window-app/silabs/efr32/README.md b/examples/window-app/silabs/efr32/README.md index 4d5231863c9aae..29ef7d7fb9f414 100644 --- a/examples/window-app/silabs/efr32/README.md +++ b/examples/window-app/silabs/efr32/README.md @@ -151,7 +151,7 @@ arguments - On the command line: $ cd ~/connectedhomeip/examples/window-app/silabs/efr32 - $ python3 out/debug/chip-efr32-window-example.flash.py + $ python3 out/debug/matter-silabs-window-example.flash.py - Or with the Ozone debugger, just load the .out file. diff --git a/examples/window-app/silabs/efr32/args.gni b/examples/window-app/silabs/efr32/args.gni index 1631579c3da2d6..e79d59068dd30a 100644 --- a/examples/window-app/silabs/efr32/args.gni +++ b/examples/window-app/silabs/efr32/args.gni @@ -16,7 +16,7 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") import("${chip_root}/src/platform/silabs/efr32/args.gni") -efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") app_data_model = "${chip_root}/examples/window-app/common:window-common" chip_enable_ota_requestor = true diff --git a/examples/window-app/silabs/efr32/build_for_wifi_args.gni b/examples/window-app/silabs/efr32/build_for_wifi_args.gni index 1b86ebd8007bc8..2619458aa7253f 100644 --- a/examples/window-app/silabs/efr32/build_for_wifi_args.gni +++ b/examples/window-app/silabs/efr32/build_for_wifi_args.gni @@ -13,9 +13,9 @@ # limitations under the License. import("//build_overrides/chip.gni") -efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_openthread = false -import("${chip_root}/src/platform/silabs/efr32/wifi_args.gni") +import("${chip_root}/src/platform/silabs/wifi_args.gni") chip_enable_ota_requestor = true app_data_model = "${chip_root}/examples/window-app/common:window-common" diff --git a/examples/window-app/silabs/efr32/openthread.gn b/examples/window-app/silabs/efr32/openthread.gn new file mode 100644 index 00000000000000..b05216fc9d7eae --- /dev/null +++ b/examples/window-app/silabs/efr32/openthread.gn @@ -0,0 +1,29 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + chip_openthread_ftd = true + + import("//openthread.gni") +} diff --git a/examples/window-app/silabs/efr32/openthread.gni b/examples/window-app/silabs/efr32/openthread.gni new file mode 100644 index 00000000000000..94e060557576c6 --- /dev/null +++ b/examples/window-app/silabs/efr32/openthread.gni @@ -0,0 +1,28 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("${chip_root}/config/standalone/args.gni") +import("${chip_root}/src/platform/silabs/efr32/args.gni") + +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") + +app_data_model = "${chip_root}/examples/window-app/common:window-common" +chip_enable_ota_requestor = true +chip_enable_openthread = true + +use_base_app = false + +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" diff --git a/scripts/build/builders/efr32.py b/scripts/build/builders/efr32.py index 38b21f538e8dfc..de9184ec58a10c 100644 --- a/scripts/build/builders/efr32.py +++ b/scripts/build/builders/efr32.py @@ -44,17 +44,17 @@ def ExampleName(self): def AppNamePrefix(self): if self == Efr32App.LIGHT: - return 'chip-efr32-lighting-example' + return 'matter-silabs-lighting-example' elif self == Efr32App.LOCK: - return 'chip-efr32-lock-example' + return 'matter-silabs-lock-example' elif self == Efr32App.SWITCH: - return 'chip-efr32-light-switch-example' + return 'matter-silabs-light-switch-example' elif self == Efr32App.WINDOW_COVERING: - return 'chip-efr32-window-example' + return 'matter-silabs-window-example' elif self == Efr32App.THERMOSTAT: - return 'chip-efr32-thermostat-example' + return 'matter-silabs-thermostat-example' elif self == Efr32App.UNIT_TEST: - return 'chip-efr32-device_tests' + return 'matter-silabs-device_tests' else: raise Exception('Unknown app type: %r' % self) diff --git a/scripts/examples/gn_efr32_example.sh b/scripts/examples/gn_efr32_example.sh index 8f2221e694bb6a..e19f031184da0c 100755 --- a/scripts/examples/gn_efr32_example.sh +++ b/scripts/examples/gn_efr32_example.sh @@ -37,6 +37,8 @@ USE_SLC=false GN_PATH=gn GN_PATH_PROVIDED=false +DOTFILE=".gn" + SILABS_THREAD_TARGET=\""../silabs:ot-efr32-cert"\" USAGE="./scripts/examples/gn_efr32_example.sh []" @@ -169,6 +171,7 @@ else exit 1 fi USE_WIFI=true + optArgs+="chip_device_platform =\"efr32\" " shift shift ;; @@ -181,7 +184,7 @@ else shift ;; --chip_enable_wifi_ipv4) - ipArgs="chip_enable_wifi_ipv4=true chip_inet_config_enable_ipv4=true " + optArgs="chip_enable_wifi_ipv4=true chip_inet_config_enable_ipv4=true " shift ;; --additional_data_advertising) @@ -248,6 +251,8 @@ else *) if [ "$1" =~ *"use_rs9116=true"* ] || [ "$1" =~ *"use_SiWx917=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then USE_WIFI=true + # NCP Mode so base MCU is an EFR32 + optArgs+="chip_device_platform =\"efr32\" " fi optArgs+=$1" " shift @@ -260,6 +265,13 @@ else exit 1 fi + # 917 exception. TODO find a more generic way + if [ "$SILABS_BOARD" == "BRD4325B" ]; then + echo "Compiling for 917 WiFi SOC" + USE_WIFI=true + optArgs+="chip_device_platform =\"SiWx917\" " + fi + if [ "$USE_GIT_SHA_FOR_VERSION" == true ]; then { ShortCommitSha=$(git describe --always --dirty --exclude '*') @@ -288,24 +300,18 @@ else fi if [ "$USE_WIFI" == true ]; then - # wifi build - # NCP mode EFR32 + wifi module - optArgs+="$ipArgs" - "$GN_PATH" gen --check --fail-on-unused-args --export-compile-commands --root="$ROOT" --dotfile="$ROOT"/build_for_wifi_gnfile.gn --args="silabs_board=\"$SILABS_BOARD\" $optArgs" "$BUILD_DIR" + DOTFILE="$ROOT/build_for_wifi_gnfile.gn" else - # OpenThread/SoC build - # - if [ "$USE_DOCKER" == true ]; then - optArgs+="openthread_root=\"$GSDK_ROOT/util/third_party/openthread\" " - fi + DOTFILE="$ROOT/openthread.gn" + fi - if [ -z "$optArgs" ]; then - "$GN_PATH" gen --check --script-executable="$PYTHON_PATH" --fail-on-unused-args --export-compile-commands --root="$ROOT" --args="silabs_board=\"$SILABS_BOARD\"" "$BUILD_DIR" - else - "$GN_PATH" gen --check --script-executable="$PYTHON_PATH" --fail-on-unused-args --export-compile-commands --root="$ROOT" --args="silabs_board=\"$SILABS_BOARD\" $optArgs" "$BUILD_DIR" - fi + if [ "$USE_DOCKER" == true ] && [ "$USE_WIFI" == false ]; then + echo "Switching OpenThread ROOT" + optArgs+="openthread_root=\"$GSDK_ROOT/util/third_party/openthread\" " fi + "$GN_PATH" gen --check --script-executable="$PYTHON_PATH" --fail-on-unused-args --export-compile-commands --root="$ROOT" --dotfile="$DOTFILE" --args="silabs_board=\"$SILABS_BOARD\" $optArgs" "$BUILD_DIR" + if [ "$USE_SLC" == true ]; then # Activation needs to be after SLC generation which is done in gn gen. # Zap generation requires activation and is done in the build phase diff --git a/src/platform/silabs/SiWx917/args.gni b/src/platform/silabs/SiWx917/args.gni deleted file mode 100644 index 63c70b25e3d57b..00000000000000 --- a/src/platform/silabs/SiWx917/args.gni +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2021 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/build.gni") -import("//build_overrides/chip.gni") -import("//build_overrides/efr32_sdk.gni") -import("//build_overrides/pigweed.gni") - -import("${chip_root}/examples/platform/silabs/SiWx917/args.gni") -import("${chip_root}/src/crypto/crypto.gni") - -# ARM architecture flags will be set based on silabs_family. -arm_platform_config = "${efr32_sdk_build_root}/silabs_arm.gni" - -mbedtls_target = "${efr32_sdk_build_root}:efr32_sdk" - -chip_crypto = "platform" - -# Transitional CommissionableDataProvider not used anymore -# examples/platform/silabs/SilabsDeviceDataProvider is now used. -chip_use_transitional_commissionable_data_provider = false - -# Use GSDK lwip instead of CHIP -lwip_root = "${efr32_sdk_build_root}" - -#lwip_platform = "external" -lwip_platform = "silabs" -lwip_ipv6 = true -lwip_ipv4 = true -lwip_api = true -lwip_ethernet = true - -chip_device_platform = "SiWx917" -chip_enable_wifi = true -chip_enable_openthread = false -chip_inet_config_enable_ipv4 = true -chip_inet_config_enable_dns_resolver = false -chip_inet_config_enable_tcp_endpoint = true - -chip_build_tests = false -chip_config_memory_management = "platform" -chip_mdns = "minimal" -chip_enable_pw_rpc = false diff --git a/src/platform/silabs/SiWx917/wifi_args.gni b/src/platform/silabs/SiWx917/wifi_args.gni deleted file mode 100644 index f3439f70062766..00000000000000 --- a/src/platform/silabs/SiWx917/wifi_args.gni +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2021 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/build.gni") -import("//build_overrides/chip.gni") -import("//build_overrides/efr32_sdk.gni") -import("//build_overrides/pigweed.gni") - -import("${chip_root}/examples/platform/silabs/SiWx917/args.gni") -import("${chip_root}/src/crypto/crypto.gni") - -# ARM architecture flags will be set based on silabs_family. -arm_platform_config = "${efr32_sdk_build_root}/efr32_arm.gni" - -mbedtls_target = "${efr32_sdk_build_root}:efr32_sdk" - -chip_crypto = "mbedtls" - -# Transitional CommissionableDataProvider not used anymore -# examples/platform/silabs/SilabsDeviceDataProvider is now used. -chip_use_transitional_commissionable_data_provider = false - -lwip_platform = "silabs" - -# Use GSDK lwip instead of CHIP -lwip_root = "${efr32_sdk_build_root}" - -lwip_ipv6 = true -lwip_ipv4 = true -lwip_api = true -lwip_ethernet = true - -chip_device_platform = "SiWx917" -chip_enable_openthread = false - -chip_inet_config_enable_ipv4 = false -chip_inet_config_enable_dns_resolver = false -chip_inet_config_enable_tcp_endpoint = true - -chip_build_tests = false -chip_config_memory_management = "platform" -chip_mdns = "minimal" -chip_enable_pw_rpc = false diff --git a/src/platform/silabs/efr32/args.gni b/src/platform/silabs/efr32/args.gni index 99bb92b9ec6372..ad124dec8e63c0 100644 --- a/src/platform/silabs/efr32/args.gni +++ b/src/platform/silabs/efr32/args.gni @@ -16,7 +16,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") -import("${chip_root}/examples/platform/silabs/efr32/args.gni") +import("${chip_root}/examples/platform/silabs/args.gni") import("${chip_root}/src/crypto/crypto.gni") # ARM architecture flags will be set based on silabs_family. diff --git a/src/platform/silabs/efr32/wifi_args.gni b/src/platform/silabs/wifi_args.gni similarity index 93% rename from src/platform/silabs/efr32/wifi_args.gni rename to src/platform/silabs/wifi_args.gni index fac4f4ff6103f7..3f09ad1994298c 100644 --- a/src/platform/silabs/efr32/wifi_args.gni +++ b/src/platform/silabs/wifi_args.gni @@ -17,7 +17,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") -import("${chip_root}/examples/platform/silabs/efr32/args.gni") +import("${chip_root}/examples/platform/silabs/args.gni") import("${chip_root}/src/crypto/crypto.gni") # ARM architecture flags will be set based on silabs_family. @@ -34,17 +34,17 @@ if (chip_crypto == "") { # examples/platform/silabs/SilabsDeviceDataProvider is now used. chip_use_transitional_commissionable_data_provider = false -lwip_platform = "silabs" - # Use GSDK lwip instead of CHIP lwip_root = "${efr32_sdk_build_root}" +#lwip_platform = "external" +lwip_platform = "silabs" lwip_ipv6 = true -lwip_ipv4 = true +lwip_ipv4 = false lwip_api = true lwip_ethernet = true -chip_device_platform = "efr32" +chip_enable_wifi = true chip_enable_openthread = false chip_inet_config_enable_ipv4 = false diff --git a/src/test_driver/efr32/BUILD.gn b/src/test_driver/efr32/BUILD.gn index 08a5e4186903c5..9a250bb730ad22 100644 --- a/src/test_driver/efr32/BUILD.gn +++ b/src/test_driver/efr32/BUILD.gn @@ -64,7 +64,7 @@ efr32_sdk("sdk") { } silabs_executable("efr32_device_tests") { - output_name = "chip-efr32-device_tests.out" + output_name = "matter-silabs-device_tests.out" defines = [ "PW_RPC_ENABLED" ] sources = [ diff --git a/src/test_driver/efr32/README.md b/src/test_driver/efr32/README.md index d79aef59866578..b23d98ba25c06a 100644 --- a/src/test_driver/efr32/README.md +++ b/src/test_driver/efr32/README.md @@ -107,5 +107,5 @@ the output folder for deploying. - To run the tests: ``` - python -m nl_test_runner.nl_test_runner -d /dev/ttyACM1 -f out/debug/chip-efr32-device_tests.s37 -o out.log + python -m nl_test_runner.nl_test_runner -d /dev/ttyACM1 -f out/debug/matter-silabs-device_tests.s37 -o out.log ``` diff --git a/src/test_driver/efr32/args.gni b/src/test_driver/efr32/args.gni index 4f8910d8e4a31e..2ef6653a0181e2 100644 --- a/src/test_driver/efr32/args.gni +++ b/src/test_driver/efr32/args.gni @@ -15,10 +15,10 @@ import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") import("${chip_root}/config/efr32/lib/pw_rpc/pw_rpc.gni") -import("${chip_root}/examples/platform/silabs/efr32/args.gni") +import("${chip_root}/examples/platform/silabs/args.gni") import("${chip_root}/src/platform/silabs/efr32/args.gni") -efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_pw_rpc = true cpp_standard = "gnu++17" diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index dd967ce5bdc775..c2c248fb6da201 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -26,8 +26,7 @@ if (silabs_board == "BRD4325B") { # CCP board declare_args() { # Build target to use for efr32 SDK. Use this to set global SDK defines. - efr32_sdk_target = "" - siwx917_sdk_target = "" + silabs_sdk_target = "" use_thread_coap_lib = false sl_matter_version_str = "" @@ -48,18 +47,10 @@ config("silabs_config") { } } -if (silabs_board == "BRD4325B") { # CCP board - assert(siwx917_sdk_target != "", "siwx917_sdk_target must be specified") - group("efr32_sdk") { - public_deps = [ siwx917_sdk_target ] - public_configs = [ ":silabs_config" ] - } -} else { - assert(efr32_sdk_target != "", "efr32_sdk_target must be specified") - group("efr32_sdk") { - public_deps = [ efr32_sdk_target ] - public_configs = [ ":silabs_config" ] - } +assert(silabs_sdk_target != "", "silabs_sdk_target must be specified") +group("efr32_sdk") { + public_deps = [ silabs_sdk_target ] + public_configs = [ ":silabs_config" ] } if (silabs_board != "BRD4325B") { # CCP board diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index 13fe8c987870b1..09dedcb4885074 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -115,7 +115,7 @@ template("siwx917_sdk") { defines += [ "ENABLE_CHIP_SHELL" ] } - import("${chip_root}/src/platform/silabs/SiWx917/args.gni") + import("${chip_root}/src/platform/silabs/wifi_args.gni") defines += [ "LWIP_NETIF_API=1" ] if (lwip_ipv4) { defines += [ diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 507fde96fee71a..5b5d4f214e728b 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -278,7 +278,7 @@ template("efr32_sdk") { } if (use_wf200 || use_rs9116 || use_SiWx917) { - import("${chip_root}/src/platform/silabs/efr32/wifi_args.gni") + import("${chip_root}/src/platform/silabs/wifi_args.gni") defines += [ "LWIP_NETIF_API=1" ] if (chip_enable_wifi_ipv4) { diff --git a/third_party/silabs/silabs_board.gni b/third_party/silabs/silabs_board.gni index 0e5f264b98d10b..bba3f060f8898d 100644 --- a/third_party/silabs/silabs_board.gni +++ b/third_party/silabs/silabs_board.gni @@ -36,6 +36,8 @@ declare_args() { use_SiWx917 = false chip_enable_ble_rs911x = false + wifi_soc = false + #Disable MQTT by default enable_dic = false @@ -99,6 +101,7 @@ if (silabs_board == "BRD4304A") { silabs_mcu = "EFR32MG12P432F1024GL125" disable_lcd = true show_qr_code = false + wifi_soc = true } else if (silabs_board == "BRD4180A") { assert( false,