From 3591063a6875a2c41215253c0e0f4bdc852a66cc Mon Sep 17 00:00:00 2001 From: Seth Rickard Date: Thu, 19 May 2022 08:12:15 -0500 Subject: [PATCH] [TI] disable OTA for all clusters (#18562) * disable OTA for all clusters The size of Matter is too large to allow for the all clusters examples to run in 704K of flash. Disable OTA on these examples to free up space used by the bootloader and OTA processing code. * update copy list to reflect no OTA outputs * re-enable cc13x2x7_26x2x7 workflow --- .../workflows/examples-cc13x2x7_26x2x7.yaml | 3 ++- .../all-clusters-app/cc13x2x7_26x2x7/args.gni | 4 +-- .../cc13x2x7_26x2x7/main/AppTask.cpp | 25 ------------------- examples/shell/cc13x2x7_26x2x7/args.gni | 2 +- .../shell/cc13x2x7_26x2x7/main/AppTask.cpp | 25 ------------------- scripts/build/builders/cc13x2x7_26x2x7.py | 13 +++++++++- 6 files changed, 16 insertions(+), 56 deletions(-) diff --git a/.github/workflows/examples-cc13x2x7_26x2x7.yaml b/.github/workflows/examples-cc13x2x7_26x2x7.yaml index 5687b918858d9f..fec23e0bb9274b 100644 --- a/.github/workflows/examples-cc13x2x7_26x2x7.yaml +++ b/.github/workflows/examples-cc13x2x7_26x2x7.yaml @@ -15,7 +15,8 @@ name: Build example - TI CC26X2X7 on: - workflow_dispatch: + 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 }} diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/args.gni b/examples/all-clusters-app/cc13x2x7_26x2x7/args.gni index 61eb83d4c18b2c..18a8ca6d91747c 100644 --- a/examples/all-clusters-app/cc13x2x7_26x2x7/args.gni +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/args.gni @@ -27,15 +27,13 @@ optimize_debug_level = "s" lwip_debug = false #optimize_for_size=true -chip_enable_ota_requestor = true +chip_enable_ota_requestor = false # Disable FTD Build for all-clusters app to save Flash chip_openthread_ftd = false # Disable CHIP Logging chip_progress_logging = false - -# Dsiable verbose logs for all-clusters app to save Flash chip_detail_logging = false chip_automation_logging = false diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp index 34ea307063019f..f99dd873e2fd60 100644 --- a/examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp @@ -30,13 +30,8 @@ #include -#include -#include -#include -#include #include #include -#include #ifdef AUTO_PRINT_METRICS #include @@ -65,26 +60,8 @@ static Button_Handle sAppRightHandle; AppTask AppTask::sAppTask; -static DefaultOTARequestor sRequestorCore; -static DefaultOTARequestorStorage sRequestorStorage; -static DefaultOTARequestorDriver sRequestorUser; -static BDXDownloader sDownloader; -static OTAImageProcessorImpl sImageProcessor; - constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE; -void InitializeOTARequestor(void) -{ - // Initialize and interconnect the Requestor and Image Processor objects - SetRequestorInstance(&sRequestorCore); - - sRequestorStorage.Init(Server::GetInstance().GetPersistentStorage()); - sRequestorCore.Init(Server::GetInstance(), sRequestorStorage, sRequestorUser, sDownloader); - sImageProcessor.SetOTADownloader(&sDownloader); - sDownloader.SetImageProcessorDelegate(&sImageProcessor); - sRequestorUser.Init(&sRequestorCore, &sImageProcessor); -} - #ifdef AUTO_PRINT_METRICS static void printMetrics(void) { @@ -261,8 +238,6 @@ int AppTask::Init() // this function will happen on the CHIP event loop thread, not the app_main thread. PlatformMgr().AddEventHandler(DeviceEventCallback, reinterpret_cast(nullptr)); - InitializeOTARequestor(); - // QR code will be used with CHIP Tool PrintOnboardingCodes(RendezvousInformationFlags(RendezvousInformationFlag::kBLE)); diff --git a/examples/shell/cc13x2x7_26x2x7/args.gni b/examples/shell/cc13x2x7_26x2x7/args.gni index fabd6f02341f04..2966155edeb06a 100644 --- a/examples/shell/cc13x2x7_26x2x7/args.gni +++ b/examples/shell/cc13x2x7_26x2x7/args.gni @@ -25,7 +25,7 @@ ti_simplelink_board = "LP_CC2652R7" # use -Os instead of -Og, LWIP release build is_debug = false -chip_enable_ota_requestor = true +chip_enable_ota_requestor = false # Disable FTD Build for all-clusters app to save Flash chip_openthread_ftd = false diff --git a/examples/shell/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/shell/cc13x2x7_26x2x7/main/AppTask.cpp index d47e99de140931..7f5e892f6dfa84 100644 --- a/examples/shell/cc13x2x7_26x2x7/main/AppTask.cpp +++ b/examples/shell/cc13x2x7_26x2x7/main/AppTask.cpp @@ -30,14 +30,9 @@ #include #include -#include -#include -#include -#include #include #include #include -#include #include @@ -61,24 +56,6 @@ extern "C" { int cc13x2_26x2LogInit(void); } -static DefaultOTARequestor sRequestorCore; -static DefaultOTARequestorStorage sRequestorStorage; -static DefaultOTARequestorDriver sRequestorUser; -static BDXDownloader sDownloader; -static OTAImageProcessorImpl sImageProcessor; - -void InitializeOTARequestor(void) -{ - // Initialize and interconnect the Requestor and Image Processor objects - SetRequestorInstance(&sRequestorCore); - - sRequestorStorage.Init(Server::GetInstance().GetPersistentStorage()); - sRequestorCore.Init(Server::GetInstance(), sRequestorStorage, sRequestorUser, sDownloader); - sImageProcessor.SetOTADownloader(&sDownloader); - sDownloader.SetImageProcessorDelegate(&sImageProcessor); - sRequestorUser.Init(&sRequestorCore, &sImageProcessor); -} - CHIP_ERROR AppTask::StartAppTask() { CHIP_ERROR err = CHIP_NO_ERROR; @@ -148,8 +125,6 @@ CHIP_ERROR AppTask::Init() // Initialize device attestation config SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); - InitializeOTARequestor(); - return err; } diff --git a/scripts/build/builders/cc13x2x7_26x2x7.py b/scripts/build/builders/cc13x2x7_26x2x7.py index 80afb5d66ce54f..9565b5500f6738 100644 --- a/scripts/build/builders/cc13x2x7_26x2x7.py +++ b/scripts/build/builders/cc13x2x7_26x2x7.py @@ -87,7 +87,18 @@ def GnBuildArgs(self): def build_outputs(self): items = {} - for extension in [".out", ".bin", ".out.map", "-bim.hex"]: + if (self.app == cc13x2x7_26x2x7App.LOCK + or self.app == cc13x2x7_26x2x7App.PUMP + or self.app == cc13x2x7_26x2x7App.PUMP_CONTROLLER): + extensions = [".out", ".bin", ".out.map", "-bim.hex"] + + elif self.app == cc13x2x7_26x2x7App.ALL_CLUSTERS or self.app == cc13x2x7_26x2x7App.SHELL: + extensions = [".out", ".out.map"] + + else: + raise Exception('Unknown app type: %r' % self.app) + + for extension in extensions: name = '%s%s' % (self.app.AppNamePrefix(), extension) items[name] = os.path.join(self.output_dir, name)