From c9ae112391afbfda8cfb92f937e39f2a8f218d92 Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Wed, 21 Feb 2024 12:01:26 -0500 Subject: [PATCH] [Silabs] Silabs fix app error (#32238) * fix main * Fix app errorr --- examples/platform/silabs/main.cpp | 10 ++++++---- examples/platform/silabs/silabs_utils.cpp | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/platform/silabs/main.cpp b/examples/platform/silabs/main.cpp index 3c9829edd1954f..a3155194e8d1dd 100644 --- a/examples/platform/silabs/main.cpp +++ b/examples/platform/silabs/main.cpp @@ -71,8 +71,9 @@ int main(void) void application_start(void * unused) { - if (SilabsMatterConfig::InitMatter(BLE_DEV_NAME) != CHIP_NO_ERROR) - appError(CHIP_ERROR_INTERNAL); + CHIP_ERROR err = SilabsMatterConfig::InitMatter(BLE_DEV_NAME); + if (err != CHIP_NO_ERROR) + appError(err); gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage()); chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); @@ -83,8 +84,9 @@ void application_start(void * unused) chip::DeviceLayer::PlatformMgr().UnlockChipStack(); SILABS_LOG("Starting App Task"); - if (AppTask::GetAppTask().StartAppTask() != CHIP_NO_ERROR) - appError(CHIP_ERROR_INTERNAL); + err = AppTask::GetAppTask().StartAppTask(); + if (err != CHIP_NO_ERROR) + appError(err); vTaskDelete(main_Task); } diff --git a/examples/platform/silabs/silabs_utils.cpp b/examples/platform/silabs/silabs_utils.cpp index 7231836c15bf7e..c8a068a328955c 100644 --- a/examples/platform/silabs/silabs_utils.cpp +++ b/examples/platform/silabs/silabs_utils.cpp @@ -27,7 +27,7 @@ void appError(int err) snprintf(faultMessage, sizeof faultMessage, "App Critical Error:%d", err); SILABS_LOG("!!!!!!!!!!!! %s !!!!!!!!!!!", faultMessage); chip::DeviceLayer::Silabs::OnSoftwareFaultEventHandler(faultMessage); - vTaskDelay(pdMS_TO_TICKS(1000)); + vTaskSuspendAll(); /* Force an assert. */ chipAbort(); }