From 0153494eecb890f0e1ec97c19ab944b1ca7ae523 Mon Sep 17 00:00:00 2001 From: Tan Yan Quan Date: Thu, 23 Oct 2025 11:56:34 +0800 Subject: [PATCH] feat(openthread): add kconfig option for timing optimization --- components/openthread/Kconfig | 8 ++++++++ components/openthread/linker.lf | 10 ++++++---- examples/openthread/ot_rcp/sdkconfig.defaults | 2 ++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/components/openthread/Kconfig b/components/openthread/Kconfig index 99ed9fd364..b113cfd1f4 100644 --- a/components/openthread/Kconfig +++ b/components/openthread/Kconfig @@ -307,10 +307,17 @@ menu "OpenThread" Set the DNS server IPv4 address. endmenu + config OPENTHREAD_TIMING_OPTIMIZATION + bool "Enable timing optimization" + default n + help + Select this option to enable timing optimization for link metrics / CSL features. + config OPENTHREAD_LINK_METRICS bool "Enable link metrics feature" default n select IEEE802154_TIMING_OPTIMIZATION if IEEE802154_ENABLED + select OPENTHREAD_TIMING_OPTIMIZATION help Select this option to enable link metrics feature @@ -331,6 +338,7 @@ menu "OpenThread" bool "Enable CSL feature" default n select IEEE802154_TIMING_OPTIMIZATION if IEEE802154_ENABLED + select OPENTHREAD_TIMING_OPTIMIZATION help Select this option to enable CSL feature menu "CSL Configurations" diff --git a/components/openthread/linker.lf b/components/openthread/linker.lf index ffadcdff91..58c830c8e7 100644 --- a/components/openthread/linker.lf +++ b/components/openthread/linker.lf @@ -1,15 +1,17 @@ [mapping:openthread] archive: libopenthread.a entries: - if OPENTHREAD_CSL_ENABLE = y || OPENTHREAD_LINK_METRICS = y: - csl_tx_scheduler (noflash) + if OPENTHREAD_TIMING_OPTIMIZATION = y: link_metrics (noflash) link_quality (noflash) - mac (noflash) mac_frame (noflash) - mesh_forwarder (noflash) radio (noflash) sub_mac (noflash) + if OPENTHREAD_TIMING_OPTIMIZATION = y && OPENTHREAD_RADIO = n: + mesh_forwarder (noflash) + csl_tx_scheduler (noflash) + mac (noflash) + if OPENTHREAD_RCP_SPI = y: ncp_spi (noflash) diff --git a/examples/openthread/ot_rcp/sdkconfig.defaults b/examples/openthread/ot_rcp/sdkconfig.defaults index 7a4583d972..0419e6a33c 100644 --- a/examples/openthread/ot_rcp/sdkconfig.defaults +++ b/examples/openthread/ot_rcp/sdkconfig.defaults @@ -50,3 +50,5 @@ CONFIG_LOG_DEFAULT_LEVEL_NONE=y CONFIG_LIBC_NEWLIB_NANO_FORMAT=y CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n CONFIG_OPENTHREAD_LOG_LEVEL_NONE=y +CONFIG_OPENTHREAD_TIMING_OPTIMIZATION=y +CONFIG_FREERTOS_HZ=1000