From a5e694cd230f8f2d09918de30208717f6908b7d1 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Thu, 27 Apr 2023 01:30:10 -0400 Subject: [PATCH] Added build configuration flags (#26273) --- .../silabs/efr32/project_include/OpenThreadConfig.h | 9 ++++++--- src/platform/silabs/CHIPDevicePlatformConfig.h | 8 ++++++-- third_party/silabs/efr32_sdk.gni | 9 +++++++-- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h b/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h index c8f39692a69b0e..ea67df3ba27829 100644 --- a/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h +++ b/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h @@ -37,13 +37,16 @@ #define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 #if CHIP_DEVICE_CONFIG_ENABLE_SED + #define OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE 0 + // In seconds -#define SL_MLE_TIMEOUT_seconds (SL_SLEEP_TIME_MS / 1000) +#define SL_MLE_TIMEOUT_s (SL_OT_IDLE_INTERVAL / 1000) // Timeout after 2 missed checkin or 4 mins if sleep interval is too short. -#define OPENTHREAD_CONFIG_MLE_CHILD_TIMEOUT_DEFAULT ((SL_MLE_TIMEOUT_seconds < 120) ? 240 : ((SL_MLE_TIMEOUT_seconds * 2) + 1)) -#endif +#define OPENTHREAD_CONFIG_MLE_CHILD_TIMEOUT_DEFAULT ((SL_MLE_TIMEOUT_s < 120) ? 240 : ((SL_MLE_TIMEOUT_s * 2) + 1)) + +#endif // CHIP_DEVICE_CONFIG_ENABLE_SED /****Uncomment below section for OpenThread Debug logs*/ // #define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG diff --git a/src/platform/silabs/CHIPDevicePlatformConfig.h b/src/platform/silabs/CHIPDevicePlatformConfig.h index 45f9c83ace6272..fb749556e19b2c 100644 --- a/src/platform/silabs/CHIPDevicePlatformConfig.h +++ b/src/platform/silabs/CHIPDevicePlatformConfig.h @@ -117,13 +117,17 @@ #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) +#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL chip::System::Clock::Milliseconds32(SL_OT_IDLE_INTERVAL) #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) +#define CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL chip::System::Clock::Milliseconds32(SL_OT_ACTIVE_INTERVAL) #endif // CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL +#ifndef CHIP_DEVICE_CONFIG_SED_ACTIVE_THRESHOLD +#define CHIP_DEVICE_CONFIG_SED_ACTIVE_THRESHOLD chip::System::Clock::Milliseconds32(SL_ACTIVE_MODE_THRESHOLD) +#endif // CHIP_DEVICE_CONFIG_SED_ACTIVE_THRESHOLD + #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 f84e257af916f5..5e6905ebb83e7c 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -45,7 +45,10 @@ declare_args() { # Enable Segger System View use_system_view = false - sleep_time_ms = 30000 # 30 seconds sleep + # ICD Configuration flags + sl_ot_idle_interval_ms = 30000 # 30s Idle Intervals + sl_ot_active_interval_ms = 200 # 500ms Active Intervals + sl_active_mode_threshold = 1000 # 1s Active mode threshold silabs_log_enabled = true @@ -337,7 +340,9 @@ 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}", + "SL_OT_IDLE_INTERVAL=${sl_ot_idle_interval_ms}", + "SL_OT_ACTIVE_INTERVAL=${sl_ot_active_interval_ms}", + "SL_ACTIVE_MODE_THRESHOLD=${sl_active_mode_threshold}", ] if (defined(invoker.chip_enable_wifi) && invoker.chip_enable_wifi) {