From cfb8be599a26c3e6b91b693457bf4a332d1864e7 Mon Sep 17 00:00:00 2001 From: doru91 Date: Wed, 22 Jun 2022 23:06:33 +0300 Subject: [PATCH 1/4] [K32W0] Fix SDK patching (#19856) Remove temporary files used for NXP SDK patching. Signed-off-by: Doru Gucea --- third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh b/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh index 6566feb72700bc..417731e01f5216 100755 --- a/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh +++ b/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh @@ -64,5 +64,8 @@ cp patch_for_K32W061_SDK_2_6_4/controller_interface.h "$NXP_K32W061_SDK_ROOT"/mi cp patch_for_K32W061_SDK_2_6_4/lib_ble_controller.a "$NXP_K32W061_SDK_ROOT"/middleware/wireless/ble_controller/lib/ cp patch_for_K32W061_SDK_2_6_4/libPDM_extFlash.a "$NXP_K32W061_SDK_ROOT"/middleware/wireless/framework/PDM/Library/ +rm -rf patch_for_K32W061_SDK_2_6_4.zip +rm -rf patch_for_K32W061_SDK_2_6_4 + echo "K32W SDK MR3 QP1 was patched!" exit 0 From c34a08bb58cd1bad7cae5cf59e843e9412ee158b Mon Sep 17 00:00:00 2001 From: manjunath-grl <102359958+manjunath-grl@users.noreply.github.com> Date: Thu, 23 Jun 2022 01:45:57 +0530 Subject: [PATCH 2/4] Addressing issue #19620 (#19672) * Modified test CGEN_2_1 * Added auto generated files * Modified script CGEN-2.1 * Auto generated files --- .../certification/Test_TC_CGEN_2_1.yaml | 31 ++++++-- .../chip-tool/zap-generated/test/Commands.h | 39 ++++++++-- .../zap-generated/test/Commands.h | 76 ++++++++++++++----- 3 files changed, 114 insertions(+), 32 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_CGEN_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CGEN_2_1.yaml index 9622cf9275ce80..8961bb4717b4b0 100644 --- a/src/app/tests/suites/certification/Test_TC_CGEN_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CGEN_2_1.yaml @@ -35,7 +35,8 @@ tests: command: "readAttribute" attribute: "Breadcrumb" response: - value: 0 + constraints: + type: uint64 - label: "TH1 writes the BreadCrumb attribute as 1 to the DUT" command: "writeAttribute" @@ -66,12 +67,28 @@ tests: maxValue: 2 #Issue 17997 - - label: "TH1 reads BasicCommissioningInfo attribute from DUT" + - label: + "TH1 reads BasicCommissioningInfo attribute from DUT and Verify that + the BasicCommissioningInfo attribute has the following field: + FailSafeExpiryLengthSeconds field value is within a duration range of + 0 to 65535" command: "readAttribute" attribute: "BasicCommissioningInfo" + + - label: "Step 6 TC-CGEN-2.1" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: + "Step 6 is implicitly validating the + attribute(BasicCommissioningInfo) constraints, as long as + the payload is being parsed successfully" + + - label: "TH1 reads SupportsConcurrentConnection attribute from the DUT" + command: "readAttribute" + attribute: "SupportsConcurrentConnection" response: - value: - { - FailSafeExpiryLengthSeconds: 60, - MaxCumulativeFailsafeSeconds: 900, - } + constraints: + type: bool diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 2b72528e4bbca5..bc159c2318982c 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -14032,7 +14032,7 @@ class Test_TC_CGEN_1_1Suite : public TestCommand class Test_TC_CGEN_2_1Suite : public TestCommand { public: - Test_TC_CGEN_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CGEN_2_1", 7, credsIssuerConfig) + Test_TC_CGEN_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CGEN_2_1", 9, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -14074,7 +14074,7 @@ class Test_TC_CGEN_2_1Suite : public TestCommand { uint64_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("breadcrumb", value, 0ULL)); + VerifyOrReturn(CheckConstraintType("value", "", "uint64")); } break; case 2: @@ -14111,10 +14111,18 @@ class Test_TC_CGEN_2_1Suite : public TestCommand { chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfo::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn( - CheckValue("basicCommissioningInfo.failSafeExpiryLengthSeconds", value.failSafeExpiryLengthSeconds, 60U)); - VerifyOrReturn( - CheckValue("basicCommissioningInfo.maxCumulativeFailsafeSeconds", value.maxCumulativeFailsafeSeconds, 900U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "bool")); } break; default: @@ -14168,10 +14176,27 @@ class Test_TC_CGEN_2_1Suite : public TestCommand GeneralCommissioning::Attributes::LocationCapability::Id, true, chip::NullOptional); } case 6: { - LogStep(6, "TH1 reads BasicCommissioningInfo attribute from DUT"); + LogStep(6, + "TH1 reads BasicCommissioningInfo attribute from DUT and Verify that the BasicCommissioningInfo attribute has " + "the following field: FailSafeExpiryLengthSeconds field value is within a duration range of 0 to 65535"); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, GeneralCommissioning::Attributes::BasicCommissioningInfo::Id, true, chip::NullOptional); } + case 7: { + LogStep(7, "Step 6 TC-CGEN-2.1"); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Step 6 is implicitly validating the attribute(BasicCommissioningInfo) constraints, as long " + "as the payload is being parsed successfullygarbage: not in length on purpose", + 134); + return UserPrompt(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "TH1 reads SupportsConcurrentConnection attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, + GeneralCommissioning::Attributes::SupportsConcurrentConnection::Id, true, chip::NullOptional); + } } return CHIP_NO_ERROR; } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index f80fd978c07b37..8df5eeab078aea 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -20015,8 +20015,19 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { err = TestTh1ReadsTheLocationCapabilityAttributeFromTheDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : TH1 reads BasicCommissioningInfo attribute from DUT\n"); - err = TestTh1ReadsBasicCommissioningInfoAttributeFromDut_6(); + ChipLogProgress(chipTool, + " ***** Test Step 6 : TH1 reads BasicCommissioningInfo attribute from DUT and Verify that the " + "BasicCommissioningInfo attribute has the following field: FailSafeExpiryLengthSeconds field value is within a " + "duration range of 0 to 65535\n"); + err = TestTh1ReadsBasicCommissioningInfoAttributeFromDutAndVerifyThatTheBasicCommissioningInfoAttributeHasTheFollowingFieldFailSafeExpiryLengthSecondsFieldValueIsWithinADurationRangeOf0To65535_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 6 TC-CGEN-2.1\n"); + err = TestStep6TcCgen21_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH1 reads SupportsConcurrentConnection attribute from the DUT\n"); + err = TestTh1ReadsSupportsConcurrentConnectionAttributeFromTheDut_8(); break; } @@ -20050,6 +20061,12 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -20063,7 +20080,7 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 9; chip::Optional mNodeId; chip::Optional mCluster; @@ -20090,11 +20107,7 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 0ULL)); - } - + VerifyOrReturn(CheckConstraintType("breadcrumb", "", "uint64")); NextTest(); }]; @@ -20191,7 +20204,8 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1ReadsBasicCommissioningInfoAttributeFromDut_6() + CHIP_ERROR + TestTh1ReadsBasicCommissioningInfoAttributeFromDutAndVerifyThatTheBasicCommissioningInfoAttributeHasTheFollowingFieldFailSafeExpiryLengthSecondsFieldValueIsWithinADurationRangeOf0To65535_6() { CHIPDevice * device = GetDevice("alpha"); CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device @@ -20201,23 +20215,49 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { [cluster readAttributeBasicCommissioningInfoWithCompletionHandler:^( CHIPGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads BasicCommissioningInfo attribute from DUT Error: %@", err); + NSLog( + @"TH1 reads BasicCommissioningInfo attribute from DUT and Verify that the BasicCommissioningInfo attribute has the " + @"following field: FailSafeExpiryLengthSeconds field value is within a duration range of 0 to 65535 Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FailSafeExpiryLengthSeconds", - ((CHIPGeneralCommissioningClusterBasicCommissioningInfo *) actualValue).failSafeExpiryLengthSeconds, 60U)); - VerifyOrReturn(CheckValue("MaxCumulativeFailsafeSeconds", - ((CHIPGeneralCommissioningClusterBasicCommissioningInfo *) actualValue).maxCumulativeFailsafeSeconds, 900U)); - } - NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestStep6TcCgen21_7() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Step 6 is implicitly validating the attribute(BasicCommissioningInfo) constraints, as long " + "as the payload is being parsed successfullygarbage: not in length on purpose", + 134); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestTh1ReadsSupportsConcurrentConnectionAttributeFromTheDut_8() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestGeneralCommissioning * cluster = [[CHIPTestGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeSupportsConcurrentConnectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads SupportsConcurrentConnection attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("supportsConcurrentConnection", "", "bool")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_DGGEN_1_1 : public TestCommandBridge { From 92eeafc11a825ab3b9eb8f914f56ec22d8b79836 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Wed, 22 Jun 2022 16:54:00 -0400 Subject: [PATCH 3/4] [EFR32] Update gsdk to 4.1 (#19778) * Initial clean up and update for gsdk 4.1 * Gecko SDK update to 4.1 * Linked script update * Refactor bluetooth init * update sdk gn files for gsdk 4.1 * Remove temporary/commented code * removed depracted location * Update Mg24 linker script * update ot-efr32 using gsdk 4.1 * Add lfs pull and cache * Install git-lfs * Correct linker scripts * fix path typo --- .github/workflows/examples-efr32.yaml | 197 ++++++++++-------- .gitmodules | 24 ++- build_overrides/efr32_sdk.gni | 2 +- examples/build_overrides/efr32_sdk.gni | 2 +- examples/light-switch-app/efr32/BUILD.gn | 4 +- examples/lighting-app/efr32/BUILD.gn | 4 +- examples/lock-app/efr32/BUILD.gn | 4 +- .../platform/efr32/ldscripts/efr32mg12.ld | 50 +---- .../platform/efr32/ldscripts/efr32mg24.ld | 70 ++----- examples/platform/efr32/matter_config.cpp | 2 +- examples/window-app/efr32/BUILD.gn | 4 +- src/platform/EFR32/BLEManagerImpl.cpp | 61 ++---- src/platform/EFR32/BlePlatformConfig.h | 2 +- .../EFR32/efr32-chip-mbedtls-config.h | 1 + third_party/efr32_sdk/repo | 1 - third_party/openthread/ot-efr32 | 2 +- .../openthread/platforms/efr32/BUILD.gn | 4 +- third_party/{efr32_sdk => silabs}/BUILD.gn | 0 .../{efr32_sdk => silabs}/efr32_arm.gni | 0 .../{efr32_sdk => silabs}/efr32_board.gni | 0 .../efr32_executable.gni | 0 .../{efr32_sdk => silabs}/efr32_sdk.gni | 68 +++--- third_party/silabs/gecko_sdk | 1 + third_party/silabs/matter_support | 1 + .../wiseconnect-wifi-bt-sdk | 0 25 files changed, 226 insertions(+), 278 deletions(-) delete mode 160000 third_party/efr32_sdk/repo rename third_party/{efr32_sdk => silabs}/BUILD.gn (100%) rename third_party/{efr32_sdk => silabs}/efr32_arm.gni (100%) rename third_party/{efr32_sdk => silabs}/efr32_board.gni (100%) rename third_party/{efr32_sdk => silabs}/efr32_executable.gni (100%) rename third_party/{efr32_sdk => silabs}/efr32_sdk.gni (94%) create mode 160000 third_party/silabs/gecko_sdk create mode 160000 third_party/silabs/matter_support rename third_party/{efr32_sdk => silabs}/wiseconnect-wifi-bt-sdk (100%) diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 8c2da30d946b36..13c8ba38c9bc81 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -15,102 +15,121 @@ name: Build example - EFR32 on: - push: - pull_request: + push: + pull_request: concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true + group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} + cancel-in-progress: true jobs: - efr32: - name: EFR32 - timeout-minutes: 60 + efr32: + name: EFR32 + timeout-minutes: 60 - env: - EFR32_BOARD: BRD4161A - BUILD_TYPE: gn_efr32 + env: + EFR32_BOARD: BRD4161A + BUILD_TYPE: gn_efr32 + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: connectedhomeip/chip-build-efr32:0.5.79 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - uses: Wandalen/wretry.action@v1.0.15 + name: Checkout + with: + action: actions/checkout@v3 + with: | + token: ${{ github.token }} + attempt_limit: 3 + attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform efr32 - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' + - name: Install git-lfs # Temporary measure untill docker container is updated + run: + "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash; \ + apt-get install git-lfs; \ + git lfs install;" - container: - image: connectedhomeip/chip-build-efr32:0.5.79 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - steps: - - uses: Wandalen/wretry.action@v1.0.15 - name: Checkout - with: - action: actions/checkout@v3 - with: | - token: ${{ github.token }} - attempt_limit: 3 - attempt_delay: 2000 - - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform efr32 + - name: Create LFS file hash list + run: git -C third_party/silabs/gecko_sdk lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id - - name: Set up environment for size reports - if: ${{ !env.ACT }} - env: - GH_CONTEXT: ${{ toJson(github) }} - run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + - name: Restore gecko_sdk LFS cache + uses: actions/cache@v2 + id: lfs-cache + with: + path: .git/modules/third_party/silabs/gecko_sdk/lfs + key: lfs-${{ hashFiles('.lfs-assets-id') }} + + - name: Git LFS Pull + run: git -C third_party/silabs/gecko_sdk lfs pull + + - name: Set up environment for size reports + if: ${{ !env.ACT }} + env: + GH_CONTEXT: ${{ toJson(github) }} + run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" - - name: Bootstrap - timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh - - name: Uploading bootstrap logs - uses: actions/upload-artifact@v2 - if: ${{ always() }} && ${{ !env.ACT }} - with: - name: bootstrap-logs - path: | - .environment/gn_out/.ninja_log - .environment/pigweed-venv/*.log + - name: Bootstrap + timeout-minutes: 25 + run: scripts/build/gn_bootstrap.sh + - name: Uploading bootstrap logs + uses: actions/upload-artifact@v2 + if: ${{ always() }} && ${{ !env.ACT }} + with: + name: bootstrap-logs + path: | + .environment/gn_out/.ninja_log + .environment/pigweed-venv/*.log - - name: Build some BRD4161A variants - timeout-minutes: 50 - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --enable-flashbundle \ - --target-glob '*-brd4161a-{lock,light,switch,window-covering,unit-test}' \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Prepare some bloat report from the previous builds - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - efr32 BRD4161A lighting-app \ - out/efr32-brd4161a-light/chip-efr32-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - efr32 BRD4161A window-app \ - out/efr32-brd4161a-window-covering/chip-efr32-window-example.out \ - /tmp/bloat_reports/ - - name: Build example EFR32 Lighting App for BRD4161A with RPCs - timeout-minutes: 10 - run: | - scripts/examples/gn_efr32_example.sh examples/lighting-app/efr32/ out/lighting_app_debug_rpc BRD4161A \ - 'import("//with_pw_rpc.gni")' - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+rpc lighting-app \ - out/lighting_app_debug_rpc/BRD4161A/chip-efr32-lighting-example.out /tmp/bloat_reports/ - - name: Build example EFR32+WF200 WiFi Lock app for BRD4161A - timeout-minutes: 10 - run: | - scripts/examples/gn_efr32_example.sh examples/lock-app/efr32/ out/lock_app_wifi_wf200 BRD4161A is_debug=false --wifi wf200 - .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: Build example EFR32+RS911x WiFi Lighting app for BRD4161A - timeout-minutes: 10 - run: | - scripts/examples/gn_efr32_example.sh examples/lighting-app/efr32/ out/lighting_app_wifi_rs911x BRD4161A --wifi rs911x - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+rs911x lighting-app \ - out/lighting_app_wifi_rs911x/BRD4161A/chip-efr32-lighting-example.out /tmp/bloat_reports/ - - name: Uploading Size Reports - uses: actions/upload-artifact@v2 - if: ${{ !env.ACT }} - with: - name: Size,EFR32-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }} - path: | - /tmp/bloat_reports/ + - name: Build some BRD4161A variants + timeout-minutes: 50 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --enable-flashbundle \ + --target-glob '*-brd4161a-{lock,light,switch,window-covering,unit-test}' \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Prepare some bloat report from the previous builds + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + efr32 BRD4161A lighting-app \ + out/efr32-brd4161a-light/chip-efr32-lighting-example.out \ + /tmp/bloat_reports/ + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + efr32 BRD4161A window-app \ + out/efr32-brd4161a-window-covering/chip-efr32-window-example.out \ + /tmp/bloat_reports/ + - name: Build example EFR32 Lighting App for BRD4161A with RPCs + timeout-minutes: 10 + run: | + scripts/examples/gn_efr32_example.sh examples/lighting-app/efr32/ out/lighting_app_debug_rpc BRD4161A \ + 'import("//with_pw_rpc.gni")' + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+rpc lighting-app \ + out/lighting_app_debug_rpc/BRD4161A/chip-efr32-lighting-example.out /tmp/bloat_reports/ + - name: Build example EFR32+WF200 WiFi Lock app for BRD4161A + timeout-minutes: 10 + run: | + scripts/examples/gn_efr32_example.sh examples/lock-app/efr32/ out/lock_app_wifi_wf200 BRD4161A is_debug=false --wifi wf200 + .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: Build example EFR32+RS911x WiFi Lighting app for BRD4161A + timeout-minutes: 10 + run: | + scripts/examples/gn_efr32_example.sh examples/lighting-app/efr32/ out/lighting_app_wifi_rs911x BRD4161A --wifi rs911x + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+rs911x lighting-app \ + out/lighting_app_wifi_rs911x/BRD4161A/chip-efr32-lighting-example.out /tmp/bloat_reports/ + - name: Uploading Size Reports + uses: actions/upload-artifact@v2 + if: ${{ !env.ACT }} + with: + name: Size,EFR32-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }} + path: | + /tmp/bloat_reports/ diff --git a/.gitmodules b/.gitmodules index 0682becb54cfce..51153d1ee5cd62 100644 --- a/.gitmodules +++ b/.gitmodules @@ -63,11 +63,6 @@ url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git branch = V10.3.1-kernel-only platforms = ameba,cc13x2_26x2,bl602,efr32,esp32,k32w0,p6,qpg -[submodule "efr32_sdk"] - path = third_party/efr32_sdk/repo - url = https://github.com/SiliconLabs/sdk_support.git - branch = master - platforms = efr32 [submodule "simw-top-mini"] path = third_party/simw-top-mini/repo url = https://github.com/NXP/plug-and-trust.git @@ -237,10 +232,6 @@ url = https://github.com/TexasInstruments/cc13xx_cc26xx_sdk.git branch = main platforms = cc13x2_26x2 -[submodule "third_party/efr32_sdk/wiseconnect-wifi-bt-sdk"] - path = third_party/efr32_sdk/wiseconnect-wifi-bt-sdk - url = https://github.com/SiliconLabs/wiseconnect-wifi-bt-sdk - platforms = efr32 [submodule "third_party/bouffalolab/bl602"] path = third_party/bouffalolab/bl602_sdk/repo url = https://github.com/bouffalolab/bl_iot_sdk_matter.git @@ -251,3 +242,18 @@ url = https://github.com/NXPmicro/mbedtls.git branch = tinycrypt-mbedtls-2.28 platforms = k32w0 +[submodule "third_party/silabs/matter_support"] + path = third_party/silabs/matter_support + url = https://github.com/SiliconLabs/sdk_support.git + branch = main + platforms = efr32 +[submodule "third_party/silabs/gecko_sdk"] + path = third_party/silabs/gecko_sdk + url = https://github.com/SiliconLabs/gecko_sdk.git + branch = gsdk_4.1 + platforms = efr32 +[submodule "third_party/silabs/wiseconnect-wifi-bt-sdk"] + path = third_party/silabs/wiseconnect-wifi-bt-sdk + url = https://github.com/SiliconLabs/wiseconnect-wifi-bt-sdk.git + branch = master + platforms = efr32 diff --git a/build_overrides/efr32_sdk.gni b/build_overrides/efr32_sdk.gni index dda4d4d2735d4b..4a7344b4c7ebed 100644 --- a/build_overrides/efr32_sdk.gni +++ b/build_overrides/efr32_sdk.gni @@ -14,5 +14,5 @@ declare_args() { # Root directory for efr32 SDK build files. - efr32_sdk_build_root = "//third_party/efr32_sdk" + efr32_sdk_build_root = "//third_party/silabs" } diff --git a/examples/build_overrides/efr32_sdk.gni b/examples/build_overrides/efr32_sdk.gni index bd96dcbd8855b4..d5a35449d9ffd0 100644 --- a/examples/build_overrides/efr32_sdk.gni +++ b/examples/build_overrides/efr32_sdk.gni @@ -14,5 +14,5 @@ declare_args() { # Root directory for erf32 SDK. - efr32_sdk_build_root = "//third_party/connectedhomeip/third_party/efr32_sdk" + efr32_sdk_build_root = "//third_party/connectedhomeip/third_party/silabs" } diff --git a/examples/light-switch-app/efr32/BUILD.gn b/examples/light-switch-app/efr32/BUILD.gn index 402faaeca9a70c..7d870ecd737eb0 100644 --- a/examples/light-switch-app/efr32/BUILD.gn +++ b/examples/light-switch-app/efr32/BUILD.gn @@ -89,7 +89,7 @@ if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") { # WiFi settings if (chip_enable_wifi) { - wifi_sdk_dir = "${chip_root}/third_party/efr32_sdk/repo/matter/wifi" + wifi_sdk_dir = "${chip_root}/third_party/silabs/matter_support/matter/wifi" efr32_lwip_defs = [ "LWIP_NETIF_API=1" ] efr32_lwip_defs += [ "LWIP_IPV4=1", @@ -102,7 +102,7 @@ if (chip_enable_wifi) { if (use_rs911x) { wiseconnect_sdk_root = - "${chip_root}/third_party/efr32_sdk/wiseconnect-wifi-bt-sdk" + "${chip_root}/third_party/silabs/wiseconnect-wifi-bt-sdk" import("${wifi_sdk_dir}/rs911x/rs911x.gni") } else { import("${wifi_sdk_dir}/wf200/wf200.gni") diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index 341582d0287321..192833797494b2 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -89,7 +89,7 @@ if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") { # WiFi settings if (chip_enable_wifi) { - wifi_sdk_dir = "${chip_root}/third_party/efr32_sdk/repo/matter/wifi" + wifi_sdk_dir = "${chip_root}/third_party/silabs/matter_support/matter/wifi" efr32_lwip_defs = [ "LWIP_NETIF_API=1" ] efr32_lwip_defs += [ "LWIP_IPV4=1", @@ -102,7 +102,7 @@ if (chip_enable_wifi) { if (use_rs911x) { wiseconnect_sdk_root = - "${chip_root}/third_party/efr32_sdk/wiseconnect-wifi-bt-sdk" + "${chip_root}/third_party/silabs/wiseconnect-wifi-bt-sdk" import("${wifi_sdk_dir}/rs911x/rs911x.gni") } else { import("${wifi_sdk_dir}/wf200/wf200.gni") diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index 50ebd01f436152..679ed1f46cda3d 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -89,7 +89,7 @@ if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") { # WiFi settings if (chip_enable_wifi) { - wifi_sdk_dir = "${chip_root}/third_party/efr32_sdk/repo/matter/wifi" + wifi_sdk_dir = "${chip_root}/third_party/silabs/matter_support/matter/wifi" efr32_lwip_defs = [ "LWIP_NETIF_API=1" ] efr32_lwip_defs += [ "LWIP_IPV4=1", @@ -102,7 +102,7 @@ if (chip_enable_wifi) { if (use_rs911x) { wiseconnect_sdk_root = - "${chip_root}/third_party/efr32_sdk/wiseconnect-wifi-bt-sdk" + "${chip_root}/third_party/silabs/wiseconnect-wifi-bt-sdk" import("${wifi_sdk_dir}/rs911x/rs911x.gni") } else { import("${wifi_sdk_dir}/wf200/wf200.gni") diff --git a/examples/platform/efr32/ldscripts/efr32mg12.ld b/examples/platform/efr32/ldscripts/efr32mg12.ld index 0851b5ffdf6a60..042f5f50a2a430 100644 --- a/examples/platform/efr32/ldscripts/efr32mg12.ld +++ b/examples/platform/efr32/ldscripts/efr32mg12.ld @@ -17,10 +17,9 @@ */ /***************************************************************************//** * Linker script for Silicon Labs EFR32MG12P devices - * @version 5.7.2 ******************************************************************************* * # License - * Copyright 2018 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * * SPDX-License-Identifier: Zlib @@ -45,6 +44,7 @@ * ******************************************************************************/ + MEMORY { FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1048576 @@ -81,8 +81,6 @@ MEMORY * __StackLimit * __StackTop * __stack - * __Vectors_End - * __Vectors_Size */ ENTRY(Reset_Handler) @@ -91,21 +89,12 @@ SECTIONS .text : { KEEP(*(.vectors)) - __Vectors_End = .; - __Vectors_Size = __Vectors_End - __Vectors; - __end__ = .; *(.text*) KEEP(*(.init)) KEEP(*(.fini)) - KEEP(*(.application_properties)) - KEEP(*(.gecko_configuration)) - KEEP(*(.xo_configuration)) - KEEP(*(.gatt_header)) - KEEP(*(.gatt_data)) - /* .ctors */ *crtbegin.o(.ctors) *crtbegin?.o(.ctors) @@ -122,11 +111,9 @@ SECTIONS *(.rodata*) - KEEP(*(.eh_frame*)) } > FLASH - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) @@ -139,44 +126,26 @@ SECTIONS } > FLASH __exidx_end = .; - - - /* To copy multiple ROM to RAM sections, - * uncomment .copy.table section and, - * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ - /* .copy.table : { . = ALIGN(4); __copy_table_start__ = .; + LONG (__etext) LONG (__data_start__) - LONG (__data_end__ - __data_start__) - LONG (__etext2) - LONG (__data2_start__) - LONG (__data2_end__ - __data2_start__) + LONG ((__data_end__ - __data_start__) / 4) + __copy_table_end__ = .; } > FLASH - */ - /* To clear multiple BSS sections, - * uncomment .zero.table section and, - * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ - /* .zero.table : { . = ALIGN(4); __zero_table_start__ = .; - LONG (__bss_start__) - LONG (__bss_end__ - __bss_start__) - LONG (__bss2_start__) - LONG (__bss2_end__ - __bss2_start__) __zero_table_end__ = .; } > FLASH - */ - - __etext = .; + __etext = ALIGN (4); .data : AT (__etext) { @@ -219,13 +188,14 @@ SECTIONS { . = ALIGN(4); __bss_start__ = .; - *(.bss*) + *(.bss) + *(.bss.*) *(COMMON) . = ALIGN(4); __bss_end__ = .; } > RAM - .heap (COPY): + .heap (COPY) : { __HeapBase = .; __end__ = .; @@ -240,7 +210,7 @@ SECTIONS /* .stack_dummy section doesn't contains any symbols. It is only * used for linker to calculate size of stack sections, and assign * values to stack symbols later */ - .stack_dummy (COPY): + .stack_dummy (COPY): { KEEP(*(.stack*)) } > RAM diff --git a/examples/platform/efr32/ldscripts/efr32mg24.ld b/examples/platform/efr32/ldscripts/efr32mg24.ld index 7b19dbea1bc03f..cac2b08a2b1371 100644 --- a/examples/platform/efr32/ldscripts/efr32mg24.ld +++ b/examples/platform/efr32/ldscripts/efr32mg24.ld @@ -16,11 +16,14 @@ * limitations under the License. */ /***************************************************************************//** - * @file + * @file gcc_EFR32MG24.ld + * @brief GNU Linker Script for Cortex-M based device + * @version V2.2.0 + * @date 16. December 2020 * Linker script for Silicon Labs EFR32MG24 devices ******************************************************************************* * # License - * Copyright 2021 Silicon Laboratories, Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories, Inc. www.silabs.com ******************************************************************************* * * SPDX-License-Identifier: Zlib @@ -45,11 +48,11 @@ * ******************************************************************************/ - MEMORY - { - FLASH (rx) : ORIGIN = 0x8006000, LENGTH = 0x178000 - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x40000 - } +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08006000, LENGTH = 0x178000 + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x40000 +} /* Linker script to place sections and symbol values. Should be used together * with other linker script that defines memory regions FLASH and RAM. @@ -76,14 +79,13 @@ * __bss_end__ * __end__ * end - * __HeapBase * __HeapLimit * __StackLimit * __StackTop * __stack - * __Vectors_End - * __Vectors_Size + * __StackSeal (only if ARMv8-M stack sealing is used) */ + ENTRY(Reset_Handler) SECTIONS @@ -91,21 +93,11 @@ SECTIONS .text : { KEEP(*(.vectors)) - __Vectors_End = .; - __Vectors_Size = __Vectors_End - __Vectors; - __end__ = .; - *(.text*) KEEP(*(.init)) KEEP(*(.fini)) - KEEP(*(.application_properties)) - KEEP(*(.gecko_configuration)) - KEEP(*(.xo_configuration)) - KEEP(*(.gatt_header)) - KEEP(*(.gatt_data)) - /* .ctors */ *crtbegin.o(.ctors) *crtbegin?.o(.ctors) @@ -122,11 +114,8 @@ SECTIONS *(.rodata*) - KEEP(*(.eh_frame*)) } > FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) @@ -139,44 +128,25 @@ SECTIONS } > FLASH __exidx_end = .; - - - /* To copy multiple ROM to RAM sections, - * uncomment .copy.table section and, - * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ - /* .copy.table : { . = ALIGN(4); __copy_table_start__ = .; + LONG (__etext) LONG (__data_start__) - LONG (__data_end__ - __data_start__) - LONG (__etext2) - LONG (__data2_start__) - LONG (__data2_end__ - __data2_start__) + LONG ((__data_end__ - __data_start__) / 4) + __copy_table_end__ = .; } > FLASH - */ - /* To clear multiple BSS sections, - * uncomment .zero.table section and, - * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ - /* .zero.table : { . = ALIGN(4); __zero_table_start__ = .; - LONG (__bss_start__) - LONG (__bss_end__ - __bss_start__) - LONG (__bss2_start__) - LONG (__bss2_end__ - __bss2_start__) __zero_table_end__ = .; + __etext = ALIGN(4); } > FLASH - */ - - __etext = .; - .data : AT (__etext) { @@ -219,11 +189,12 @@ SECTIONS { . = ALIGN(4); __bss_start__ = .; - *(.bss*) + *(.bss) + *(.bss.*) *(COMMON) . = ALIGN(4); __bss_end__ = .; - } > RAM + } > RAM AT > RAM .heap (COPY): { @@ -243,6 +214,7 @@ SECTIONS .stack_dummy (COPY): { KEEP(*(.stack*)) + /* KEEP(*(.stackseal*))*/ } > RAM /* Set stack top to end of RAM, and stack limit move down by @@ -265,4 +237,6 @@ SECTIONS /*ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")*/ ASSERT( (linker_nvm_begin + SIZEOF(.nvm)) <= __main_flash_end__, "NVM3 is excessing the flash size !") + /* Check if FLASH usage exceeds FLASH size */ + ASSERT( LENGTH(FLASH) >= (__etext + SIZEOF(.data)), "FLASH memory overflowed !") } diff --git a/examples/platform/efr32/matter_config.cpp b/examples/platform/efr32/matter_config.cpp index 12bfbc5b8117d7..26c8541605dcfe 100644 --- a/examples/platform/efr32/matter_config.cpp +++ b/examples/platform/efr32/matter_config.cpp @@ -135,7 +135,7 @@ CHIP_ERROR EFR32MatterConfig::InitMatter(const char * appName) //============================================== EFR32_LOG("Init CHIP Stack"); // Init Chip memory management before the stack - chip::Platform::MemoryInit(); + ReturnErrorOnFailure(chip::Platform::MemoryInit()); ReturnErrorOnFailure(PlatformMgr().InitChipStack()); chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName(appName); diff --git a/examples/window-app/efr32/BUILD.gn b/examples/window-app/efr32/BUILD.gn index 33ea182d5316a7..d829fa9d15116b 100644 --- a/examples/window-app/efr32/BUILD.gn +++ b/examples/window-app/efr32/BUILD.gn @@ -82,7 +82,7 @@ if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") { # WiFi settings if (chip_enable_wifi) { - wifi_sdk_dir = "${chip_root}/third_party/efr32_sdk/repo/matter/wifi" + wifi_sdk_dir = "${chip_root}/third_party/silabs/matter_support/matter/wifi" efr32_lwip_defs = [ "LWIP_NETIF_API=1" ] efr32_lwip_defs += [ "LWIP_IPV4=1", @@ -95,7 +95,7 @@ if (chip_enable_wifi) { if (use_rs911x) { wiseconnect_sdk_root = - "${chip_root}/third_party/efr32_sdk/wiseconnect-wifi-bt-sdk" + "${chip_root}/third_party/silabs/wiseconnect-wifi-bt-sdk" import("${wifi_sdk_dir}/rs911x/rs911x.gni") } else { import("${wifi_sdk_dir}/wf200/wf200.gni") diff --git a/src/platform/EFR32/BLEManagerImpl.cpp b/src/platform/EFR32/BLEManagerImpl.cpp index 3e675a00dd053c..de1078a668f7ea 100644 --- a/src/platform/EFR32/BLEManagerImpl.cpp +++ b/src/platform/EFR32/BLEManagerImpl.cpp @@ -26,6 +26,8 @@ #include #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE +#include "sl_component_catalog.h" + #include #include "FreeRTOS.h" @@ -88,17 +90,6 @@ namespace { TimerHandle_t sbleAdvTimeoutTimer; // FreeRTOS sw timer. -/* Bluetooth stack configuration parameters (see "UG136: Silicon Labs Bluetooth C Application Developer's Guide" for - * details on each parameter) */ -static sl_bt_configuration_t config; - -/** @brief Table of used BGAPI classes */ -static const struct sli_bgapi_class * const bt_class_table[] = { SL_BT_BGAPI_CLASS(system), SL_BT_BGAPI_CLASS(advertiser), - SL_BT_BGAPI_CLASS(gap), SL_BT_BGAPI_CLASS(scanner), - SL_BT_BGAPI_CLASS(connection), SL_BT_BGAPI_CLASS(gatt), - SL_BT_BGAPI_CLASS(gatt_server), SL_BT_BGAPI_CLASS(nvm), - SL_BT_BGAPI_CLASS(sm), NULL }; - StackType_t bluetoothEventStack[CHIP_DEVICE_CONFIG_BLE_APP_TASK_STACK_SIZE / sizeof(StackType_t)]; StaticTask_t bluetoothEventTaskStruct; static TaskHandle_t BluetoothEventTaskHandle; @@ -131,36 +122,10 @@ extern "C" sl_status_t initialize_bluetooth() NVIC_ClearPendingIRQ(PendSV_IRQn); NVIC_EnableIRQ(PendSV_IRQn); #endif - sl_status_t ret = sl_bt_init_stack(&config); - sl_bt_init_classes(bt_class_table); - sl_bt_init_multiprotocol(); - return ret; -} + sl_status_t err = sl_bt_stack_init(); + EFM_ASSERT(err == SL_STATUS_OK); -static void initBleConfig(void) -{ - memset(&config, 0, sizeof(sl_bt_configuration_t)); - config.config_flags = SL_BT_CONFIG_FLAG_RTOS; /* Check flag options from UG136 */ - config.bluetooth.max_connections = BLE_LAYER_NUM_BLE_ENDPOINTS; /* Maximum number of simultaneous connections */ - config.bluetooth.max_advertisers = BLE_MAX_ADVERTISERS; - config.bluetooth.max_periodic_sync = BLE_CONFIG_MAX_PERIODIC_ADVERTISING_SYNC; - config.bluetooth.max_buffer_memory = BLE_MAX_BUFFER_SIZE; - config.gattdb = &gattdb; /* Pointer to GATT database */ - config.scheduler_callback = BluetoothLLCallback; - config.stack_schedule_callback = BluetoothUpdate; - config.max_timers = BLE_CONFIG_MAX_SOFTWARE_TIMERS; - config.rf.tx_gain = BLE_CONFIG_RF_PATH_GAIN_TX; - config.rf.rx_gain = BLE_CONFIG_RF_PATH_GAIN_RX; - config.rf.tx_min_power = BLE_CONFIG_MIN_TX_POWER; - config.rf.tx_max_power = BLE_CONFIG_MAX_TX_POWER; -#if (HAL_PA_ENABLE) - config.pa.config_enable = 1; /* Set this to be a valid PA config */ -#if defined(FEATURE_PA_INPUT_FROM_VBAT) - config.pa.input = SL_BT_RADIO_PA_INPUT_VBAT; /* Configure PA input to VBAT */ -#else - config.pa.input = SL_BT_RADIO_PA_INPUT_DCDC; /* Configure PA input to DCDC */ -#endif // defined(FEATURE_PA_INPUT_FROM_VBAT) -#endif // (HAL_PA_ENABLE) + return err; } CHIP_ERROR BLEManagerImpl::_Init() @@ -176,13 +141,11 @@ CHIP_ERROR BLEManagerImpl::_Init() memset(mIndConfId, kUnusedIndex, sizeof(mIndConfId)); mServiceMode = ConnectivityManager::kCHIPoBLEServiceMode_Enabled; - initBleConfig(); - // Start Bluetooth Link Layer and stack tasks ret = bluetooth_start(CHIP_DEVICE_CONFIG_BLE_LL_TASK_PRIORITY, CHIP_DEVICE_CONFIG_BLE_STACK_TASK_PRIORITY, initialize_bluetooth); - VerifyOrExit(ret == bg_err_success, err = MapBLEError(ret)); + VerifyOrExit(ret == SL_STATUS_OK, err = MapBLEError(ret)); // Create the Bluetooth Application task BluetoothEventTaskHandle = @@ -523,7 +486,7 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU VerifyOrExit(timerHandle != kMaxConnections, err = CHIP_ERROR_NO_MEMORY); // start timer for light notification confirmation. Long delay for spake2 indication - sl_bt_system_set_soft_timer(TIMER_S_2_TIMERTICK(6), timerHandle, true); + sl_bt_system_set_lazy_soft_timer(TIMER_S_2_TIMERTICK(6), 0, timerHandle, true); ret = sl_bt_gatt_server_send_notification(conId, cId, (data->DataLength()), data->Start()); err = MapBLEError(ret); @@ -868,13 +831,13 @@ void BLEManagerImpl::HandleConnectionCloseEvent(volatile sl_bt_msg_t * evt) switch (conn_evt->reason) { - case bg_err_bt_remote_user_terminated: - case bg_err_bt_remote_device_terminated_connection_due_to_low_resources: - case bg_err_bt_remote_powering_off: + case SL_STATUS_BT_CTRL_REMOTE_USER_TERMINATED: + case SL_STATUS_BT_CTRL_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_LOW_RESOURCES: + case SL_STATUS_BT_CTRL_REMOTE_POWERING_OFF: event.CHIPoBLEConnectionError.Reason = BLE_ERROR_REMOTE_DEVICE_DISCONNECTED; break; - case bg_err_bt_connection_terminated_by_local_host: + case SL_STATUS_BT_CTRL_CONNECTION_TERMINATED_BY_LOCAL_HOST: event.CHIPoBLEConnectionError.Reason = BLE_ERROR_APP_CLOSED_CONNECTION; break; @@ -995,7 +958,7 @@ void BLEManagerImpl::HandleTxConfirmationEvent(BLE_CONNECTION_OBJECT conId) if (timerHandle < kMaxConnections) { ChipLogProgress(DeviceLayer, " stop soft timer"); - sl_bt_system_set_soft_timer(0, timerHandle, false); + sl_bt_system_set_lazy_soft_timer(0, 0, timerHandle, false); } event.Type = DeviceEventType::kCHIPoBLEIndicateConfirm; diff --git a/src/platform/EFR32/BlePlatformConfig.h b/src/platform/EFR32/BlePlatformConfig.h index 92a1690269f4a1..eec08879cac19b 100644 --- a/src/platform/EFR32/BlePlatformConfig.h +++ b/src/platform/EFR32/BlePlatformConfig.h @@ -25,7 +25,7 @@ #pragma once -#include "bg_errorcodes.h" +#include "sl_bt_api.h" // ==================== Platform Adaptations ==================== diff --git a/src/platform/EFR32/efr32-chip-mbedtls-config.h b/src/platform/EFR32/efr32-chip-mbedtls-config.h index b3f2a76704d711..edddb2abb6f0c8 100644 --- a/src/platform/EFR32/efr32-chip-mbedtls-config.h +++ b/src/platform/EFR32/efr32-chip-mbedtls-config.h @@ -42,6 +42,7 @@ #define MBEDTLS_ECP_C #define MBEDTLS_ECDH_C #define MBEDTLS_ENTROPY_C +#define MBEDTLS_SHA224_C #define MBEDTLS_SHA256_C #define MBEDTLS_TRNG_C diff --git a/third_party/efr32_sdk/repo b/third_party/efr32_sdk/repo deleted file mode 160000 index 5b35fdb24024ec..00000000000000 --- a/third_party/efr32_sdk/repo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5b35fdb24024ecc9f0af6cb8e38674c60c84dde4 diff --git a/third_party/openthread/ot-efr32 b/third_party/openthread/ot-efr32 index a40595970a99bf..28aa89425d8074 160000 --- a/third_party/openthread/ot-efr32 +++ b/third_party/openthread/ot-efr32 @@ -1 +1 @@ -Subproject commit a40595970a99bf5468fa9f39a3c2222b931ba41f +Subproject commit 28aa89425d807485cb618e60858a6b9906a0741b diff --git a/third_party/openthread/platforms/efr32/BUILD.gn b/third_party/openthread/platforms/efr32/BUILD.gn index adc4b41f759722..251932b39108e4 100644 --- a/third_party/openthread/platforms/efr32/BUILD.gn +++ b/third_party/openthread/platforms/efr32/BUILD.gn @@ -30,7 +30,7 @@ config("openthread_efr32_config") { include_dirs = [ "${chip_root}/examples/platform/efr32", - "${efr32_sdk_root}/matter/efr32/${efr32_family}/${efr32_board}", + "${sdk_support_root}/matter/efr32/${efr32_family}/${efr32_board}", "${openthread_efr32_root}/src/src", ] } @@ -50,10 +50,12 @@ source_set("openthread_core_config_efr32") { source_set("libopenthread-efr32") { sources = [ "${openthread_efr32_root}/src/src/alarm.c", + "${openthread_efr32_root}/src/src/crypto.c", "${openthread_efr32_root}/src/src/entropy.c", "${openthread_efr32_root}/src/src/flash.c", "${openthread_efr32_root}/src/src/misc.c", "${openthread_efr32_root}/src/src/radio.c", + "${openthread_efr32_root}/src/src/security_manager.c", "${openthread_efr32_root}/src/src/system.c", "${openthread_root}/examples/apps/cli/cli_uart.cpp", ] diff --git a/third_party/efr32_sdk/BUILD.gn b/third_party/silabs/BUILD.gn similarity index 100% rename from third_party/efr32_sdk/BUILD.gn rename to third_party/silabs/BUILD.gn diff --git a/third_party/efr32_sdk/efr32_arm.gni b/third_party/silabs/efr32_arm.gni similarity index 100% rename from third_party/efr32_sdk/efr32_arm.gni rename to third_party/silabs/efr32_arm.gni diff --git a/third_party/efr32_sdk/efr32_board.gni b/third_party/silabs/efr32_board.gni similarity index 100% rename from third_party/efr32_sdk/efr32_board.gni rename to third_party/silabs/efr32_board.gni diff --git a/third_party/efr32_sdk/efr32_executable.gni b/third_party/silabs/efr32_executable.gni similarity index 100% rename from third_party/efr32_sdk/efr32_executable.gni rename to third_party/silabs/efr32_executable.gni diff --git a/third_party/efr32_sdk/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni similarity index 94% rename from third_party/efr32_sdk/efr32_sdk.gni rename to third_party/silabs/efr32_sdk.gni index 3fe0e894978505..a5eae3f8e6d45c 100644 --- a/third_party/efr32_sdk/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -22,7 +22,8 @@ import("efr32_board.gni") declare_args() { # Location of the efr32 SDK. - efr32_sdk_root = "${chip_root}/third_party/efr32_sdk/repo" + efr32_sdk_root = "${chip_root}/third_party/silabs/gecko_sdk" + sdk_support_root = "${chip_root}/third_party/silabs/matter_support" enable_openthread_cli = true kvs_max_entries = 75 } @@ -63,11 +64,11 @@ template("efr32_sdk") { "${efr32_sdk_root}/hardware/board/inc", "${efr32_sdk_root}/hardware/driver/memlcd/inc", "${efr32_sdk_root}/hardware/driver/memlcd/src/ls013b7dh03", - "${efr32_sdk_root}/matter/efr32", - "${efr32_sdk_root}/matter/efr32/${efr32_family}/", - "${efr32_sdk_root}/matter/efr32/${efr32_family}/${efr32_board}", "${efr32_sdk_root}/platform/bootloader", - "${efr32_sdk_root}/platform/CMSIS/Include", + "${efr32_sdk_root}/platform/bootloader/config", + "${efr32_sdk_root}/platform/bootloader/config/s2/btl_interface", + "${efr32_sdk_root}/platform/bootloader/api", + "${efr32_sdk_root}/platform/CMSIS/Core/Include", "${efr32_sdk_root}/platform/CMSIS/RTOS2/Include", "${efr32_sdk_root}/platform/common/inc", "${efr32_sdk_root}/platform/driver/button/inc", @@ -110,6 +111,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/protocol/bluetooth/inc/", "${efr32_sdk_root}/util/plugin/plugin-common/fem-control", "${efr32_sdk_root}/util/silicon_labs/silabs_core/graphics", + "${efr32_sdk_root}/util/silicon_labs/silabs_core/memory_manager", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/include", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/include/psa", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library", @@ -118,10 +120,14 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/inc", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/config/", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/inc", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/inc/public", "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/inc", "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/", "${efr32_sdk_root}/util/third_party/freertos/cmsis/Include", "${efr32_sdk_root}/util/third_party/freertos/kernel/include", + "${sdk_support_root}/matter/efr32", + "${sdk_support_root}/matter/efr32/${efr32_family}/", + "${sdk_support_root}/matter/efr32/${efr32_family}/${efr32_board}", ] defines = [ @@ -147,6 +153,7 @@ template("efr32_sdk") { "MBEDTLS_THREADING_C=1", "MBEDTLS_THREADING_ALT=1", "SL_THREADING_ALT=1", + "SL_COMPONENT_CATALOG_PRESENT", #"__STACK_SIZE=0", ] @@ -254,7 +261,7 @@ template("efr32_sdk") { ] libs += [ - "${efr32_sdk_root}/protocol/bluetooth/lib/EFR32MG24/GCC/binapploader.o", + "${efr32_sdk_root}/protocol/bluetooth/lib/EFR32MG24/GCC/libapploader.a", "${efr32_sdk_root}/protocol/bluetooth/lib/EFR32MG24/GCC/libbluetooth.a", "${efr32_sdk_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg24_gcc_release.a", "${efr32_sdk_root}/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a", @@ -285,6 +292,10 @@ template("efr32_sdk") { "-Wno-shadow", ] + if (efr32_family == "efr32mg24") { + cflags += [ "-mcmse" ] + } + if (defined(invoker.use_rs911x)) { if (invoker.use_rs911x == true) { #add compilation flags for rs991x build. This will be addressed directly in wiseconnect sdk in the next version release of that sdk @@ -302,13 +313,10 @@ template("efr32_sdk") { "${chip_root}/third_party/mbedtls/repo/include/mbedtls/platform.h", "${efr32_sdk_root}/hardware/board/src/sl_board_control_gpio.c", "${efr32_sdk_root}/hardware/board/src/sl_board_init.c", - "${efr32_sdk_root}/matter/efr32/sl_board_default_init.c", - "${efr32_sdk_root}/matter/efr32/sl_device_init_clocks.c", - "${efr32_sdk_root}/matter/efr32/sl_event_handler.c", - "${efr32_sdk_root}/matter/efr32/sl_simple_button_instances.c", - "${efr32_sdk_root}/matter/efr32/sl_simple_led_instances.c", "${efr32_sdk_root}/platform/CMSIS/RTOS2/Source/os_systick.c", - "${efr32_sdk_root}/platform/bootloader/plugin/security/sha/crypto_sha.c", + "${efr32_sdk_root}/platform/bootloader/api/btl_interface.c", + "${efr32_sdk_root}/platform/bootloader/api/btl_interface_storage.c", + "${efr32_sdk_root}/platform/bootloader/security/sha/crypto_sha.c", "${efr32_sdk_root}/platform/common/src/sl_slist.c", "${efr32_sdk_root}/platform/driver/button/src/sl_button.c", "${efr32_sdk_root}/platform/driver/button/src/sl_simple_button.c", @@ -353,22 +361,22 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/service/udelay/src/sl_udelay.c", "${efr32_sdk_root}/platform/service/udelay/src/sl_udelay_armv6m_gcc.S", "${efr32_sdk_root}/protocol/bluetooth/src/sl_bt_mbedtls_context.c", + "${efr32_sdk_root}/protocol/bluetooth/src/sl_bt_stack_init.c", + "${efr32_sdk_root}/util/silicon_labs/silabs_core/memory_manager/sl_malloc.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/aes.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/aesni.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/arc4.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/asn1parse.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/asn1write.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/base64.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/bignum.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/blowfish.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/camellia.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ccm.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/certs.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/chacha20.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/chachapoly.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/cipher.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/cipher_wrap.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/cmac.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/constant_time.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ctr_drbg.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/debug.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/des.c", @@ -380,7 +388,6 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ecp_curves.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/entropy.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/entropy_poll.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/error.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/gcm.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/hkdf.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/hmac_drbg.c", @@ -412,7 +419,6 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_its_file.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ripemd160.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/rsa.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/rsa_internal.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/sha1.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/sha256.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/sha512.c", @@ -428,7 +434,6 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/threading.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/timing.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/version.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/version_features.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509_create.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509_crl.c", @@ -436,19 +441,21 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509_csr.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509write_crt.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509write_csr.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/xtea.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_alt/source/sl_entropy.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_alt/source/sl_mbedtls.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/aes_aes.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/crypto_aes.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/crypto_ecp.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/error.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_ccm.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_cmac.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_ecdsa_ecdh.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_sha.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/sl_entropy_hardware.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/sl_mbedtls.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/version_features.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_protocol_crypto_crypto.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_protocol_crypto_radioaes.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/crypto_management.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sl_psa_its_nvm3.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_aead.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_cipher.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_hash.c", @@ -467,6 +474,13 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/freertos/kernel/stream_buffer.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/tasks.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/timers.c", + "${sdk_support_root}/matter/efr32/sl_board_default_init.c", + "${sdk_support_root}/matter/efr32/sl_device_init_clocks.c", + "${sdk_support_root}/matter/efr32/sl_event_handler.c", + "${sdk_support_root}/matter/efr32/sl_simple_button_instances.c", + "${sdk_support_root}/matter/efr32/sl_simple_led_instances.c", + "${sdk_support_root}/matter/efr32/sli_bt_advertiser_config.c", + "${sdk_support_root}/matter/efr32/sli_bt_connection_config.c", ] if (defined(invoker.enable_sleepy_device)) { @@ -487,11 +501,11 @@ template("efr32_sdk") { (defined(invoker.show_qr_code) && invoker.show_qr_code) || (defined(invoker.disable_lcd) && !invoker.disable_lcd)) { sources += [ - "${efr32_sdk_root}/matter/efr32/${efr32_family}/sl_uartdrv_init.c", "${efr32_sdk_root}/platform/emdrv/uartdrv/src/uartdrv.c", "${efr32_sdk_root}/platform/emlib/src/em_eusart.c", "${efr32_sdk_root}/platform/emlib/src/em_leuart.c", "${efr32_sdk_root}/platform/emlib/src/em_usart.c", + "${sdk_support_root}/matter/efr32/${efr32_family}/sl_uartdrv_init.c", ] if (efr32_family == "efr32mg12") { @@ -542,7 +556,7 @@ template("efr32_sdk") { if (efr32_family == "efr32mg12") { sources += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Source/GCC/startup_efr32mg12p.c", + "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Source/startup_efr32mg12p.c", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Source/system_efr32mg12p.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dcdc_s1.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s1.c", @@ -552,7 +566,7 @@ template("efr32_sdk") { ] } else if (efr32_family == "efr32mg21") { sources += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG21/Source/GCC/startup_efr32mg21.c", + "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG21/Source/startup_efr32mg21.c", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG21/Source/system_efr32mg21.c", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_rf_path/sl_rail_util_rf_path.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s2.c", @@ -568,7 +582,6 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_handling.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_signature.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_util.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_alt/source/sl_psa_its_nvm3.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_alt/source/sl_se_management.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_aes.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_gcm.c", @@ -592,8 +605,9 @@ template("efr32_sdk") { ] } else if (efr32_family == "efr32mg24") { sources += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG24/Source/GCC/startup_efr32mg24.c", + "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG24/Source/startup_efr32mg24.c", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG24/Source/system_efr32mg24.c", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/pa_curves_efr32.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dcdc_s2.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s2.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfxo_s2.c", @@ -608,8 +622,6 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_handling.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_signature.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_util.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_alt/source/sl_psa_its_nvm3.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_alt/source/sl_se_management.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_aes.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_jpake.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_radioaes_management.c", diff --git a/third_party/silabs/gecko_sdk b/third_party/silabs/gecko_sdk new file mode 160000 index 00000000000000..310814a9016b60 --- /dev/null +++ b/third_party/silabs/gecko_sdk @@ -0,0 +1 @@ +Subproject commit 310814a9016b60a8012d50c62cc168a783ac102b diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support new file mode 160000 index 00000000000000..0da3151735033b --- /dev/null +++ b/third_party/silabs/matter_support @@ -0,0 +1 @@ +Subproject commit 0da3151735033b26a77eaa6c291ae5da69525cc3 diff --git a/third_party/efr32_sdk/wiseconnect-wifi-bt-sdk b/third_party/silabs/wiseconnect-wifi-bt-sdk similarity index 100% rename from third_party/efr32_sdk/wiseconnect-wifi-bt-sdk rename to third_party/silabs/wiseconnect-wifi-bt-sdk From 6231ccc26ffa2bc6d1345b8b7e8f82a63da497e7 Mon Sep 17 00:00:00 2001 From: Sergei Lissianoi <54454955+selissia@users.noreply.github.com> Date: Wed, 22 Jun 2022 17:27:42 -0400 Subject: [PATCH 4/4] [EFR32] Fix OpenThread and Matter shell operation on EFRMG24 boards (#19858) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Test added march 8 (#15957) * Added new manual scripts * Added Auto generated File * [OTA] Fix OTARequestorDriverImpl inclusion (#15981) * Regen to fix CI failures (#15990) * [ota] Store Default OTA Providers in flash (#15970) * [ota] Store Default OTA Providers in flash Store Default OTA Providers in flash each time the attribute is modified and load it back on the application startup. * Restyled by clang-format * Fix build and reduce flash usage Co-authored-by: Restyled.io * Test VCOM EUSART fix * EUSART init test code * Fix the IRQ handler * Remove merge artifacts * Clean up debug code * Clean up debug code * Restyled by clang-format Co-authored-by: kowsisoundhar12 <57476670+kowsisoundhar12@users.noreply.github.com> Co-authored-by: Carol Yang Co-authored-by: Boris Zbarsky Co-authored-by: Damian Królik <66667989+Damian-Nordic@users.noreply.github.com> Co-authored-by: Restyled.io --- examples/platform/efr32/uart.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/examples/platform/efr32/uart.cpp b/examples/platform/efr32/uart.cpp index 91c8955525bff7..548416d177ce16 100644 --- a/examples/platform/efr32/uart.cpp +++ b/examples/platform/efr32/uart.cpp @@ -44,10 +44,20 @@ extern "C" { #define MIN(A, B) ((A) < (B) ? (A) : (B)) #endif +#ifdef EFR32MG24 +#define HELPER1(x) EUSART##x##_RX_IRQn +#else #define HELPER1(x) USART##x##_RX_IRQn +#endif + #define HELPER2(x) HELPER1(x) +#ifdef EFR32MG24 +#define HELPER3(x) EUSART##x##_RX_IRQHandler +#else #define HELPER3(x) USART##x##_RX_IRQHandler +#endif + #define HELPER4(x) HELPER3(x) // On MG24 boards VCOM runs on the EUSART device, MG12 uses the UART device @@ -55,7 +65,6 @@ extern "C" { #define USART_IRQ HELPER2(SL_UARTDRV_EUSART_VCOM_PERIPHERAL_NO) #define USART_IRQHandler HELPER4(SL_UARTDRV_EUSART_VCOM_PERIPHERAL_NO) #define vcom_handle sl_uartdrv_eusart_vcom_handle - #else #define USART_IRQ HELPER2(SL_UARTDRV_USART_VCOM_PERIPHERAL_NO) #define USART_IRQHandler HELPER4(SL_UARTDRV_USART_VCOM_PERIPHERAL_NO) @@ -208,12 +217,19 @@ void uartConsoleInit(void) UARTDRV_Receive(vcom_handle, sRxDmaBuffer, MAX_DMA_BUFFER_SIZE, UART_rx_callback); UARTDRV_Receive(vcom_handle, sRxDmaBuffer2, MAX_DMA_BUFFER_SIZE, UART_rx_callback); - // Enable USART0 interrupt to wake OT task when data arrives + // Enable USART0/EUSART0 interrupt to wake OT task when data arrives NVIC_ClearPendingIRQ(USART_IRQ); NVIC_EnableIRQ(USART_IRQ); #ifdef EFR32MG24 - EUSART_IntEnable(SL_UARTDRV_EUSART_VCOM_PERIPHERAL, USART_IF_RXDATAV); + // Clear previous RX interrupts + EUSART_IntClear(SL_UARTDRV_EUSART_VCOM_PERIPHERAL, EUSART_IF_RXFL); + + // Enable RX interrupts + EUSART_IntEnable(SL_UARTDRV_EUSART_VCOM_PERIPHERAL, EUSART_IF_RXFL); + + // Enable EUSART + EUSART_Enable(SL_UARTDRV_EUSART_VCOM_PERIPHERAL, eusartEnable); #else USART_IntEnable(SL_UARTDRV_USART_VCOM_PERIPHERAL, USART_IF_RXDATAV); #endif // EFR32MG24 @@ -229,6 +245,10 @@ void USART_IRQHandler(void) #elif !defined(PW_RPC_ENABLED) otSysEventSignalPending(); #endif + +#ifdef EFR32MG24 + EUSART_IntClear(SL_UARTDRV_EUSART_VCOM_PERIPHERAL, EUSART_IF_RXFL); +#endif } /*