From 1302ce089778111d5c572e4a0f1a58fde1c826d2 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Wed, 16 Mar 2022 13:04:12 -0400 Subject: [PATCH] [EFR32] fix sleepy devices for efr32 (#16196) * fix sleepy devices for efr32 * PR comments * restyles * update window cover --- examples/light-switch-app/efr32/BUILD.gn | 10 ++- examples/light-switch-app/efr32/src/main.cpp | 3 +- examples/lighting-app/efr32/BUILD.gn | 10 ++- examples/lighting-app/efr32/src/main.cpp | 3 +- examples/lock-app/efr32/BUILD.gn | 10 ++- examples/lock-app/efr32/src/main.cpp | 3 +- examples/ota-requestor-app/efr32/BUILD.gn | 10 ++- examples/shell/efr32/BUILD.gn | 5 +- examples/window-app/efr32/BUILD.gn | 10 ++- examples/window-app/efr32/src/main.cpp | 3 +- scripts/examples/gn_efr32_example.sh | 7 +- src/platform/EFR32/ThreadStackManagerImpl.cpp | 4 + src/test_driver/efr32/BUILD.gn | 5 +- third_party/efr32_sdk/efr32_sdk.gni | 87 ++++++++++++++----- third_party/efr32_sdk/repo | 2 +- 15 files changed, 128 insertions(+), 44 deletions(-) diff --git a/examples/light-switch-app/efr32/BUILD.gn b/examples/light-switch-app/efr32/BUILD.gn index 495edd87749b0f..412917bba38279 100644 --- a/examples/light-switch-app/efr32/BUILD.gn +++ b/examples/light-switch-app/efr32/BUILD.gn @@ -57,9 +57,10 @@ declare_args() { use_rs911x_sockets = false sl_wfx_config_softap = false sl_wfx_config_scan = true -} -show_qr_code = true + # Enables LCD Qr Code on supported devices + show_qr_code = true +} # BRD4166A --> ThunderBoard Sense 2 (No LCD) if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") { @@ -149,7 +150,6 @@ efr32_executable("light_switch_app") { "${examples_plat_dir}/LEDWidget.cpp", "${examples_plat_dir}/heap_4_silabs.c", "${examples_plat_dir}/init_efrPlatform.cpp", - "${examples_plat_dir}/uart.cpp", "src/AppTask.cpp", "src/LightingManager.cpp", "src/ZclCallbacks.cpp", @@ -157,6 +157,10 @@ efr32_executable("light_switch_app") { "src/main.cpp", ] + if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) { + sources += [ "${examples_plat_dir}/uart.cpp" ] + } + deps = [ ":sdk", "${chip_root}/examples/common/QRCode", diff --git a/examples/light-switch-app/efr32/src/main.cpp b/examples/light-switch-app/efr32/src/main.cpp index 0fd41ca3b1ad0b..7ca14521d301e5 100644 --- a/examples/light-switch-app/efr32/src/main.cpp +++ b/examples/light-switch-app/efr32/src/main.cpp @@ -155,8 +155,9 @@ int main(void) #else // CHIP_DEVICE_CONFIG_THREAD_FTD #if CHIP_DEVICE_CONFIG_ENABLE_SED ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice); -#endif // CHIP_DEVICE_CONFIG_ENABLE_SED +#else // CHIP_DEVICE_CONFIG_ENABLE_SED ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice); +#endif // CHIP_DEVICE_CONFIG_ENABLE_SED #endif // CHIP_DEVICE_CONFIG_THREAD_FTD if (ret != CHIP_NO_ERROR) { diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index 7f8f3bd1295f7d..ab64c2f757c2a4 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -57,9 +57,10 @@ declare_args() { use_rs911x_sockets = false sl_wfx_config_softap = false sl_wfx_config_scan = true -} -show_qr_code = true + # Enables LCD Qr Code on supported devices + show_qr_code = true +} # BRD4166A --> ThunderBoard Sense 2 (No LCD) if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") { @@ -148,13 +149,16 @@ efr32_executable("lighting_app") { "${examples_plat_dir}/LEDWidget.cpp", "${examples_plat_dir}/heap_4_silabs.c", "${examples_plat_dir}/init_efrPlatform.cpp", - "${examples_plat_dir}/uart.cpp", "src/AppTask.cpp", "src/LightingManager.cpp", "src/ZclCallbacks.cpp", "src/main.cpp", ] + if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) { + sources += [ "${examples_plat_dir}/uart.cpp" ] + } + deps = [ ":sdk", "${chip_root}/examples/common/QRCode", diff --git a/examples/lighting-app/efr32/src/main.cpp b/examples/lighting-app/efr32/src/main.cpp index da9282fa5bc574..e0f1a4bc26fc1c 100644 --- a/examples/lighting-app/efr32/src/main.cpp +++ b/examples/lighting-app/efr32/src/main.cpp @@ -159,8 +159,9 @@ int main(void) #else // CHIP_DEVICE_CONFIG_THREAD_FTD #if CHIP_DEVICE_CONFIG_ENABLE_SED ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice); -#endif // CHIP_DEVICE_CONFIG_ENABLE_SED +#else // CHIP_DEVICE_CONFIG_ENABLE_SED ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice); +#endif // CHIP_DEVICE_CONFIG_ENABLE_SED #endif // CHIP_DEVICE_CONFIG_THREAD_FTD if (ret != CHIP_NO_ERROR) { diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index b6db7044c681df..870737f8047f42 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -56,9 +56,10 @@ declare_args() { use_rs911x_sockets = false sl_wfx_config_softap = false sl_wfx_config_scan = true -} -show_qr_code = true + # Enables LCD Qr Code on supported devices + show_qr_code = true +} # BRD4166A --> ThunderBoard Sense 2 (No LCD) if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") { @@ -147,13 +148,16 @@ efr32_executable("lock_app") { "${examples_plat_dir}/LEDWidget.cpp", "${examples_plat_dir}/heap_4_silabs.c", "${examples_plat_dir}/init_efrPlatform.cpp", - "${examples_plat_dir}/uart.cpp", "src/AppTask.cpp", "src/BoltLockManager.cpp", "src/ZclCallbacks.cpp", "src/main.cpp", ] + if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) { + sources += [ "${examples_plat_dir}/uart.cpp" ] + } + deps = [ ":sdk", "${chip_root}/examples/common/QRCode", diff --git a/examples/lock-app/efr32/src/main.cpp b/examples/lock-app/efr32/src/main.cpp index f59e2640e6f9ea..2ed647b327aa72 100644 --- a/examples/lock-app/efr32/src/main.cpp +++ b/examples/lock-app/efr32/src/main.cpp @@ -155,8 +155,9 @@ int main(void) #else // CHIP_DEVICE_CONFIG_THREAD_FTD #if CHIP_DEVICE_CONFIG_ENABLE_SED ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice); -#endif // CHIP_DEVICE_CONFIG_ENABLE_SED +#else // CHIP_DEVICE_CONFIG_ENABLE_SED ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice); +#endif // CHIP_DEVICE_CONFIG_ENABLE_SED #endif // CHIP_DEVICE_CONFIG_THREAD_FTD if (ret != CHIP_NO_ERROR) { diff --git a/examples/ota-requestor-app/efr32/BUILD.gn b/examples/ota-requestor-app/efr32/BUILD.gn index 4804dcea5facb1..5a860287976351 100644 --- a/examples/ota-requestor-app/efr32/BUILD.gn +++ b/examples/ota-requestor-app/efr32/BUILD.gn @@ -44,9 +44,10 @@ declare_args() { # Monitor & log memory usage at runtime. enable_heap_monitoring = false -} -show_qr_code = true + # Enables LCD Qr Code on supported devices + show_qr_code = true +} # BRD4166A --> ThunderBoard Sense 2 (No LCD) if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") { @@ -89,13 +90,16 @@ efr32_executable("ota_requestor_app") { "${examples_plat_dir}/LEDWidget.cpp", "${examples_plat_dir}/heap_4_silabs.c", "${examples_plat_dir}/init_efrPlatform.cpp", - "${examples_plat_dir}/uart.cpp", "src/AppTask.cpp", "src/LightingManager.cpp", "src/ZclCallbacks.cpp", "src/main.cpp", ] + if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) { + sources += [ "${examples_plat_dir}/uart.cpp" ] + } + deps = [ ":sdk", "${chip_root}/examples/common/QRCode", diff --git a/examples/shell/efr32/BUILD.gn b/examples/shell/efr32/BUILD.gn index ea683bed9362cf..e01ce36bfecb77 100644 --- a/examples/shell/efr32/BUILD.gn +++ b/examples/shell/efr32/BUILD.gn @@ -58,10 +58,13 @@ efr32_executable("shell_app") { sources = [ "${examples_plat_dir}/heap_4_silabs.c", "${examples_plat_dir}/init_efrPlatform.cpp", - "${examples_plat_dir}/uart.cpp", "src/main.cpp", ] + if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) { + sources += [ "${examples_plat_dir}/uart.cpp" ] + } + deps = [ ":sdk", "${chip_root}/examples/shell/shell_common:shell_common", diff --git a/examples/window-app/efr32/BUILD.gn b/examples/window-app/efr32/BUILD.gn index 4cb40bbc93f1f5..6b1b894c73a0ba 100644 --- a/examples/window-app/efr32/BUILD.gn +++ b/examples/window-app/efr32/BUILD.gn @@ -50,9 +50,10 @@ declare_args() { use_rs911x_sockets = false sl_wfx_config_softap = false sl_wfx_config_scan = true -} -show_qr_code = true + # Enables LCD Qr Code on supported devices + show_qr_code = true +} # BRD4166A --> ThunderBoard Sense 2 (No LCD) if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") { @@ -137,13 +138,16 @@ efr32_executable("window_app") { "${examples_plat_dir}/LEDWidget.cpp", "${examples_plat_dir}/heap_4_silabs.c", "${examples_plat_dir}/init_efrPlatform.cpp", - "${examples_plat_dir}/uart.cpp", "${project_dir}/common/src/WindowApp.cpp", "${project_dir}/common/src/ZclCallbacks.cpp", "src/WindowAppImpl.cpp", "src/main.cpp", ] + if (chip_build_libshell || enable_openthread_cli) { + sources += [ "${examples_plat_dir}/uart.cpp" ] + } + if (chip_enable_ota_requestor) { defines += [ "EFR32_OTA_ENABLED" ] sources += [ "${examples_plat_dir}/OTAConfig.cpp" ] diff --git a/examples/window-app/efr32/src/main.cpp b/examples/window-app/efr32/src/main.cpp index c79ffddc1be254..cfffc9dc071d87 100644 --- a/examples/window-app/efr32/src/main.cpp +++ b/examples/window-app/efr32/src/main.cpp @@ -132,8 +132,9 @@ int main(void) #else // CHIP_DEVICE_CONFIG_THREAD_FTD #if CHIP_DEVICE_CONFIG_ENABLE_SED err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice); -#endif // CHIP_DEVICE_CONFIG_ENABLE_SED +#else // CHIP_DEVICE_CONFIG_ENABLE_SED err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice); +#endif // CHIP_DEVICE_CONFIG_ENABLE_SED #endif // CHIP_DEVICE_CONFIG_THREAD_FTD if (err != CHIP_NO_ERROR) { diff --git a/scripts/examples/gn_efr32_example.sh b/scripts/examples/gn_efr32_example.sh index 200176a22e4501..22913392fc8972 100755 --- a/scripts/examples/gn_efr32_example.sh +++ b/scripts/examples/gn_efr32_example.sh @@ -61,6 +61,10 @@ if [ "$#" == "0" ]; then Location for an alternate or modified efr32 SDK enable_heap_monitoring Monitor & log memory usage at runtime. (Default false) + enable_openthread_cli + Enables openthread cli without matter shell. (Default true) + show_qr_code + Enables QR code on LCD for devices with an LCD setupDiscriminator Discriminatoor value used for BLE connexion. (Default 3840) setupPinCode @@ -78,7 +82,8 @@ if [ "$#" == "0" ]; then Periodic query timeout variable for OTA in seconds Presets --sed - enable sleepy end device and set thread mtd + enable sleepy end device, set thread mtd + For minimum consumption, disable openthread cli and qr code --wifi build wifi example variant for given exansion board " diff --git a/src/platform/EFR32/ThreadStackManagerImpl.cpp b/src/platform/EFR32/ThreadStackManagerImpl.cpp index fbd89807260177..c8858467bcff77 100644 --- a/src/platform/EFR32/ThreadStackManagerImpl.cpp +++ b/src/platform/EFR32/ThreadStackManagerImpl.cpp @@ -125,6 +125,8 @@ extern "C" otError otPlatUartEnable(void) #endif } +#if CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI + extern "C" otError otPlatUartSend(const uint8_t * aBuf, uint16_t aBufLength) { #ifdef PW_RPC_ENABLED @@ -162,3 +164,5 @@ extern "C" __WEAK otError otPlatUartDisable(void) { return OT_ERROR_NOT_IMPLEMENTED; } + +#endif // CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI diff --git a/src/test_driver/efr32/BUILD.gn b/src/test_driver/efr32/BUILD.gn index 67bbf521466712..14d27ad9460808 100644 --- a/src/test_driver/efr32/BUILD.gn +++ b/src/test_driver/efr32/BUILD.gn @@ -73,10 +73,13 @@ efr32_executable("efr32_device_tests") { "${examples_plat_dir}/PigweedLogger.cpp", "${examples_plat_dir}/heap_4_silabs.c", "${examples_plat_dir}/init_efrPlatform.cpp", - "${examples_plat_dir}/uart.cpp", "src/main.cpp", ] + if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) { + sources += [ "${examples_plat_dir}/uart.cpp" ] + } + deps = [ ":nl_test_service.nanopb_rpc", ":sdk", diff --git a/third_party/efr32_sdk/efr32_sdk.gni b/third_party/efr32_sdk/efr32_sdk.gni index 81ca2ac8034cfd..92bb1d824e7796 100644 --- a/third_party/efr32_sdk/efr32_sdk.gni +++ b/third_party/efr32_sdk/efr32_sdk.gni @@ -23,6 +23,7 @@ import("efr32_board.gni") declare_args() { # Location of the efr32 SDK. efr32_sdk_root = "${chip_root}/third_party/efr32_sdk/repo" + enable_openthread_cli = true } assert(efr32_sdk_root != "", "efr32_sdk_root must be specified") @@ -71,8 +72,6 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/driver/leddrv/inc", "${efr32_sdk_root}/platform/emdrv/common/inc", "${efr32_sdk_root}/platform/emdrv/gpiointerrupt/inc", - "${efr32_sdk_root}/platform/emdrv/uartdrv/inc", - "${efr32_sdk_root}/platform/emdrv/uartdrv/config", "${efr32_sdk_root}/platform/emdrv/dmadrv/config", "${efr32_sdk_root}/platform/emdrv/dmadrv/inc", "${efr32_sdk_root}/platform/emdrv/nvm3/inc", @@ -140,7 +139,6 @@ template("efr32_sdk") { "${efr32_board}=1", "SL_SUPRESS_DEPRECATION_WARNINGS_SDK_3_1", "CHIP_KVS_BASE_SECTOR_INDEX=((FLASH_SIZE/FLASH_PAGE_SIZE)-(CHIP_KVS_SECTOR_COUNT))", - "CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI=1", "__HEAP_SIZE=0", "SL_CATALOG_FREERTOS_KERNEL_PRESENT=1", "MBEDTLS_THREADING_C=1", @@ -162,17 +160,49 @@ template("efr32_sdk") { } } - if (chip_build_libshell) { + if (chip_build_libshell) { # matter shell defines += [ "ENABLE_CHIP_SHELL", "OPENTHREAD_CONFIG_CLI_TRANSPORT=OT_CLI_TRANSPORT_CONSOLE", + "CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI=1", ] + } else { + if (enable_openthread_cli) { # ot-cli only + defines += [ "CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI=1" ] + } + } + + # USART include files + if ((defined(invoker.chip_enable_pw_rpc) && invoker.chip_enable_pw_rpc) || + chip_build_libshell || enable_openthread_cli || + (defined(invoker.show_qr_code) && invoker.show_qr_code)) { + defines += [ "CONFIG_ENABLE_UART" ] + + _include_dirs += [ + "${efr32_sdk_root}/platform/emdrv/uartdrv/inc", + "${efr32_sdk_root}/platform/emdrv/uartdrv/config", + ] + + if (efr32_family == "efr32mg12") { + _include_dirs += [ + "${efr32_sdk_root}/hardware/driver/memlcd/inc/memlcd_usart", + "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/inc/sl_mx25_flash_shutdown_usart", + ] + } else if (efr32_family == "efr32mg21") { + _include_dirs += [ + "${efr32_sdk_root}/hardware/driver/memlcd/inc/memlcd_usart", + "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/inc/sl_mx25_flash_shutdown_usart", + ] + } else if (efr32_family == "efr32mg24") { + _include_dirs += [ + "${efr32_sdk_root}/hardware/driver/memlcd/inc/memlcd_eusart", + "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/inc/sl_mx25_flash_shutdown_eusart", + ] + } } if (efr32_family == "efr32mg12") { _include_dirs += [ - "${efr32_sdk_root}/hardware/driver/memlcd/inc/memlcd_usart", - "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/inc/sl_mx25_flash_shutdown_usart", "${efr32_sdk_root}/hardware/kit/EFR32MG12_${efr32_board}/config", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Include", "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg1x", @@ -193,8 +223,6 @@ template("efr32_sdk") { ] } else if (efr32_family == "efr32mg21") { _include_dirs += [ - "${efr32_sdk_root}/hardware/driver/memlcd/inc/memlcd_usart", - "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/inc/sl_mx25_flash_shutdown_usart", "${efr32_sdk_root}/hardware/kit/EFR32MG21_${efr32_board}/config", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG21/Include", "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg2x", @@ -217,8 +245,6 @@ template("efr32_sdk") { ] } else if (efr32_family == "efr32mg24") { _include_dirs += [ - "${efr32_sdk_root}/hardware/driver/memlcd/inc/memlcd_eusart", - "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/inc/sl_mx25_flash_shutdown_eusart", "${efr32_sdk_root}/hardware/kit/EFR32MG24_${efr32_board}/config", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG24/Include", "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg2x", @@ -275,7 +301,6 @@ template("efr32_sdk") { "${efr32_sdk_root}/matter/efr32/sl_event_handler.c", "${efr32_sdk_root}/matter/efr32/sl_simple_button_instances.c", "${efr32_sdk_root}/matter/efr32/sl_simple_led_instances.c", - "${efr32_sdk_root}/matter/efr32/sl_uartdrv_init.c", "${efr32_sdk_root}/platform/CMSIS/RTOS2/Source/os_systick.c", "${efr32_sdk_root}/platform/bootloader/plugin/security/sha/crypto_sha.c", "${efr32_sdk_root}/platform/common/src/sl_slist.c", @@ -288,16 +313,13 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/emdrv/nvm3/src/nvm3_default.c", "${efr32_sdk_root}/platform/emdrv/nvm3/src/nvm3_hal_flash.c", "${efr32_sdk_root}/platform/emdrv/nvm3/src/nvm3_lock.c", - "${efr32_sdk_root}/platform/emdrv/uartdrv/src/uartdrv.c", "${efr32_sdk_root}/platform/emlib/src/em_adc.c", "${efr32_sdk_root}/platform/emlib/src/em_cmu.c", "${efr32_sdk_root}/platform/emlib/src/em_core.c", "${efr32_sdk_root}/platform/emlib/src/em_crypto.c", "${efr32_sdk_root}/platform/emlib/src/em_emu.c", - "${efr32_sdk_root}/platform/emlib/src/em_eusart.c", "${efr32_sdk_root}/platform/emlib/src/em_gpio.c", "${efr32_sdk_root}/platform/emlib/src/em_ldma.c", - "${efr32_sdk_root}/platform/emlib/src/em_leuart.c", "${efr32_sdk_root}/platform/emlib/src/em_msc.c", "${efr32_sdk_root}/platform/emlib/src/em_prs.c", "${efr32_sdk_root}/platform/emlib/src/em_rmu.c", @@ -305,7 +327,6 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/emlib/src/em_se.c", "${efr32_sdk_root}/platform/emlib/src/em_system.c", "${efr32_sdk_root}/platform/emlib/src/em_timer.c", - "${efr32_sdk_root}/platform/emlib/src/em_usart.c", "${efr32_sdk_root}/platform/peripheral/src/peripheral_sysrtc.c", "${efr32_sdk_root}/platform/radio/rail_lib/hal/efr32/hal_efr.c", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/pa_conversions_efr32.c", @@ -454,6 +475,36 @@ 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.show_qr_code) && invoker.show_qr_code)) { + sources += [ + "${efr32_sdk_root}/matter/efr32/sl_uartdrv_init.c", + "${efr32_sdk_root}/platform/emdrv/uartdrv/src/uartdrv.c", + "${efr32_sdk_root}/platform/emlib/src/em_eusart.c", + "${efr32_sdk_root}/platform/emlib/src/em_leuart.c", + "${efr32_sdk_root}/platform/emlib/src/em_usart.c", + ] + + if (efr32_family == "efr32mg12") { + sources += [ + "${efr32_sdk_root}/hardware/driver/memlcd/src/memlcd_usart/sl_memlcd_spi.c", + "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/src/sl_mx25_flash_shutdown_usart/sl_mx25_flash_shutdown.c", + ] + } else if (efr32_family == "efr32mg21") { + sources += [ + "${efr32_sdk_root}/hardware/driver/memlcd/src/memlcd_usart/sl_memlcd_spi.c", + "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/src/sl_mx25_flash_shutdown_usart/sl_mx25_flash_shutdown.c", + ] + } else if (efr32_family == "efr32mg24") { + sources += [ + "${efr32_sdk_root}/hardware/driver/memlcd/src/memlcd_eusart/sl_memlcd_spi.c", + "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/src/sl_mx25_flash_shutdown_eusart/sl_mx25_flash_shutdown.c", + ] + } + } + if (defined(invoker.show_qr_code)) { if (invoker.show_qr_code) { sources += [ @@ -485,8 +536,6 @@ template("efr32_sdk") { if (efr32_family == "efr32mg12") { sources += [ - "${efr32_sdk_root}/hardware/driver/memlcd/src/memlcd_usart/sl_memlcd_spi.c", - "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/src/sl_mx25_flash_shutdown_usart/sl_mx25_flash_shutdown.c", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Source/GCC/startup_efr32mg12p.c", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Source/system_efr32mg12p.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dcdc_s1.c", @@ -497,8 +546,6 @@ template("efr32_sdk") { ] } else if (efr32_family == "efr32mg21") { sources += [ - "${efr32_sdk_root}/hardware/driver/memlcd/src/memlcd_usart/sl_memlcd_spi.c", - "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/src/sl_mx25_flash_shutdown_usart/sl_mx25_flash_shutdown.c", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG21/Source/GCC/startup_efr32mg21.c", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG21/Source/system_efr32mg21.c", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_rf_path/sl_rail_util_rf_path.c", @@ -539,8 +586,6 @@ template("efr32_sdk") { ] } else if (efr32_family == "efr32mg24") { sources += [ - "${efr32_sdk_root}/hardware/driver/memlcd/src/memlcd_eusart/sl_memlcd_spi.c", - "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/src/sl_mx25_flash_shutdown_eusart/sl_mx25_flash_shutdown.c", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG24/Source/GCC/startup_efr32mg24.c", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG24/Source/system_efr32mg24.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dcdc_s2.c", diff --git a/third_party/efr32_sdk/repo b/third_party/efr32_sdk/repo index 1f6ff3d05c9400..9b527ad5d35e72 160000 --- a/third_party/efr32_sdk/repo +++ b/third_party/efr32_sdk/repo @@ -1 +1 @@ -Subproject commit 1f6ff3d05c94003899f3599b2e3ca524c5aa5495 +Subproject commit 9b527ad5d35e72f0266b54ed64d74ebe0170aa45