From 2d55b46725e65ef8087aad491f9ecff94f8866ca Mon Sep 17 00:00:00 2001 From: Junior Martinez Date: Fri, 2 Sep 2022 20:19:32 +0000 Subject: [PATCH] Pull request #65: RC3 cherrypicks + point to matter_support/workswith Merge in WMN_TOOLS/matter from rc3_cherrypicks to RC_0.3.0 Squashed commit of the following: commit bbfbb9c82faae045a2f47453f9e589065ea50edd Author: Junior Martinez Date: Fri Sep 2 13:24:15 2022 -0400 re-enable BRD4162A for wifi builds as it is support with the workswith branch of matter_support commit 1509b4aa5f9ebaf6c6f727a893160dd086893912 Author: Junior Martinez Date: Fri Sep 2 13:22:21 2022 -0400 Change matter_support submodule to point to the workswith branch commit 46c630d083cf305e1f33351180449ea500ac8690 Author: jmartinez-silabs <67972863+jmartinez-silabs@users.noreply.github.com> Date: Wed Aug 31 00:24:32 2022 -0400 Add openthread lib with coap api enabled (#22276) commit 0e3839fdc48e7373000705f8bea1a993dd27b5a4 Author: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Thu Sep 1 17:42:34 2022 -0400 Fix wf200 openthread include (#22347) commit 439b376dba33d43ca213434f5d0473ebe2c1d3bb Author: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Thu Sep 1 16:26:49 2022 -0400 Fix thermostat build (#22346) --- examples/chef/efr32/BUILD.gn | 4 +++- examples/light-switch-app/efr32/BUILD.gn | 4 +++- examples/lighting-app/efr32/BUILD.gn | 4 +++- examples/lock-app/efr32/BUILD.gn | 4 +++- examples/platform/efr32/BaseApplication.cpp | 2 +- examples/shell/efr32/BUILD.gn | 3 ++- examples/thermostat/efr32/BUILD.gn | 4 +++- examples/thermostat/efr32/args.gni | 3 +++ examples/thermostat/efr32/src/AppTask.cpp | 4 ++++ examples/window-app/efr32/BUILD.gn | 3 ++- scripts/examples/gn_efr32_example.sh | 4 ++++ third_party/openthread/ot-efr32 | 2 +- third_party/silabs/BUILD.gn | 11 +++++++++-- third_party/silabs/efr32_sdk.gni | 2 ++ third_party/silabs/matter_support | 2 +- 15 files changed, 44 insertions(+), 12 deletions(-) diff --git a/examples/chef/efr32/BUILD.gn b/examples/chef/efr32/BUILD.gn index 3d1bf35352fa93..55abfcac3d219e 100644 --- a/examples/chef/efr32/BUILD.gn +++ b/examples/chef/efr32/BUILD.gn @@ -82,6 +82,7 @@ assert(!(use_rs911x && chip_enable_openthread)) assert(!(use_wf200 && chip_enable_openthread)) if (chip_enable_wifi) { assert(use_rs911x || use_wf200) + enable_openthread_cli = false } chip_data_model("chef-common") { @@ -192,7 +193,8 @@ efr32_executable("chef_app") { "src/main.cpp", ] - if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) { + if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli || + use_wf200) { sources += [ "${examples_plat_dir}/uart.cpp" ] } diff --git a/examples/light-switch-app/efr32/BUILD.gn b/examples/light-switch-app/efr32/BUILD.gn index 4b6c15741224d0..07bcfe6c204e7f 100644 --- a/examples/light-switch-app/efr32/BUILD.gn +++ b/examples/light-switch-app/efr32/BUILD.gn @@ -82,6 +82,7 @@ assert(!(use_rs911x && chip_enable_openthread)) assert(!(use_wf200 && chip_enable_openthread)) if (chip_enable_wifi) { assert(use_rs911x || use_wf200) + enable_openthread_cli = false } # ThunderBoards and Explorer Kit (No LCD) @@ -185,7 +186,8 @@ efr32_executable("light_switch_app") { "src/main.cpp", ] - if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) { + if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli || + use_wf200) { sources += [ "${examples_plat_dir}/uart.cpp" ] } diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index 6301fede13a30a..4db2f6a8f1afeb 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -82,6 +82,7 @@ assert(!(use_rs911x && chip_enable_openthread)) assert(!(use_wf200 && chip_enable_openthread)) if (chip_enable_wifi) { assert(use_rs911x || use_wf200) + enable_openthread_cli = false } # ThunderBoards and Explorer Kit (No LCD) @@ -190,7 +191,8 @@ efr32_executable("lighting_app") { "src/main.cpp", ] - if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) { + if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli || + use_wf200) { sources += [ "${examples_plat_dir}/uart.cpp" ] } diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index d757da6c50c4ff..52862d739841f1 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -82,6 +82,7 @@ assert(!(use_rs911x && chip_enable_openthread)) assert(!(use_wf200 && chip_enable_openthread)) if (chip_enable_wifi) { assert(use_rs911x || use_wf200) + enable_openthread_cli = false } # ThunderBoards and Explorer Kit (No LCD) @@ -184,7 +185,8 @@ efr32_executable("lock_app") { "src/main.cpp", ] - if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) { + if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli || + use_wf200) { sources += [ "${examples_plat_dir}/uart.cpp" ] } diff --git a/examples/platform/efr32/BaseApplication.cpp b/examples/platform/efr32/BaseApplication.cpp index a158c9a687fa99..2970f3c1a29fd0 100644 --- a/examples/platform/efr32/BaseApplication.cpp +++ b/examples/platform/efr32/BaseApplication.cpp @@ -156,7 +156,7 @@ CHIP_ERROR BaseApplication::Init(Identify * identifyObj) if (identifyObj == nullptr) { - EFR32_LOG("funct timer create failed"); + EFR32_LOG("Invalid Identify Object!"); appError(CHIP_ERROR_INVALID_ARGUMENT); } diff --git a/examples/shell/efr32/BUILD.gn b/examples/shell/efr32/BUILD.gn index b6a3d609b01af8..842504ae7dd0b0 100644 --- a/examples/shell/efr32/BUILD.gn +++ b/examples/shell/efr32/BUILD.gn @@ -61,7 +61,8 @@ efr32_executable("shell_app") { "src/main.cpp", ] - if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) { + if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli || + use_wf200) { sources += [ "${examples_plat_dir}/uart.cpp" ] } diff --git a/examples/thermostat/efr32/BUILD.gn b/examples/thermostat/efr32/BUILD.gn index bb4e2cb7a17e61..2146ef417a0831 100644 --- a/examples/thermostat/efr32/BUILD.gn +++ b/examples/thermostat/efr32/BUILD.gn @@ -79,6 +79,7 @@ assert(!(use_rs911x && chip_enable_openthread)) assert(!(use_wf200 && chip_enable_openthread)) if (chip_enable_wifi) { assert(use_rs911x || use_wf200) + enable_openthread_cli = false } # ThunderBoards and Explorer Kit (No LCD) @@ -181,7 +182,8 @@ efr32_executable("thermostat_app") { "src/main.cpp", ] - if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) { + if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli || + use_wf200) { sources += [ "${examples_plat_dir}/uart.cpp" ] } diff --git a/examples/thermostat/efr32/args.gni b/examples/thermostat/efr32/args.gni index 7df1c5e400f56f..1e5ed4ca14102c 100644 --- a/examples/thermostat/efr32/args.gni +++ b/examples/thermostat/efr32/args.gni @@ -24,3 +24,6 @@ pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log:check_backend" chip_enable_openthread = true pw_rpc_CONFIG = "$dir_pw_rpc:disable_global_mutex" + +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" diff --git a/examples/thermostat/efr32/src/AppTask.cpp b/examples/thermostat/efr32/src/AppTask.cpp index 69a59750ec61fd..793e79f3ab8145 100644 --- a/examples/thermostat/efr32/src/AppTask.cpp +++ b/examples/thermostat/efr32/src/AppTask.cpp @@ -140,6 +140,10 @@ CHIP_ERROR AppTask::Init() { CHIP_ERROR err = CHIP_NO_ERROR; +#ifdef DISPLAY_ENABLED + GetLCD().Init((uint8_t *) "Thermostat-App"); +#endif + err = BaseApplication::Init(&gIdentify); if (err != CHIP_NO_ERROR) { diff --git a/examples/window-app/efr32/BUILD.gn b/examples/window-app/efr32/BUILD.gn index ed8f4b506316e1..08dabc3593696e 100644 --- a/examples/window-app/efr32/BUILD.gn +++ b/examples/window-app/efr32/BUILD.gn @@ -75,6 +75,7 @@ assert(!(use_rs911x && chip_enable_openthread)) assert(!(use_wf200 && chip_enable_openthread)) if (chip_enable_wifi) { assert(use_rs911x || use_wf200) + enable_openthread_cli = false } # ThunderBoards and Explorer Kit (No LCD) @@ -178,7 +179,7 @@ efr32_executable("window_app") { "src/main.cpp", ] - if (chip_build_libshell || enable_openthread_cli || enable_openthread_cli) { + if (chip_build_libshell || enable_openthread_cli || use_wf200) { sources += [ "${examples_plat_dir}/uart.cpp" ] } diff --git a/scripts/examples/gn_efr32_example.sh b/scripts/examples/gn_efr32_example.sh index 5b47c945c771a8..2169332984236d 100755 --- a/scripts/examples/gn_efr32_example.sh +++ b/scripts/examples/gn_efr32_example.sh @@ -156,6 +156,10 @@ else optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" " shift ;; + --use_ot_coap_lib) + optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" use_thread_coap_lib=true " + shift + ;; *) if [ "$1" =~ *"use_rs911x=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then USE_WIFI=true diff --git a/third_party/openthread/ot-efr32 b/third_party/openthread/ot-efr32 index 1e10a32228c96f..038475dcc21c51 160000 --- a/third_party/openthread/ot-efr32 +++ b/third_party/openthread/ot-efr32 @@ -1 +1 @@ -Subproject commit 1e10a32228c96f273603612ef7d5ce693ecdf887 +Subproject commit 038475dcc21c51448d35309496a2f7401eb2ccfe diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index 7e885642cdd6f2..552fbe923e352f 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -23,6 +23,7 @@ declare_args() { efr32_sdk_target = "" sl_ot_efr32_root = "${chip_root}/third_party/openthread/ot-efr32" sl_openthread_root = "${chip_root}/third_party/openthread/ot-efr32/openthread" + use_thread_coap_lib = false } assert(efr32_sdk_target != "", "efr32_sdk_target must be specified") @@ -131,7 +132,7 @@ if (use_silabs_thread_lib) { ":libopenthread-platform", ":openthread_core_config_efr32", "${segger_rtt_root}:segger_rtt", - "${sl_openthread_root}/include/openthread:openthread-platform", + "${sl_openthread_root}/include/openthread:openthread", "${sl_openthread_root}/src/core/:libopenthread_core_headers", ] @@ -143,10 +144,16 @@ if (use_silabs_thread_lib) { XTD = "mtd" } + # Use silabs openthread library stack with or without coap api enabled + COAP_API = "" + if (use_thread_coap_lib) { + COAP_API = "coap_" + } + public_configs += [ "${sl_openthread_root}:openthread_${XTD}_config" ] libs = [ - "${sl_ot_efr32_root}/libs/libsl_ot_stack_${XTD}_${efr32_family}_gcc.a", + "${sl_ot_efr32_root}/libs/libsl_ot_stack_${XTD}_${COAP_API}${efr32_family}_gcc.a", "${sl_ot_efr32_root}/libs/libsl_platform_${XTD}_dmp_${efr32_family}_gcc.a", ] } diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 93354bcc5594e6..c9742f1f9d7f72 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -208,6 +208,7 @@ template("efr32_sdk") { # USART include files if ((defined(invoker.chip_enable_pw_rpc) && invoker.chip_enable_pw_rpc) || chip_build_libshell || enable_openthread_cli || + (defined(invoker.use_wf200) && invoker.use_wf200) || (defined(invoker.show_qr_code) && invoker.show_qr_code) || (defined(invoker.disable_lcd) && !invoker.disable_lcd) || (defined(invoker.use_external_flash) && use_external_flash)) { @@ -532,6 +533,7 @@ template("efr32_sdk") { # USART sources files if ((defined(invoker.chip_enable_pw_rpc) && invoker.chip_enable_pw_rpc) || chip_build_libshell || enable_openthread_cli || + (defined(invoker.use_wf200) && invoker.use_wf200) || (defined(invoker.show_qr_code) && invoker.show_qr_code) || (defined(invoker.disable_lcd) && !invoker.disable_lcd) || (defined(invoker.use_external_flash) && use_external_flash)) { diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index 2425fb72cacd54..16560fa69f3883 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 2425fb72cacd540df505f11e7de81e6270ed1c40 +Subproject commit 16560fa69f3883dff8d6ae7b762b99c5b60ce39b