From 1583824e86170fed0af815be443edb2af7f5b1d5 Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Tue, 29 Nov 2022 08:29:41 +0100 Subject: [PATCH] Update default sleeping time (#23783) --- .../efr32/project_include/OpenThreadConfig.h | 25 +++++++++++++++++++ .../silabs/CHIPDevicePlatformConfig.h | 8 ++++++ third_party/silabs/efr32_sdk.gni | 3 +++ 3 files changed, 36 insertions(+) diff --git a/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h b/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h index dccf3c816b7b66..76842d5783dbc1 100644 --- a/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h +++ b/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h @@ -36,6 +36,31 @@ // Enable use of external heap allocator (calloc/free) for OpenThread. #define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 +#if CHIP_DEVICE_CONFIG_ENABLE_SED +#define OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE 0 +// In seconds +#define OPENTHREAD_CONFIG_MLE_CHILD_TIMEOUT_DEFAULT (SL_SLEEP_TIME_MS / 1000) +#endif + +/****Uncomment below section for OpenThread Debug logs*/ +// #define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG + +// #ifndef OPENTHREAD_CONFIG_LOG_CLI +// #define OPENTHREAD_CONFIG_LOG_CLI 1 +// #endif + +// #ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +// #define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +// #endif + +// #ifndef OPENTHREAD_CONFIG_LOG_PLATFORM +// #define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +// #endif + +// #ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL +// #define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +// #endif + // EFR32MG21A020F1024IM32 has 96k of RAM. Reduce the number of buffers to // conserve RAM for this Series 2 part. #if defined(EFR32MG21) diff --git a/src/platform/silabs/CHIPDevicePlatformConfig.h b/src/platform/silabs/CHIPDevicePlatformConfig.h index b2f46f2dbc40c5..4852dc97c63cb6 100644 --- a/src/platform/silabs/CHIPDevicePlatformConfig.h +++ b/src/platform/silabs/CHIPDevicePlatformConfig.h @@ -81,6 +81,14 @@ #define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE (6 * 1024) #endif // CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE +#ifndef CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL +#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL chip::System::Clock::Milliseconds32(SL_SLEEP_TIME_MS) +#endif // CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL + +#ifndef CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL +#define CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL chip::System::Clock::Milliseconds32(200) +#endif // CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL + #ifndef CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE #if defined(EFR32MG21) #define CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE (2 * 1024) diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 39d6e5d7161ce4..c6aa9d95a4fdb0 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -38,6 +38,8 @@ declare_args() { # Enable Segger System View use_system_view = false + + sleep_time_ms = 3300000 # 55 mins sleep } # Explorer Kit and MGM240L do not have external flash @@ -223,6 +225,7 @@ template("efr32_sdk") { "CHIP_DEVICE_CONFIG_ENABLE_SED=1", "SL_CATALOG_POWER_MANAGER_PRESENT", "SL_CATALOG_SLEEPTIMER_PRESENT", + "SL_SLEEP_TIME_MS=${sleep_time_ms}", ] } }