Skip to content

Commit

Permalink
Fix sdk configurations for sleepy devices (#20380)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs authored and pull[bot] committed Jan 26, 2024
1 parent 108b476 commit 2258377
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 37 deletions.
51 changes: 15 additions & 36 deletions third_party/silabs/efr32_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ declare_args() {
sdk_support_root = "${chip_root}/third_party/silabs/matter_support"
enable_openthread_cli = true
kvs_max_entries = 75

use_external_flash = true
}

assert(efr32_sdk_root != "", "efr32_sdk_root must be specified")
Expand Down Expand Up @@ -194,30 +196,20 @@ template("efr32_sdk") {
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) ||
(defined(invoker.disable_lcd) && !invoker.disable_lcd)) {
(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}/platform/emdrv/uartdrv/inc",
"${efr32_sdk_root}/platform/emdrv/uartdrv/config",
"${efr32_sdk_root}/hardware/driver/memlcd/inc/memlcd_usart",
"${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/inc/sl_mx25_flash_shutdown_usart",
]

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_usart",
"${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/inc/sl_mx25_flash_shutdown_usart",
]
}
}

if (efr32_family == "efr32mg12") {
Expand Down Expand Up @@ -511,31 +503,17 @@ template("efr32_sdk") {
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) ||
(defined(invoker.disable_lcd) && !invoker.disable_lcd)) {
(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}/hardware/driver/mx25_flash_shutdown/src/sl_mx25_flash_shutdown_usart/sl_mx25_flash_shutdown.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/${efr32_family}/${efr32_board}/autogen/sl_uartdrv_init.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_usart/sl_memlcd_spi.c",
"${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) ||
Expand All @@ -557,6 +535,7 @@ template("efr32_sdk") {
"${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",
Expand Down

0 comments on commit 2258377

Please sign in to comment.