diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 90b925786afed8..084226e14510a0 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-efr32:0.6.47 + image: connectedhomeip/chip-build-efr32:0.6.50 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -52,7 +52,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform efr32 + run: scripts/checkout_submodules.py --shallow --platform silabs_docker # - name: Out of Tree verification # run: third_party/silabs/out_of_tree_verification.sh @@ -114,7 +114,7 @@ jobs: - name: Build example EFR32+WF200 WiFi Lock app for BRD4161A timeout-minutes: 15 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 + 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/ - name: Clean out build output @@ -122,7 +122,7 @@ jobs: - name: Build example EFR32+RS9116 WiFi Lighting app for BRD4161A timeout-minutes: 15 run: | - scripts/examples/gn_efr32_example.sh examples/lighting-app/silabs/efr32/ out/lighting_app_wifi_rs9116 BRD4161A --wifi rs9116 + 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/ - name: Clean out build output diff --git a/.gitmodules b/.gitmodules index d9f332d45c1e8a..2927568c436bd7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -58,7 +58,7 @@ path = third_party/freertos/repo url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git branch = V10.3.1-kernel-only - platforms = ameba,cc13x2_26x2,bouffalolab,efr32,esp32,k32w0,infineon,qpg,cc32xx + platforms = ameba,cc13x2_26x2,bouffalolab,efr32,esp32,k32w0,infineon,qpg,cc32xx,silabs_docker [submodule "simw-top-mini"] path = third_party/simw-top-mini/repo url = https://github.com/NXP/plug-and-trust.git @@ -76,7 +76,7 @@ path = third_party/openthread/ot-efr32 url = https://github.com/SiliconLabs/ot-efr32.git branch = matter_sve - platforms = efr32 + platforms = efr32,silabs_docker [submodule "third_party/openthread/ot-ifx"] path = third_party/openthread/ot-ifx url = https://github.com/Infineon/ot-ifx-release.git @@ -238,7 +238,7 @@ path = third_party/silabs/matter_support url = https://github.com/SiliconLabs/sdk_support.git branch = main - platforms = efr32 + platforms = efr32,silabs_docker [submodule "third_party/silabs/gecko_sdk"] path = third_party/silabs/gecko_sdk url = https://github.com/SiliconLabs/gecko_sdk.git @@ -248,7 +248,7 @@ path = third_party/silabs/wiseconnect-wifi-bt-sdk url = https://github.com/SiliconLabs/wiseconnect-wifi-bt-sdk.git branch = master - platforms = efr32 + platforms = efr32,silabs_docker [submodule "editline"] path = third_party/editline/repo url = https://github.com/troglobit/editline.git diff --git a/build_overrides/ot_efr32.gni b/build_overrides/ot_efr32.gni deleted file mode 100644 index 469c74f34c906a..00000000000000 --- a/build_overrides/ot_efr32.gni +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2023 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. - -declare_args() { - openthread_efr32_root = "//third_party/silabs/gecko_sdk/protocol/openthread/platform-abstraction/efr32" -} diff --git a/examples/build_overrides/ot_efr32.gni b/examples/build_overrides/ot_efr32.gni deleted file mode 100644 index 76a68a839eab64..00000000000000 --- a/examples/build_overrides/ot_efr32.gni +++ /dev/null @@ -1,17 +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. - -declare_args() { - openthread_efr32_root = "//third_party/connectedhomeip/third_party/silabs/gecko_sdk/protocol/openthread/platform-abstraction/efr32" -} diff --git a/scripts/build/builders/efr32.py b/scripts/build/builders/efr32.py index d4eb7bfa0870d8..38b21f538e8dfc 100644 --- a/scripts/build/builders/efr32.py +++ b/scripts/build/builders/efr32.py @@ -223,6 +223,7 @@ def __init__(self, # case for pre-installed images), use it directly. sdk_path = shlex.quote(os.environ['GSDK_ROOT']) self.extra_gn_options.append(f"efr32_sdk_root=\"{sdk_path}\"") + self.extra_gn_options.append(f"openthread_root=\"{sdk_path}/util/third_party/openthread\"") def GnBuildArgs(self): return self.extra_gn_options diff --git a/scripts/checkout_submodules.py b/scripts/checkout_submodules.py index e7e3058b7d2df8..55da322e8184b0 100755 --- a/scripts/checkout_submodules.py +++ b/scripts/checkout_submodules.py @@ -46,6 +46,7 @@ 'mw320', 'genio', 'openiotsdk', + 'silabs_docker', ]) Module = namedtuple('Module', 'name path platforms') diff --git a/scripts/examples/gn_efr32_example.sh b/scripts/examples/gn_efr32_example.sh index b94c8485d8c2c7..7cd465102c22ce 100755 --- a/scripts/examples/gn_efr32_example.sh +++ b/scripts/examples/gn_efr32_example.sh @@ -33,6 +33,7 @@ source "$CHIP_ROOT/scripts/activate.sh" set -x env USE_WIFI=false +USE_DOCKER=false USE_GIT_SHA_FOR_VERSION=true SILABS_THREAD_TARGET=\""../silabs:ot-efr32-cert"\" @@ -120,6 +121,8 @@ if [ "$#" == "0" ]; then Currently : v1.0-- --release Remove all logs and debugs features (including the LCD). Yield the smallest image size possible + --docker + Change GSDK root for docker builds " elif [ "$#" -lt "2" ]; then @@ -199,6 +202,11 @@ else optArgs+="is_debug=false disable_lcd=true chip_build_libshell=false enable_openthread_cli=false use_external_flash=false chip_logging=false silabs_log_enabled=false " shift ;; + --docker) + optArgs+="efr32_sdk_root=\"$GSDK_ROOT\" " + USE_DOCKER=true + shift + ;; *) if [ "$1" =~ *"use_rs9116=true"* ] || [ "$1" =~ *"use_SiWx917=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then USE_WIFI=true @@ -228,8 +236,11 @@ else if [ "$USE_WIFI" == true ]; then gn 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" else - # thread build - # + # OpenThread build + if [ "$USE_DOCKER" == true ]; then + optArgs+="openthread_root=\"$GSDK_ROOT/util/third_party/openthread\" " + fi + if [ -z "$optArgs" ]; then gn gen --check --fail-on-unused-args --export-compile-commands --root="$ROOT" --args="silabs_board=\"$SILABS_BOARD\"" "$BUILD_DIR" else diff --git a/third_party/openthread/platforms/efr32/BUILD.gn b/third_party/openthread/platforms/efr32/BUILD.gn index 0a48e7c45b22b5..4eb6e7caa08ba9 100644 --- a/third_party/openthread/platforms/efr32/BUILD.gn +++ b/third_party/openthread/platforms/efr32/BUILD.gn @@ -17,7 +17,6 @@ import("//build_overrides/efr32_sdk.gni") import("//build_overrides/openthread.gni") import("//build_overrides/openthread.gni") -import("//build_overrides/ot_efr32.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${efr32_sdk_build_root}/silabs_board.gni") @@ -32,7 +31,7 @@ config("openthread_efr32_config") { include_dirs = [ "${chip_root}/examples/platform/efr32", "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}", - "${openthread_efr32_root}", + "${sl_ot_efr32_root}", ] # temporarily disable check until gsdk pulls in a more recent version of openthread @@ -41,9 +40,9 @@ config("openthread_efr32_config") { source_set("openthread_core_config_efr32") { sources = [ - "${openthread_efr32_root}/openthread-core-efr32-config-check.h", - "${openthread_efr32_root}/openthread-core-efr32-config.h", "${openthread_root}/src/cli/cli_config.h", + "${sl_ot_efr32_root}/openthread-core-efr32-config-check.h", + "${sl_ot_efr32_root}/openthread-core-efr32-config.h", ] public_deps = [ "${efr32_sdk_build_root}:efr32_sdk" ] @@ -53,16 +52,16 @@ source_set("openthread_core_config_efr32") { source_set("libopenthread-efr32") { sources = [ - "${openthread_efr32_root}/alarm.c", - "${openthread_efr32_root}/crypto.c", - "${openthread_efr32_root}/entropy.c", - "${openthread_efr32_root}/flash.c", - "${openthread_efr32_root}/ieee802154-packet-utils.cpp", - "${openthread_efr32_root}/misc.c", - "${openthread_efr32_root}/radio.c", - "${openthread_efr32_root}/sleep.c", - "${openthread_efr32_root}/system.c", "${openthread_root}/examples/apps/cli/cli_uart.cpp", + "${sl_ot_efr32_root}/alarm.c", + "${sl_ot_efr32_root}/crypto.c", + "${sl_ot_efr32_root}/entropy.c", + "${sl_ot_efr32_root}/flash.c", + "${sl_ot_efr32_root}/ieee802154-packet-utils.cpp", + "${sl_ot_efr32_root}/misc.c", + "${sl_ot_efr32_root}/radio.c", + "${sl_ot_efr32_root}/sleep.c", + "${sl_ot_efr32_root}/system.c", ] public_deps = [ diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index 0ced1ac6826680..f266f29543209f 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -27,10 +27,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 = "" - sl_ot_efr32_root = - "${chip_root}/third_party/silabs/gecko_sdk/protocol/openthread" - sl_openthread_root = - "${chip_root}/third_party/silabs/gecko_sdk/util/third_party/openthread" + use_thread_coap_lib = false sl_matter_version_str = "" } @@ -89,7 +86,7 @@ if (use_silabs_thread_lib) { "${chip_root}/examples/platform/silabs/efr32", "${chip_root}/examples/platform/silabs", "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}", - "${sl_ot_efr32_root}/platform-abstraction/efr32", + "${sl_ot_efr32_root}", "${sl_openthread_root}/src/", ] @@ -99,8 +96,8 @@ if (use_silabs_thread_lib) { source_set("openthread_core_config_efr32") { sources = [ - "${sl_ot_efr32_root}/platform-abstraction/efr32/openthread-core-efr32-config-check.h", - "${sl_ot_efr32_root}/platform-abstraction/efr32/openthread-core-efr32-config.h", + "${sl_ot_efr32_root}/openthread-core-efr32-config-check.h", + "${sl_ot_efr32_root}/openthread-core-efr32-config.h", ] public_deps = [ @@ -176,8 +173,8 @@ if (use_silabs_thread_lib) { public_configs += [ "${sl_openthread_root}:openthread_${XTD}_config" ] libs = [ - "${sl_ot_efr32_root}/libs/libsl_ot_stack_${XTD}_${COAP_API}${silabs_family}_gcc.a", - "${sl_ot_efr32_root}/libs/libsl_platform_${XTD}_dmp_${silabs_family}_gcc.a", + "${sl_ot_libs_path}/libs/libsl_ot_stack_${XTD}_${COAP_API}${silabs_family}_gcc.a", + "${sl_ot_libs_path}/libs/libsl_platform_${XTD}_dmp_${silabs_family}_gcc.a", ] } } diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 7c82f494f6b48d..cabe5a5df66086 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -53,6 +53,13 @@ declare_args() { assert(efr32_sdk_root != "", "efr32_sdk_root must be specified") +declare_args() { + sl_ot_libs_path = "${efr32_sdk_root}/protocol/openthread" + sl_ot_efr32_root = + "${efr32_sdk_root}/protocol/openthread/platform-abstraction/efr32" + sl_openthread_root = "${efr32_sdk_root}/util/third_party/openthread" +} + # Defines an efr32 SDK build target. # # Parameters: diff --git a/third_party/silabs/lwip.gni b/third_party/silabs/lwip.gni index 1637b9e5a856b2..9a35e7c45f7a61 100644 --- a/third_party/silabs/lwip.gni +++ b/third_party/silabs/lwip.gni @@ -13,13 +13,14 @@ # limitations under the License. import("//build_overrides/efr32_sdk.gni") import("//build_overrides/lwip.gni") +import("${efr32_sdk_build_root}/efr32_sdk.gni") # Defines a lwIP build target. # # lwIP depends on external header files to compile. This template defines # a combined build of the lwIP sources plus target configuration. template("lwip_target") { - _lwip_root = "${efr32_sdk_build_root}/gecko_sdk/util/third_party/lwip/lwip" + _lwip_root = "${efr32_sdk_root}/util/third_party/lwip/lwip" lwip_target_name = target_name