Skip to content

Commit b43b592

Browse files
fix linking issue with thread coap lib
1 parent f164614 commit b43b592

File tree

3 files changed

+31
-13
lines changed

3 files changed

+31
-13
lines changed

examples/platform/silabs/efr32/project_include/OpenThreadConfig.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
// Timeout after 2 missed checkin or 4 mins if sleep interval is too short.
4646
#define OPENTHREAD_CONFIG_MLE_CHILD_TIMEOUT_DEFAULT ((SL_MLE_TIMEOUT_s < 120) ? 240 : ((SL_MLE_TIMEOUT_s * 2) + 1))
4747

48-
#if defined(SL_CSL_ENABLE) && SL_CSL_ENABLE
48+
#if defined(SL_CSL_ENABLE) && SL_CSL_ENABLE || SL_CONFIG_OPENTHREAD_LIB
4949

5050
#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1
5151
#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1
@@ -55,7 +55,7 @@
5555
#define OPENTHREAD_CONFIG_CSL_TIMEOUT SL_CSL_TIMEOUT
5656
#define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 200
5757

58-
#endif // SL_CSL_ENABLE
58+
#endif // SL_CSL_ENABLE || SL_CONFIG_OPENTHREAD_LIB
5959

6060
#endif // SL_ICD_ENABLED
6161

third_party/silabs/BUILD.gn

+13-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ if (wifi_soc != true) { # CCP board
6666
if (use_silabs_thread_lib) {
6767
config("libopenthread-platform_config") {
6868
include_dirs = [ "${openthread_root}/examples/platforms" ]
69-
70-
defines = [ "SL_CONFIG_OPENTHREAD_LIB=1" ]
7169
}
7270

7371
copy("copy_openthread_system") {
@@ -204,6 +202,19 @@ if (wifi_soc != true) { # CCP board
204202
COAP_API = ""
205203
if (use_thread_coap_lib) {
206204
COAP_API = "coap_"
205+
206+
sources += [
207+
"${openthread_root}/examples/platforms/utils/link_metrics.cpp",
208+
"${openthread_root}/examples/platforms/utils/link_metrics.h",
209+
"${openthread_root}/src/core/api/link_api.cpp",
210+
"${openthread_root}/src/core/mac/mac.cpp",
211+
"${openthread_root}/src/core/mac/mac_frame.cpp",
212+
"${openthread_root}/src/core/mac/sub_mac.cpp",
213+
"${openthread_root}/src/core/thread/mle.cpp",
214+
"${sl_ot_platform_abstraction}/efr32/radio.c",
215+
]
216+
217+
include_dirs = [ "${sl_ot_platform_abstraction}/include" ]
207218
}
208219

209220
public_configs += [ "${openthread_root}:openthread_${XTD}_config" ]

third_party/silabs/efr32_sdk.gni

+16-9
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ declare_args() {
6565

6666
silabs_log_enabled = true
6767

68+
# Enable Synchronized Sleepy End Device
69+
enable_synchronized_sed = false
70+
6871
# Argument to enable IPv4 for wifi
6972
# aligning to match chip_inet_config_enable_ipv4 default configuration
7073
chip_enable_wifi_ipv4 = false
@@ -96,9 +99,6 @@ declare_args() {
9699
sl_ot_platform_abstraction =
97100
"${efr32_sdk_root}/protocol/openthread/platform-abstraction"
98101

99-
# Enable Synchronized Sleepy End Device
100-
enable_synchronized_sed = use_silabs_thread_lib
101-
102102
# board related pre-generated files path (default)
103103
sl_pre_gen_path =
104104
"${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/"
@@ -317,6 +317,7 @@ template("efr32_sdk") {
317317
"SL_MATTER_BLE_EXTENDED_ADV=${sl_matter_ble_extended_adv}",
318318
"SL_MEMORY_POOL_LIGHT=1",
319319
"SL_OPENTHREAD_STACK_FEATURES_CONFIG_FILE=\"sl_openthread_features_config.h\"",
320+
"SL_CSL_TIMEOUT=${sl_ot_csl_timeout_sec}",
320321
"CIRCULAR_QUEUE_USE_LOCAL_CONFIG_HEADER=1",
321322
"MATTER_INTEGRATION=1",
322323
]
@@ -327,18 +328,25 @@ template("efr32_sdk") {
327328
defines += [ "SILABS_LOG_ENABLED=0" ]
328329
}
329330

330-
# Temporary configuration to enable COAP specific configurations
331-
if (use_thread_coap_lib) {
332-
defines += [ "SL_USE_COAP_CONFIG=1" ]
333-
}
334-
335331
if (sl_uart_log_output) {
336332
defines += [
337333
"SILABS_LOG_OUT_UART=1",
338334
"SILABS_LOG_OUT_RTT=0",
339335
]
340336
}
341337

338+
if (use_silabs_thread_lib) {
339+
defines += [ "SL_CONFIG_OPENTHREAD_LIB=1" ]
340+
} else {
341+
defines += [ "SL_CONFIG_OPENTHREAD_LIB=0" ]
342+
}
343+
344+
if (use_thread_coap_lib) {
345+
defines += [ "SL_USE_COAP_CONFIG=1" ]
346+
} else {
347+
defines += [ "SL_USE_COAP_CONFIG=0" ]
348+
}
349+
342350
if (chip_enable_ble_rs911x) {
343351
defines += [
344352
"RSI_BLE_ENABLE=1",
@@ -462,7 +470,6 @@ template("efr32_sdk") {
462470
defines += [
463471
"CHIP_DEVICE_CONFIG_THREAD_SSED=1",
464472
"SL_CSL_ENABLE=1",
465-
"SL_CSL_TIMEOUT=${sl_ot_csl_timeout_sec}",
466473
]
467474
}
468475
}

0 commit comments

Comments
 (0)