diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index 30ee0e8188003c..ba71acaed8b0de 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -1,826 +1,826 @@ -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and # limitations under the License. - -import("//build_overrides/chip.gni") -import("//build_overrides/efr32_sdk.gni") -import("//build_overrides/jlink.gni") -import("//build_overrides/mbedtls.gni") - -import("${chip_root}/src/lib/lib.gni") -import("silabs_board.gni") - -declare_args() { - # Location of the efr32 SDK. - efr32_sdk_root = "${chip_root}/third_party/silabs/gecko_sdk" - sdk_support_root = "${chip_root}/third_party/silabs/matter_support" - - # Build openthread with prebuilt silabs lib - use_silabs_thread_lib = false - enable_openthread_cli = true - - kvs_max_entries = 75 - use_external_flash = true - - # Use Silabs factory data provider example. - # Users can implement their own. - use_efr32_factory_data_provider = true - - # Enable Segger System View - use_system_view = false -} - -# Explorer Kit and MGM240L do not have external flash -if (silabs_board == "BRD2703A" || silabs_board == "BRD4319A") { - use_external_flash = false -} - -# Enable LEDs by default -use_wstk_leds = true - -# Board does not support LEDs and Buttons at the same time -if (silabs_board == "BRD4317A" || silabs_board == "BRD4316A" || - silabs_board == "BRD4319A") { - use_wstk_leds = false -} - -assert(efr32_sdk_root != "", "efr32_sdk_root must be specified") - -# Defines an efr32 SDK build target. -# -# Parameters: -# efr32_sdk_root - The location of the erf32 SDK. -# sources - The sources files to build. -template("efr32_sdk") { - if (defined(invoker.efr32_sdk_root)) { - efr32_sdk_root = invoker.efr32_sdk_root - } - - assert(efr32_sdk_root != "", "efr32_sdk_root must be specified") - use_wf200 = false - if (defined(invoker.use_wf200)) { - if (invoker.use_wf200) { - use_wf200 = true - } - } - - sdk_target_name = target_name - - config("${sdk_target_name}_config") { - include_dirs = [] - libs = [] - if (defined(invoker.include_dirs)) { - include_dirs += invoker.include_dirs - } - - # Treat these includes as system includes, so warnings in them are not fatal. - _include_dirs = [ - "${efr32_sdk_root}", - "${efr32_sdk_root}/hardware/kit/common/bsp", - "${efr32_sdk_root}/app/common/util/app_assert/", - "${efr32_sdk_root}/hardware/board/inc", - "${efr32_sdk_root}/hardware/driver/memlcd/inc", - "${efr32_sdk_root}/hardware/driver/memlcd/src/ls013b7dh03", - "${efr32_sdk_root}/platform/bootloader", - "${efr32_sdk_root}/platform/bootloader/config", - "${efr32_sdk_root}/platform/bootloader/config/s2/btl_interface", - "${efr32_sdk_root}/platform/bootloader/api", - "${efr32_sdk_root}/platform/CMSIS/Core/Include", - "${efr32_sdk_root}/platform/CMSIS/RTOS2/Include", - "${efr32_sdk_root}/platform/common/inc", - "${efr32_sdk_root}/platform/driver/button/inc", - "${efr32_sdk_root}/platform/emdrv/common/inc", - "${efr32_sdk_root}/platform/emdrv/gpiointerrupt/inc", - "${efr32_sdk_root}/platform/emdrv/dmadrv/config", - "${efr32_sdk_root}/platform/emdrv/dmadrv/inc", - "${efr32_sdk_root}/platform/emdrv/nvm3/inc", - "${efr32_sdk_root}/platform/emdrv/rtcdrv/inc", - "${efr32_sdk_root}/platform/emlib/inc", - "${efr32_sdk_root}/platform/halconfig/inc/hal-config", - "${efr32_sdk_root}/platform/peripheral/inc", - "${efr32_sdk_root}/platform/radio/rail_lib/common", - "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32", - "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/rf/common/cortex", - "${efr32_sdk_root}/platform/radio/rail_lib/hal", - "${efr32_sdk_root}/platform/radio/rail_lib/hal/efr32", - "${efr32_sdk_root}/platform/radio/rail_lib/protocol/ieee802154", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_pti", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_rf_path", - "${efr32_sdk_root}/platform/service/device_init/inc", - "${efr32_sdk_root}/platform/service/hfxo_manager/config/", - "${efr32_sdk_root}/platform/service/hfxo_manager/inc", - "${efr32_sdk_root}/platform/service/hfxo_manager/src", - "${efr32_sdk_root}/platform/service/mpu/inc", - "${efr32_sdk_root}/platform/service/power_manager/config/", - "${efr32_sdk_root}/platform/service/power_manager/inc/", - "${efr32_sdk_root}/platform/service/power_manager/src/", - "${efr32_sdk_root}/platform/service/sleeptimer/inc", - "${efr32_sdk_root}/platform/service/sleeptimer/config", - "${efr32_sdk_root}/platform/service/system/inc", - "${efr32_sdk_root}/platform/service/udelay/inc", - "${efr32_sdk_root}/platform/service/legacy_hal/inc", - "${efr32_sdk_root}/platform/service/token_manager/config", - "${efr32_sdk_root}/platform/service/token_manager/inc", - "${efr32_sdk_root}/platform/service/token_manager/test", - "${efr32_sdk_root}/platform/service/token_manager/test/include", - "${efr32_sdk_root}/platform/service/token_manager/test/stack/config", - "${efr32_sdk_root}/platform/service/token_manager/test/stack/include", - "${efr32_sdk_root}/platform/middleware/glib", - "${efr32_sdk_root}/platform/middleware/glib/glib", - "${efr32_sdk_root}/platform/middleware/glib/dmd", - "${efr32_sdk_root}/platform/base/hal/plugin/psstore", - "${efr32_sdk_root}/platform/base/hal/plugin/antenna", - "${efr32_sdk_root}/protocol/bluetooth/inc/", - "${efr32_sdk_root}/app/bluetooth/common/in_place_ota_dfu/", - "${efr32_sdk_root}/util/plugin/plugin-common/fem-control", - "${efr32_sdk_root}/util/silicon_labs/silabs_core/graphics", - "${efr32_sdk_root}/util/silicon_labs/silabs_core/memory_manager", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/include", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/include/psa", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_alt/include", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/inc", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/config/", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/inc", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/inc/public", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/inc", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/", - "${efr32_sdk_root}/util/third_party/freertos/cmsis/Include", - "${efr32_sdk_root}/util/third_party/freertos/kernel/include", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/config", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen", - ] - - # Note that we're setting the mbedTLS and PSA configuration files through a - # define. This means the build system by default does not pick up changes in - # the content of these, only when changing the filename itself. - # To fix this, these files are also manually depended upon in the source set - # declared in efr32_mbedtls_config further down this file. - defines = [ - "MBEDTLS_CONFIG_FILE=\"efr32-chip-mbedtls-config.h\"", - "MBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"efr32-mbedtls-psa-crypto-config.h\"", - "__STARTUP_CLEAR_BSS", - "HARD_FAULT_LOG_ENABLE", - "CORTEXM3_EFM32_MICRO", - "EFR32_LOG_ENABLED=1", - "NVM3_DEFAULT_NVM_SIZE=40960", - "NVM3_DEFAULT_MAX_OBJECT_SIZE=4092", - "KVS_MAX_ENTRIES=${kvs_max_entries}", - "EFR32_OPENTHREAD_API", - "PHY=EMBER_PHY_RAIL", - "CORTEXM3", - "MICRO=EMBER_MICRO_CORTEXM3_EFR32", - "PLAT=EMBER_PLATFORM_CORTEXM3", - "${silabs_mcu}=1", - "${silabs_board}=1", - "SL_SUPRESS_DEPRECATION_WARNINGS_SDK_3_1", - "__HEAP_SIZE=0", - "SL_CATALOG_FREERTOS_KERNEL_PRESENT=1", - "MBEDTLS_THREADING_C=1", - "MBEDTLS_THREADING_ALT=1", - "SL_THREADING_ALT=1", - "SL_COMPONENT_CATALOG_PRESENT", - "PLATFORM_HEADER=\"platform-header.h\"", - "USE_NVM3=1", - - #"__STACK_SIZE=0", - ] - - if (use_system_view) { - _include_dirs += [ - "${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER", - "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10/Config/Cortex-M", - "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10", - "${efr32_sdk_root}/util/third_party/segger/systemview/Config/", - ] - - defines += [ "SL_SYSTEM_VIEW=1" ] - } - - defines += board_defines - - if (use_wstk_leds) { - _include_dirs += [ "${efr32_sdk_root}/platform/driver/leddrv/inc" ] - - defines += [ "ENABLE_WSTK_LEDS" ] - } - - if (defined(invoker.enable_sleepy_device)) { - if (invoker.enable_sleepy_device) { - defines += [ - "CHIP_DEVICE_CONFIG_ENABLE_SED=1", - "SL_CATALOG_POWER_MANAGER_PRESENT", - "SL_CATALOG_SLEEPTIMER_PRESENT", - ] - } - } - - 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.chip_enable_wifi) && invoker.chip_enable_wifi) || - (defined(invoker.show_qr_code) && invoker.show_qr_code) || - (defined(invoker.disable_lcd) && !invoker.disable_lcd) || - (defined(invoker.use_external_flash) && use_external_flash)) { - defines += [ "CONFIG_ENABLE_UART" ] - - if (defined(invoker.use_external_flash) && use_external_flash) { - defines += [ "CONFIG_USE_EXTERNAL_FLASH" ] - - _include_dirs += [ "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/inc/sl_mx25_flash_shutdown_usart" ] - } - - _include_dirs += [ - "${efr32_sdk_root}/platform/emdrv/uartdrv/inc", - "${efr32_sdk_root}/platform/emdrv/uartdrv/config", - "${efr32_sdk_root}/hardware/driver/memlcd/inc/memlcd_usart", - ] - } - - if (silabs_family == "efr32mg12") { - _include_dirs += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Include", - "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg1x", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM4F", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg1x/config", - "${efr32_sdk_root}/platform/service/device_init/config/s1/", - "${efr32_sdk_root}/platform/emdrv/spidrv/inc", - ] - - libs += [ - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG12P/GCC/binapploader.o", - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG12P/GCC/libbluetooth.a", - "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg12_gcc_release.a", - "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM4_gcc.a", - ] - - defines += [ "EFR32MG12" ] - } else if (silabs_family == "efr32mg21") { - _include_dirs += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG21/Include", - "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg2x", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg21", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg21/config", - "${efr32_sdk_root}/platform/service/device_init/config/s2/", - ] - - libs += [ - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG21/GCC/binapploader.o", - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG21/GCC/libbluetooth.a", - "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg21_gcc_release.a", - "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a", - ] - - defines += [ - "EFR32MG21", - "EFR32_SERIES2_CONFIG1_MICRO", - ] - } else if (silabs_family == "efr32mg24") { - _include_dirs += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG24/Include", - "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg2x", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24/config", - "${efr32_sdk_root}/platform/service/device_init/config/s2/", - "${efr32_sdk_root}/platform/emdrv/spidrv/inc", - ] - - libs += [ - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG24/GCC/libapploader.a", - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG24/GCC/libbluetooth.a", - "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg24_gcc_release.a", - "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a", - ] - - defines += [ - "EFR32MG24", - "EFR32_SERIES2_CONFIG4_MICRO", - ] - } else if (silabs_family == "mgm24") { - _include_dirs += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/MGM24/Include", - "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg2x", - "${efr32_sdk_root}/platform/radio/rail_lib/protocol/ble", - "${efr32_sdk_root}/platform/radio/rail_lib/protocol/ieee802154", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24/config", - "${efr32_sdk_root}/platform/service/device_init/config/s2/", - ] - - libs += [ - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG24/GCC/libapploader.a", - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG24/GCC/libbluetooth.a", - "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_module_efr32xg24_gcc_release.a", - "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a", - ] - - if (silabs_mcu == "MGM240PB32VNA") { - libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm240pb32vna_gcc.a" ] - } else if (silabs_mcu == "MGM240PB22VNA") { - libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm240pb22vna_gcc.a" ] - } else if (silabs_mcu == "MGM240L022RNF") { - libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm240l022rnf_gcc.a" ] - } - - defines += [ - "MGM24", - "EFR32_SERIES2_CONFIG4_MICRO", - ] - } - - if (use_wf200) { - _include_dirs += [ - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver", - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/bus", - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/firmware", - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/pds/brd8022a", - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/secure_link", - ] - } - - cflags = [] - foreach(include_dir, _include_dirs) { - cflags += [ "-isystem" + rebase_path(include_dir, root_build_dir) ] - } - - cflags += [ - "-Wno-maybe-uninitialized", - "-Wno-shadow", - ] - - if (silabs_family == "efr32mg24" || silabs_family == "mgm24") { - cflags += [ "-mcmse" ] - } - - if (defined(invoker.use_rs911x)) { - if (invoker.use_rs911x == true) { - #add compilation flags for rs991x build. This will be addressed directly in wiseconnect sdk in the next version release of that sdk - cflags += invoker.rs911x_cflags - } - } - - if (defined(invoker.defines)) { - defines += invoker.defines - } - } - - source_set("efr32_mbedtls_config") { - # We're setting the mbedTLS config flags here as the efr32_sdk target - # acts as the mbedTLS target for EFR32 builds. We need this for the build - # system to recompile mbedTLS (= the SDK) when the mbedTLS config gets - # edited. - sources = [ - "${chip_root}/src/platform/silabs/EFR32/efr32-chip-mbedtls-config.h", - "${chip_root}/src/platform/silabs/EFR32/efr32-mbedtls-psa-crypto-config.h", - ] - - public_deps = [ "${chip_root}/src/crypto:crypto_buildconfig" ] - } - - source_set(sdk_target_name) { - sources = [ - "${chip_root}/third_party/mbedtls/repo/include/mbedtls/platform.h", - "${efr32_sdk_root}/app/bluetooth/common/in_place_ota_dfu/sl_bt_in_place_ota_dfu.c", - "${efr32_sdk_root}/hardware/board/src/sl_board_control_gpio.c", - "${efr32_sdk_root}/hardware/board/src/sl_board_init.c", - "${efr32_sdk_root}/platform/CMSIS/RTOS2/Source/os_systick.c", - "${efr32_sdk_root}/platform/bootloader/api/btl_interface.c", - "${efr32_sdk_root}/platform/bootloader/api/btl_interface_storage.c", - "${efr32_sdk_root}/platform/bootloader/security/sha/crypto_sha.c", - "${efr32_sdk_root}/platform/common/src/sl_slist.c", - "${efr32_sdk_root}/platform/driver/button/src/sl_button.c", - "${efr32_sdk_root}/platform/driver/button/src/sl_simple_button.c", - "${efr32_sdk_root}/platform/emdrv/dmadrv/src/dmadrv.c", - "${efr32_sdk_root}/platform/emdrv/gpiointerrupt/src/gpiointerrupt.c", - "${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/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_gpio.c", - "${efr32_sdk_root}/platform/emlib/src/em_ldma.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", - "${efr32_sdk_root}/platform/emlib/src/em_rtcc.c", - "${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/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", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_pti/sl_rail_util_pti.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfrco.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_nvic.c", - "${efr32_sdk_root}/platform/service/hfxo_manager/src/sl_hfxo_manager.c", - "${efr32_sdk_root}/platform/service/legacy_hal/src/token_legacy.c", - "${efr32_sdk_root}/platform/service/mpu/src/sl_mpu.c", - "${efr32_sdk_root}/platform/service/power_manager/src/sl_power_manager.c", - "${efr32_sdk_root}/platform/service/power_manager/src/sl_power_manager_debug.c", - "${efr32_sdk_root}/platform/service/power_manager/src/sl_power_manager_hal_s0_s1.c", - "${efr32_sdk_root}/platform/service/power_manager/src/sl_power_manager_hal_s2.c", - "${efr32_sdk_root}/platform/service/sleeptimer/src/sl_sleeptimer.c", - "${efr32_sdk_root}/platform/service/sleeptimer/src/sl_sleeptimer_hal_rtcc.c", - "${efr32_sdk_root}/platform/service/sleeptimer/src/sl_sleeptimer_hal_sysrtc.c", - "${efr32_sdk_root}/platform/service/system/src/sl_system_init.c", - "${efr32_sdk_root}/platform/service/system/src/sl_system_kernel.c", - "${efr32_sdk_root}/platform/service/system/src/sl_system_process_action.c", - "${efr32_sdk_root}/platform/service/token_manager/src/sl_token_def.c", - "${efr32_sdk_root}/platform/service/token_manager/src/sl_token_manager.c", - "${efr32_sdk_root}/platform/service/token_manager/src/sl_token_manufacturing.c", - "${efr32_sdk_root}/platform/service/udelay/src/sl_udelay.c", - "${efr32_sdk_root}/platform/service/udelay/src/sl_udelay_armv6m_gcc.S", - "${efr32_sdk_root}/protocol/bluetooth/src/sl_bt_mbedtls_context.c", - "${efr32_sdk_root}/protocol/bluetooth/src/sl_bt_rtos_adaptation.c", - "${efr32_sdk_root}/protocol/bluetooth/src/sl_bt_stack_init.c", - "${efr32_sdk_root}/protocol/bluetooth/src/sli_bt_advertiser_config.c", - "${efr32_sdk_root}/protocol/bluetooth/src/sli_bt_connection_config.c", - "${efr32_sdk_root}/util/silicon_labs/silabs_core/memory_manager/sl_malloc.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/aes.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/aesni.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/asn1parse.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/asn1write.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/base64.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/bignum.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/camellia.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ccm.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/chacha20.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/chachapoly.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/cipher_wrap.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/cmac.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/constant_time.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ctr_drbg.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/debug.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/des.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/dhm.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ecdh.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ecdsa.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ecjpake.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ecp.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ecp_curves.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/entropy.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/entropy_poll.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/gcm.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/hkdf.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/hmac_drbg.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/md.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/md5.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/oid.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pem.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pk.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pk_wrap.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pkcs12.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pkcs5.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pkparse.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pkwrite.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/platform.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/platform_util.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/poly1305.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_client.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_driver_wrappers.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_ecp.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_hash.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_rsa.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_se.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_slot_management.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_storage.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_its_file.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ripemd160.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/rsa.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/sha1.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/sha256.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/sha512.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_cache.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_ciphersuites.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_cli.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_cookie.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_msg.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_srv.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_ticket.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_tls.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_tls13_keys.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/threading.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/timing.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/version.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509_create.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509_crl.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509_crt.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509_csr.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509write_crt.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509write_csr.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/aes_aes.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/crypto_aes.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/crypto_ecp.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/error.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_ccm.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_cmac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_ecdsa_ecdh.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_sha.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/sl_entropy_hardware.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/sl_mbedtls.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/version_features.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_protocol_crypto_crypto.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_protocol_crypto_radioaes.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/crypto_management.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sl_psa_its_nvm3.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_hash.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_trng_driver.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_psa_driver_common.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_psa_driver_init.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_psa_trng.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_builtin_keys.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_signature.c", - "${efr32_sdk_root}/util/third_party/freertos/cmsis/Source/cmsis_os2.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/croutine.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/event_groups.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/list.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/queue.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/stream_buffer.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/tasks.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/timers.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/gatt_db.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_bluetooth.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_board_default_init.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_device_init_clocks.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_event_handler.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_simple_button_instances.c", - ] - - if (use_system_view) { - sources += [ - "${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER/SEGGER_SYSVIEW.c", - "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10/Config/Cortex-M/SEGGER_SYSVIEW_Config_FreeRTOS.c", - "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10/SEGGER_SYSVIEW_FreeRTOS.c", - ] - } - - if (use_wstk_leds) { - sources += [ - "${efr32_sdk_root}/platform/driver/leddrv/src/sl_led.c", - "${efr32_sdk_root}/platform/driver/leddrv/src/sl_pwm_led.c", - "${efr32_sdk_root}/platform/driver/leddrv/src/sl_simple_led.c", - "${efr32_sdk_root}/platform/driver/leddrv/src/sl_simple_rgb_pwm_led.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_simple_led_instances.c", - ] - } - - # SPI is only used for Wifi - if (defined(invoker.chip_enable_wifi) && invoker.chip_enable_wifi) { - sources += [ - "${efr32_sdk_root}/platform/emdrv/spidrv/src/spidrv.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_spidrv_init.c", - ] - } - - if (defined(invoker.enable_sleepy_device)) { - if (invoker.enable_sleepy_device) { - sources += [ "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/SiliconLabs/tick_power_manager.c" ] - } - } - - if (defined(enable_fem)) { - sources += [ - "${efr32_sdk_root}/util/plugin/plugin-common/fem-control/fem-control.c", - ] - } - - # USART sources files - if ((defined(invoker.chip_enable_pw_rpc) && invoker.chip_enable_pw_rpc) || - chip_build_libshell || enable_openthread_cli || - (defined(invoker.chip_enable_wifi) && invoker.chip_enable_wifi) || - (defined(invoker.show_qr_code) && invoker.show_qr_code) || - (defined(invoker.disable_lcd) && !invoker.disable_lcd) || - (defined(invoker.use_external_flash) && use_external_flash)) { - sources += [ - "${efr32_sdk_root}/hardware/driver/memlcd/src/memlcd_usart/sl_memlcd_spi.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", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_uartdrv_init.c", - ] - - if (defined(invoker.use_external_flash) && use_external_flash) { - sources += [ "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/src/sl_mx25_flash_shutdown_usart/sl_mx25_flash_shutdown.c" ] - } - } - - if ((defined(invoker.show_qr_code) && invoker.show_qr_code) || - (defined(invoker.disable_lcd) && !invoker.disable_lcd)) { - sources += [ - "${efr32_sdk_root}/hardware/driver/memlcd/src/sl_memlcd.c", - "${efr32_sdk_root}/hardware/driver/memlcd/src/sl_memlcd_display.c", - "${efr32_sdk_root}/platform/middleware/glib/dmd/display/dmd_memlcd.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/bmp.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_bitmap.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_circle.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_font_narrow_6x8.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_font_normal_8x8.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_font_number_16x20.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_line.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_polygon.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_rectangle.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_string.c", - ] - } - - if (use_wf200) { - sources += [ - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/bus/sl_wfx_bus.c", - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/bus/sl_wfx_bus_spi.c", - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/secure_link/sl_wfx_secure_link.c", - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/sl_wfx.c", - ] - } - - if (silabs_family == "efr32mg12") { - sources += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Source/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", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s1.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfxo_s1.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfxo_s1.c", - "${efr32_sdk_root}/protocol/bluetooth/src/sl_apploader_util_s1.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM4F/port.c", - ] - } else if (silabs_family == "efr32mg21") { - sources += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG21/Source/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", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s2.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfrco.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfxo_s2.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfxo_s2.c", - "${efr32_sdk_root}/platform/service/hfxo_manager/src/sl_hfxo_manager_hal_s2.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_entropy.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_hash.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_handling.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_signature.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_util.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_alt/source/sl_se_management.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_aes.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_gcm.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_jpake.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_radioaes_management.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_management.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_hash.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_key_derivation.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/port.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/portasm.c", - ] - } else if (silabs_family == "efr32mg24") { - sources += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG24/Source/startup_efr32mg24.c", - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG24/Source/system_efr32mg24.c", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/pa_curves_efr32.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dcdc_s2.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s2.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfxo_s2.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfxo_s2.c", - "${efr32_sdk_root}/platform/service/hfxo_manager/src/sl_hfxo_manager_hal_s2.c", - "${efr32_sdk_root}/protocol/bluetooth/src/sl_apploader_util_s2.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_attestation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_entropy.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_hash.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_handling.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_signature.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_util.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_aes.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_jpake.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_radioaes_management.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_management.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_hash.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_key_derivation.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/port.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/portasm.c", - ] - } else if (silabs_family == "mgm24") { - sources += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/MGM24/Source/startup_mgm24.c", - "${efr32_sdk_root}/platform/Device/SiliconLabs/MGM24/Source/system_mgm24.c", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/pa_curves_efr32.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dcdc_s2.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s2.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfxo_mgm24.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfxo_s2.c", - "${efr32_sdk_root}/platform/service/hfxo_manager/src/sl_hfxo_manager_hal_s2.c", - "${efr32_sdk_root}/protocol/bluetooth/src/sl_apploader_util_s2.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_attestation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_entropy.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_hash.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_handling.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_signature.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_util.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_aes.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_jpake.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_radioaes_management.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_management.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_hash.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_key_derivation.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/port.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/portasm.c", - ] - } - - if (silabs_board == "BRD4186A" || silabs_board == "BRD4186C" || - silabs_board == "BRD4187A" || silabs_board == "BRD4187C") { - sources += [ "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dpll_s2.c" ] - } - - public_deps = [ - ":efr32_mbedtls_config", - "${segger_rtt_root}:segger_rtt", - "${segger_rtt_root}:segger_rtt_printf", - "${segger_rtt_root}:segger_rtt_syscalls", - ] - - if (defined(invoker.sources)) { - sources += invoker.sources - } - - public_configs = [ ":${sdk_target_name}_config" ] - } -} + +import("//build_overrides/chip.gni") +import("//build_overrides/efr32_sdk.gni") +import("//build_overrides/jlink.gni") +import("//build_overrides/mbedtls.gni") + +import("${chip_root}/src/lib/lib.gni") +import("silabs_board.gni") + +declare_args() { + # Location of the efr32 SDK. + efr32_sdk_root = "${chip_root}/third_party/silabs/gecko_sdk" + sdk_support_root = "${chip_root}/third_party/silabs/matter_support" + + # Build openthread with prebuilt silabs lib + use_silabs_thread_lib = false + enable_openthread_cli = true + + kvs_max_entries = 75 + use_external_flash = true + + # Use Silabs factory data provider example. + # Users can implement their own. + use_efr32_factory_data_provider = true + + # Enable Segger System View + use_system_view = false +} + +# Explorer Kit and MGM240L do not have external flash +if (silabs_board == "BRD2703A" || silabs_board == "BRD4319A") { + use_external_flash = false +} + +# Enable LEDs by default +use_wstk_leds = true + +# Board does not support LEDs and Buttons at the same time +if (silabs_board == "BRD4317A" || silabs_board == "BRD4316A" || + silabs_board == "BRD4319A") { + use_wstk_leds = false +} + +assert(efr32_sdk_root != "", "efr32_sdk_root must be specified") + +# Defines an efr32 SDK build target. +# +# Parameters: +# efr32_sdk_root - The location of the erf32 SDK. +# sources - The sources files to build. +template("efr32_sdk") { + if (defined(invoker.efr32_sdk_root)) { + efr32_sdk_root = invoker.efr32_sdk_root + } + + assert(efr32_sdk_root != "", "efr32_sdk_root must be specified") + use_wf200 = false + if (defined(invoker.use_wf200)) { + if (invoker.use_wf200) { + use_wf200 = true + } + } + + sdk_target_name = target_name + + config("${sdk_target_name}_config") { + include_dirs = [] + libs = [] + if (defined(invoker.include_dirs)) { + include_dirs += invoker.include_dirs + } + + # Treat these includes as system includes, so warnings in them are not fatal. + _include_dirs = [ + "${efr32_sdk_root}", + "${efr32_sdk_root}/hardware/kit/common/bsp", + "${efr32_sdk_root}/app/common/util/app_assert/", + "${efr32_sdk_root}/hardware/board/inc", + "${efr32_sdk_root}/hardware/driver/memlcd/inc", + "${efr32_sdk_root}/hardware/driver/memlcd/src/ls013b7dh03", + "${efr32_sdk_root}/platform/bootloader", + "${efr32_sdk_root}/platform/bootloader/config", + "${efr32_sdk_root}/platform/bootloader/config/s2/btl_interface", + "${efr32_sdk_root}/platform/bootloader/api", + "${efr32_sdk_root}/platform/CMSIS/Core/Include", + "${efr32_sdk_root}/platform/CMSIS/RTOS2/Include", + "${efr32_sdk_root}/platform/common/inc", + "${efr32_sdk_root}/platform/driver/button/inc", + "${efr32_sdk_root}/platform/emdrv/common/inc", + "${efr32_sdk_root}/platform/emdrv/gpiointerrupt/inc", + "${efr32_sdk_root}/platform/emdrv/dmadrv/config", + "${efr32_sdk_root}/platform/emdrv/dmadrv/inc", + "${efr32_sdk_root}/platform/emdrv/nvm3/inc", + "${efr32_sdk_root}/platform/emdrv/rtcdrv/inc", + "${efr32_sdk_root}/platform/emlib/inc", + "${efr32_sdk_root}/platform/halconfig/inc/hal-config", + "${efr32_sdk_root}/platform/peripheral/inc", + "${efr32_sdk_root}/platform/radio/rail_lib/common", + "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32", + "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/rf/common/cortex", + "${efr32_sdk_root}/platform/radio/rail_lib/hal", + "${efr32_sdk_root}/platform/radio/rail_lib/hal/efr32", + "${efr32_sdk_root}/platform/radio/rail_lib/protocol/ieee802154", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_pti", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_rf_path", + "${efr32_sdk_root}/platform/service/device_init/inc", + "${efr32_sdk_root}/platform/service/hfxo_manager/config/", + "${efr32_sdk_root}/platform/service/hfxo_manager/inc", + "${efr32_sdk_root}/platform/service/hfxo_manager/src", + "${efr32_sdk_root}/platform/service/mpu/inc", + "${efr32_sdk_root}/platform/service/power_manager/config/", + "${efr32_sdk_root}/platform/service/power_manager/inc/", + "${efr32_sdk_root}/platform/service/power_manager/src/", + "${efr32_sdk_root}/platform/service/sleeptimer/inc", + "${efr32_sdk_root}/platform/service/sleeptimer/config", + "${efr32_sdk_root}/platform/service/system/inc", + "${efr32_sdk_root}/platform/service/udelay/inc", + "${efr32_sdk_root}/platform/service/legacy_hal/inc", + "${efr32_sdk_root}/platform/service/token_manager/config", + "${efr32_sdk_root}/platform/service/token_manager/inc", + "${efr32_sdk_root}/platform/service/token_manager/test", + "${efr32_sdk_root}/platform/service/token_manager/test/include", + "${efr32_sdk_root}/platform/service/token_manager/test/stack/config", + "${efr32_sdk_root}/platform/service/token_manager/test/stack/include", + "${efr32_sdk_root}/platform/middleware/glib", + "${efr32_sdk_root}/platform/middleware/glib/glib", + "${efr32_sdk_root}/platform/middleware/glib/dmd", + "${efr32_sdk_root}/platform/base/hal/plugin/psstore", + "${efr32_sdk_root}/platform/base/hal/plugin/antenna", + "${efr32_sdk_root}/protocol/bluetooth/inc/", + "${efr32_sdk_root}/app/bluetooth/common/in_place_ota_dfu/", + "${efr32_sdk_root}/util/plugin/plugin-common/fem-control", + "${efr32_sdk_root}/util/silicon_labs/silabs_core/graphics", + "${efr32_sdk_root}/util/silicon_labs/silabs_core/memory_manager", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/include", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/include/psa", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_alt/include", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/inc", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/config/", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/inc", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/inc/public", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/inc", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/", + "${efr32_sdk_root}/util/third_party/freertos/cmsis/Include", + "${efr32_sdk_root}/util/third_party/freertos/kernel/include", + "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/config", + "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen", + ] + + # Note that we're setting the mbedTLS and PSA configuration files through a + # define. This means the build system by default does not pick up changes in + # the content of these, only when changing the filename itself. + # To fix this, these files are also manually depended upon in the source set + # declared in efr32_mbedtls_config further down this file. + defines = [ + "MBEDTLS_CONFIG_FILE=\"efr32-chip-mbedtls-config.h\"", + "MBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"efr32-mbedtls-psa-crypto-config.h\"", + "__STARTUP_CLEAR_BSS", + "HARD_FAULT_LOG_ENABLE", + "CORTEXM3_EFM32_MICRO", + "EFR32_LOG_ENABLED=1", + "NVM3_DEFAULT_NVM_SIZE=40960", + "NVM3_DEFAULT_MAX_OBJECT_SIZE=4092", + "KVS_MAX_ENTRIES=${kvs_max_entries}", + "EFR32_OPENTHREAD_API", + "PHY=EMBER_PHY_RAIL", + "CORTEXM3", + "MICRO=EMBER_MICRO_CORTEXM3_EFR32", + "PLAT=EMBER_PLATFORM_CORTEXM3", + "${silabs_mcu}=1", + "${silabs_board}=1", + "SL_SUPRESS_DEPRECATION_WARNINGS_SDK_3_1", + "__HEAP_SIZE=0", + "SL_CATALOG_FREERTOS_KERNEL_PRESENT=1", + "MBEDTLS_THREADING_C=1", + "MBEDTLS_THREADING_ALT=1", + "SL_THREADING_ALT=1", + "SL_COMPONENT_CATALOG_PRESENT", + "PLATFORM_HEADER=\"platform-header.h\"", + "USE_NVM3=1", + + #"__STACK_SIZE=0", + ] + + if (use_system_view) { + _include_dirs += [ + "${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER", + "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10/Config/Cortex-M", + "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10", + "${efr32_sdk_root}/util/third_party/segger/systemview/Config/", + ] + + defines += [ "SL_SYSTEM_VIEW=1" ] + } + + defines += board_defines + + if (use_wstk_leds) { + _include_dirs += [ "${efr32_sdk_root}/platform/driver/leddrv/inc" ] + + defines += [ "ENABLE_WSTK_LEDS" ] + } + + if (defined(invoker.enable_sleepy_device)) { + if (invoker.enable_sleepy_device) { + defines += [ + "CHIP_DEVICE_CONFIG_ENABLE_SED=1", + "SL_CATALOG_POWER_MANAGER_PRESENT", + "SL_CATALOG_SLEEPTIMER_PRESENT", + ] + } + } + + 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.chip_enable_wifi) && invoker.chip_enable_wifi) || + (defined(invoker.show_qr_code) && invoker.show_qr_code) || + (defined(invoker.disable_lcd) && !invoker.disable_lcd) || + (defined(invoker.use_external_flash) && use_external_flash)) { + defines += [ "CONFIG_ENABLE_UART" ] + + if (defined(invoker.use_external_flash) && use_external_flash) { + defines += [ "CONFIG_USE_EXTERNAL_FLASH" ] + + _include_dirs += [ "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/inc/sl_mx25_flash_shutdown_usart" ] + } + + _include_dirs += [ + "${efr32_sdk_root}/platform/emdrv/uartdrv/inc", + "${efr32_sdk_root}/platform/emdrv/uartdrv/config", + "${efr32_sdk_root}/hardware/driver/memlcd/inc/memlcd_usart", + ] + } + + if (silabs_family == "efr32mg12") { + _include_dirs += [ + "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Include", + "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg1x", + "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM4F", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg1x/config", + "${efr32_sdk_root}/platform/service/device_init/config/s1/", + "${efr32_sdk_root}/platform/emdrv/spidrv/inc", + ] + + libs += [ + "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG12P/GCC/binapploader.o", + "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG12P/GCC/libbluetooth.a", + "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg12_gcc_release.a", + "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM4_gcc.a", + ] + + defines += [ "EFR32MG12" ] + } else if (silabs_family == "efr32mg21") { + _include_dirs += [ + "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG21/Include", + "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg2x", + "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg21", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg21/config", + "${efr32_sdk_root}/platform/service/device_init/config/s2/", + ] + + libs += [ + "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG21/GCC/binapploader.o", + "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG21/GCC/libbluetooth.a", + "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg21_gcc_release.a", + "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a", + ] + + defines += [ + "EFR32MG21", + "EFR32_SERIES2_CONFIG1_MICRO", + ] + } else if (silabs_family == "efr32mg24") { + _include_dirs += [ + "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG24/Include", + "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg2x", + "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24/config", + "${efr32_sdk_root}/platform/service/device_init/config/s2/", + "${efr32_sdk_root}/platform/emdrv/spidrv/inc", + ] + + libs += [ + "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG24/GCC/libapploader.a", + "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG24/GCC/libbluetooth.a", + "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg24_gcc_release.a", + "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a", + ] + + defines += [ + "EFR32MG24", + "EFR32_SERIES2_CONFIG4_MICRO", + ] + } else if (silabs_family == "mgm24") { + _include_dirs += [ + "${efr32_sdk_root}/platform/Device/SiliconLabs/MGM24/Include", + "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg2x", + "${efr32_sdk_root}/platform/radio/rail_lib/protocol/ble", + "${efr32_sdk_root}/platform/radio/rail_lib/protocol/ieee802154", + "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24/config", + "${efr32_sdk_root}/platform/service/device_init/config/s2/", + ] + + libs += [ + "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG24/GCC/libapploader.a", + "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG24/GCC/libbluetooth.a", + "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_module_efr32xg24_gcc_release.a", + "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a", + ] + + if (silabs_mcu == "MGM240PB32VNA") { + libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm240pb32vna_gcc.a" ] + } else if (silabs_mcu == "MGM240PB22VNA") { + libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm240pb22vna_gcc.a" ] + } else if (silabs_mcu == "MGM240L022RNF") { + libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm240l022rnf_gcc.a" ] + } + + defines += [ + "MGM24", + "EFR32_SERIES2_CONFIG4_MICRO", + ] + } + + if (use_wf200) { + _include_dirs += [ + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/bus", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/firmware", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/pds/brd8022a", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/secure_link", + ] + } + + cflags = [] + foreach(include_dir, _include_dirs) { + cflags += [ "-isystem" + rebase_path(include_dir, root_build_dir) ] + } + + cflags += [ + "-Wno-maybe-uninitialized", + "-Wno-shadow", + ] + + if (silabs_family == "efr32mg24" || silabs_family == "mgm24") { + cflags += [ "-mcmse" ] + } + + if (defined(invoker.use_rs911x)) { + if (invoker.use_rs911x == true) { + #add compilation flags for rs991x build. This will be addressed directly in wiseconnect sdk in the next version release of that sdk + cflags += invoker.rs911x_cflags + } + } + + if (defined(invoker.defines)) { + defines += invoker.defines + } + } + + source_set("efr32_mbedtls_config") { + # We're setting the mbedTLS config flags here as the efr32_sdk target + # acts as the mbedTLS target for EFR32 builds. We need this for the build + # system to recompile mbedTLS (= the SDK) when the mbedTLS config gets + # edited. + sources = [ + "${chip_root}/src/platform/silabs/EFR32/efr32-chip-mbedtls-config.h", + "${chip_root}/src/platform/silabs/EFR32/efr32-mbedtls-psa-crypto-config.h", + ] + + public_deps = [ "${chip_root}/src/crypto:crypto_buildconfig" ] + } + + source_set(sdk_target_name) { + sources = [ + "${chip_root}/third_party/mbedtls/repo/include/mbedtls/platform.h", + "${efr32_sdk_root}/app/bluetooth/common/in_place_ota_dfu/sl_bt_in_place_ota_dfu.c", + "${efr32_sdk_root}/hardware/board/src/sl_board_control_gpio.c", + "${efr32_sdk_root}/hardware/board/src/sl_board_init.c", + "${efr32_sdk_root}/platform/CMSIS/RTOS2/Source/os_systick.c", + "${efr32_sdk_root}/platform/bootloader/api/btl_interface.c", + "${efr32_sdk_root}/platform/bootloader/api/btl_interface_storage.c", + "${efr32_sdk_root}/platform/bootloader/security/sha/crypto_sha.c", + "${efr32_sdk_root}/platform/common/src/sl_slist.c", + "${efr32_sdk_root}/platform/driver/button/src/sl_button.c", + "${efr32_sdk_root}/platform/driver/button/src/sl_simple_button.c", + "${efr32_sdk_root}/platform/emdrv/dmadrv/src/dmadrv.c", + "${efr32_sdk_root}/platform/emdrv/gpiointerrupt/src/gpiointerrupt.c", + "${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/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_gpio.c", + "${efr32_sdk_root}/platform/emlib/src/em_ldma.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", + "${efr32_sdk_root}/platform/emlib/src/em_rtcc.c", + "${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/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", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_pti/sl_rail_util_pti.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfrco.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_nvic.c", + "${efr32_sdk_root}/platform/service/hfxo_manager/src/sl_hfxo_manager.c", + "${efr32_sdk_root}/platform/service/legacy_hal/src/token_legacy.c", + "${efr32_sdk_root}/platform/service/mpu/src/sl_mpu.c", + "${efr32_sdk_root}/platform/service/power_manager/src/sl_power_manager.c", + "${efr32_sdk_root}/platform/service/power_manager/src/sl_power_manager_debug.c", + "${efr32_sdk_root}/platform/service/power_manager/src/sl_power_manager_hal_s0_s1.c", + "${efr32_sdk_root}/platform/service/power_manager/src/sl_power_manager_hal_s2.c", + "${efr32_sdk_root}/platform/service/sleeptimer/src/sl_sleeptimer.c", + "${efr32_sdk_root}/platform/service/sleeptimer/src/sl_sleeptimer_hal_rtcc.c", + "${efr32_sdk_root}/platform/service/sleeptimer/src/sl_sleeptimer_hal_sysrtc.c", + "${efr32_sdk_root}/platform/service/system/src/sl_system_init.c", + "${efr32_sdk_root}/platform/service/system/src/sl_system_kernel.c", + "${efr32_sdk_root}/platform/service/system/src/sl_system_process_action.c", + "${efr32_sdk_root}/platform/service/token_manager/src/sl_token_def.c", + "${efr32_sdk_root}/platform/service/token_manager/src/sl_token_manager.c", + "${efr32_sdk_root}/platform/service/token_manager/src/sl_token_manufacturing.c", + "${efr32_sdk_root}/platform/service/udelay/src/sl_udelay.c", + "${efr32_sdk_root}/platform/service/udelay/src/sl_udelay_armv6m_gcc.S", + "${efr32_sdk_root}/protocol/bluetooth/src/sl_bt_mbedtls_context.c", + "${efr32_sdk_root}/protocol/bluetooth/src/sl_bt_rtos_adaptation.c", + "${efr32_sdk_root}/protocol/bluetooth/src/sl_bt_stack_init.c", + "${efr32_sdk_root}/protocol/bluetooth/src/sli_bt_advertiser_config.c", + "${efr32_sdk_root}/protocol/bluetooth/src/sli_bt_connection_config.c", + "${efr32_sdk_root}/util/silicon_labs/silabs_core/memory_manager/sl_malloc.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/aes.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/aesni.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/asn1parse.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/asn1write.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/base64.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/bignum.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/camellia.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ccm.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/chacha20.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/chachapoly.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/cipher.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/cipher_wrap.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/cmac.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/constant_time.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ctr_drbg.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/debug.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/des.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/dhm.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ecdh.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ecdsa.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ecjpake.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ecp.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ecp_curves.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/entropy.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/entropy_poll.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/gcm.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/hkdf.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/hmac_drbg.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/md.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/md5.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/oid.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pem.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pk.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pk_wrap.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pkcs12.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pkcs5.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pkparse.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pkwrite.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/platform.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/platform_util.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/poly1305.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_aead.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_cipher.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_client.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_driver_wrappers.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_ecp.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_hash.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_mac.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_rsa.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_se.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_slot_management.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_storage.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_its_file.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ripemd160.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/rsa.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/sha1.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/sha256.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/sha512.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_cache.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_ciphersuites.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_cli.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_cookie.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_msg.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_srv.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_ticket.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_tls.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_tls13_keys.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/threading.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/timing.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/version.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509_create.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509_crl.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509_crt.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509_csr.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509write_crt.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509write_csr.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/aes_aes.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/crypto_aes.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/crypto_ecp.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/error.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_ccm.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_cmac.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_ecdsa_ecdh.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_sha.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/sl_entropy_hardware.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/sl_mbedtls.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/version_features.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_protocol_crypto_crypto.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_protocol_crypto_radioaes.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/crypto_management.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sl_psa_its_nvm3.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_aead.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_cipher.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_hash.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_mac.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_trng_driver.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_psa_driver_common.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_psa_driver_init.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_psa_trng.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_builtin_keys.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_signature.c", + "${efr32_sdk_root}/util/third_party/freertos/cmsis/Source/cmsis_os2.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/croutine.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/event_groups.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/list.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/queue.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/stream_buffer.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/tasks.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/timers.c", + "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/gatt_db.c", + "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_bluetooth.c", + "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_board_default_init.c", + "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_device_init_clocks.c", + "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_event_handler.c", + "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_simple_button_instances.c", + ] + + if (use_system_view) { + sources += [ + "${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER/SEGGER_SYSVIEW.c", + "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10/Config/Cortex-M/SEGGER_SYSVIEW_Config_FreeRTOS.c", + "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10/SEGGER_SYSVIEW_FreeRTOS.c", + ] + } + + if (use_wstk_leds) { + sources += [ + "${efr32_sdk_root}/platform/driver/leddrv/src/sl_led.c", + "${efr32_sdk_root}/platform/driver/leddrv/src/sl_pwm_led.c", + "${efr32_sdk_root}/platform/driver/leddrv/src/sl_simple_led.c", + "${efr32_sdk_root}/platform/driver/leddrv/src/sl_simple_rgb_pwm_led.c", + "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_simple_led_instances.c", + ] + } + + # SPI is only used for Wifi + if (defined(invoker.chip_enable_wifi) && invoker.chip_enable_wifi) { + sources += [ + "${efr32_sdk_root}/platform/emdrv/spidrv/src/spidrv.c", + "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_spidrv_init.c", + ] + } + + if (defined(invoker.enable_sleepy_device)) { + if (invoker.enable_sleepy_device) { + sources += [ "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/SiliconLabs/tick_power_manager.c" ] + } + } + + if (defined(enable_fem)) { + sources += [ + "${efr32_sdk_root}/util/plugin/plugin-common/fem-control/fem-control.c", + ] + } + + # USART sources files + if ((defined(invoker.chip_enable_pw_rpc) && invoker.chip_enable_pw_rpc) || + chip_build_libshell || enable_openthread_cli || + (defined(invoker.chip_enable_wifi) && invoker.chip_enable_wifi) || + (defined(invoker.show_qr_code) && invoker.show_qr_code) || + (defined(invoker.disable_lcd) && !invoker.disable_lcd) || + (defined(invoker.use_external_flash) && use_external_flash)) { + sources += [ + "${efr32_sdk_root}/hardware/driver/memlcd/src/memlcd_usart/sl_memlcd_spi.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", + "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_uartdrv_init.c", + ] + + if (defined(invoker.use_external_flash) && use_external_flash) { + sources += [ "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/src/sl_mx25_flash_shutdown_usart/sl_mx25_flash_shutdown.c" ] + } + } + + if ((defined(invoker.show_qr_code) && invoker.show_qr_code) || + (defined(invoker.disable_lcd) && !invoker.disable_lcd)) { + sources += [ + "${efr32_sdk_root}/hardware/driver/memlcd/src/sl_memlcd.c", + "${efr32_sdk_root}/hardware/driver/memlcd/src/sl_memlcd_display.c", + "${efr32_sdk_root}/platform/middleware/glib/dmd/display/dmd_memlcd.c", + "${efr32_sdk_root}/platform/middleware/glib/glib/bmp.c", + "${efr32_sdk_root}/platform/middleware/glib/glib/glib.c", + "${efr32_sdk_root}/platform/middleware/glib/glib/glib_bitmap.c", + "${efr32_sdk_root}/platform/middleware/glib/glib/glib_circle.c", + "${efr32_sdk_root}/platform/middleware/glib/glib/glib_font_narrow_6x8.c", + "${efr32_sdk_root}/platform/middleware/glib/glib/glib_font_normal_8x8.c", + "${efr32_sdk_root}/platform/middleware/glib/glib/glib_font_number_16x20.c", + "${efr32_sdk_root}/platform/middleware/glib/glib/glib_line.c", + "${efr32_sdk_root}/platform/middleware/glib/glib/glib_polygon.c", + "${efr32_sdk_root}/platform/middleware/glib/glib/glib_rectangle.c", + "${efr32_sdk_root}/platform/middleware/glib/glib/glib_string.c", + ] + } + + if (use_wf200) { + sources += [ + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/bus/sl_wfx_bus.c", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/bus/sl_wfx_bus_spi.c", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/secure_link/sl_wfx_secure_link.c", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/sl_wfx.c", + ] + } + + if (silabs_family == "efr32mg12") { + sources += [ + "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Source/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", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s1.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfxo_s1.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfxo_s1.c", + "${efr32_sdk_root}/protocol/bluetooth/src/sl_apploader_util_s1.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM4F/port.c", + ] + } else if (silabs_family == "efr32mg21") { + sources += [ + "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG21/Source/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", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s2.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfrco.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfxo_s2.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfxo_s2.c", + "${efr32_sdk_root}/platform/service/hfxo_manager/src/sl_hfxo_manager_hal_s2.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_cipher.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_entropy.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_hash.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_derivation.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_handling.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_signature.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_util.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_alt/source/sl_se_management.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_aes.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_gcm.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_jpake.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_radioaes_management.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_aead.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_cipher.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_derivation.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_management.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_mac.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_aead.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_cipher.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_mac.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_key_derivation.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_cipher.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_hash.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_mac.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_key_derivation.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/port.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/portasm.c", + ] + } else if (silabs_family == "efr32mg24") { + sources += [ + "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG24/Source/startup_efr32mg24.c", + "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG24/Source/system_efr32mg24.c", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/pa_curves_efr32.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dcdc_s2.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s2.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfxo_s2.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfxo_s2.c", + "${efr32_sdk_root}/platform/service/hfxo_manager/src/sl_hfxo_manager_hal_s2.c", + "${efr32_sdk_root}/protocol/bluetooth/src/sl_apploader_util_s2.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_attestation.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_cipher.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_entropy.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_hash.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_derivation.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_handling.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_signature.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_util.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_aes.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_jpake.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_radioaes_management.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_aead.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_cipher.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_derivation.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_management.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_mac.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_aead.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_cipher.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_mac.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_key_derivation.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_aead.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_cipher.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_hash.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_mac.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_key_derivation.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/port.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/portasm.c", + ] + } else if (silabs_family == "mgm24") { + sources += [ + "${efr32_sdk_root}/platform/Device/SiliconLabs/MGM24/Source/startup_mgm24.c", + "${efr32_sdk_root}/platform/Device/SiliconLabs/MGM24/Source/system_mgm24.c", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/pa_curves_efr32.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dcdc_s2.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s2.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfxo_mgm24.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfxo_s2.c", + "${efr32_sdk_root}/platform/service/hfxo_manager/src/sl_hfxo_manager_hal_s2.c", + "${efr32_sdk_root}/protocol/bluetooth/src/sl_apploader_util_s2.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_attestation.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_cipher.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_entropy.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_hash.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_derivation.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_handling.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_signature.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_util.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_aes.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_jpake.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_radioaes_management.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_aead.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_cipher.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_derivation.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_management.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_mac.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_aead.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_cipher.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_mac.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_key_derivation.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_aead.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_cipher.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_hash.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_mac.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_key_derivation.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/port.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/portasm.c", + ] + } + + if (silabs_board == "BRD4186A" || silabs_board == "BRD4186C" || + silabs_board == "BRD4187A" || silabs_board == "BRD4187C") { + sources += [ "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dpll_s2.c" ] + } + + public_deps = [ + ":efr32_mbedtls_config", + "${segger_rtt_root}:segger_rtt", + "${segger_rtt_root}:segger_rtt_printf", + "${segger_rtt_root}:segger_rtt_syscalls", + ] + + if (defined(invoker.sources)) { + sources += invoker.sources + } + + public_configs = [ ":${sdk_target_name}_config" ] + } +}