From 9a5b0fe9ec466eb6448657b0a9c425516a308493 Mon Sep 17 00:00:00 2001 From: jepenven-silabs Date: Fri, 17 Mar 2023 10:29:21 -0400 Subject: [PATCH] Use container sdk --- .github/workflows/examples-efr32.yaml | 4 +-- .gitmodules | 8 +++--- build_overrides/ot_efr32.gni | 17 ------------- examples/build_overrides/ot_efr32.gni | 17 ------------- scripts/build/builders/efr32.py | 1 + scripts/checkout_submodules.py | 1 + scripts/examples/gn_efr32_example.sh | 6 +++++ .../openthread/platforms/efr32/BUILD.gn | 25 +++++++++---------- third_party/silabs/BUILD.gn | 15 +++++------ third_party/silabs/efr32_sdk.gni | 7 ++++++ 10 files changed, 39 insertions(+), 62 deletions(-) delete mode 100644 build_overrides/ot_efr32.gni delete mode 100644 examples/build_overrides/ot_efr32.gni diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 90b925786afed8..48665913c4b8c6 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 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..9d69664ea6c786 100755 --- a/scripts/examples/gn_efr32_example.sh +++ b/scripts/examples/gn_efr32_example.sh @@ -120,6 +120,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 +201,10 @@ 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\" openthread_root=\"$GSDK_ROOT/util/third_party/openthread\"" + shift + ;; *) if [ "$1" =~ *"use_rs9116=true"* ] || [ "$1" =~ *"use_SiWx917=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then USE_WIFI=true 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 9c24aed920d276..b9ece2c2dd9f1d 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: