From 187365d2609d27948a1f67d715f8fadd7303c84a Mon Sep 17 00:00:00 2001 From: Sarthak Shaha Date: Tue, 4 Feb 2025 11:04:53 -0500 Subject: [PATCH 1/4] caracal support --- examples/platform/silabs/ldscripts/mgm26.ld | 261 ++++++++++++++++++ examples/platform/silabs/provision/BUILD.gn | 3 + scripts/build/build/targets.py | 3 + scripts/build/builders/efr32.py | 9 + .../build/testdata/all_targets_linux_x64.txt | 2 +- scripts/examples/gn_silabs_example.sh | 238 ++++++++-------- scripts/flashing/silabs_firmware_utils.py | 2 +- third_party/silabs/BUILD.gn | 3 + third_party/silabs/efr32_sdk.gni | 28 +- third_party/silabs/matter_support | 2 +- third_party/silabs/silabs_arm.gni | 2 +- third_party/silabs/silabs_board.gni | 24 +- third_party/silabs/slc_gen/run_slc.py | 2 +- 13 files changed, 454 insertions(+), 125 deletions(-) create mode 100644 examples/platform/silabs/ldscripts/mgm26.ld diff --git a/examples/platform/silabs/ldscripts/mgm26.ld b/examples/platform/silabs/ldscripts/mgm26.ld new file mode 100644 index 00000000000000..fccededc141b0a --- /dev/null +++ b/examples/platform/silabs/ldscripts/mgm26.ld @@ -0,0 +1,261 @@ +/***************************************************************************//** + * GCC Linker script for Silicon Labs devices + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + + MEMORY + { + FLASH (rx) : ORIGIN = 0x8006000, LENGTH = 0x318000 + RAM (rwx) : ORIGIN = 0x20000004, LENGTH = 0x7fffc + BOOTLOADER_RESET_REGION (rwx) : ORIGIN = 0x20000000, LENGTH = 0x4 + } + +ENTRY(Reset_Handler) + +SECTIONS +{ + + .vectors : + { + linker_vectors_begin = .; + KEEP(*(.vectors)) + linker_vectors_end = .; + + __Vectors_End = .; + __Vectors_Size = __Vectors_End - __Vectors; + __lma_ramfuncs_start__ = .; + } > FLASH + .bootloader_reset_section (NOLOAD): + { + __ResetReasonStart__ = .; + . = . + 4; + . = ALIGN(4); + __ResetReasonEnd__ = .; + } > BOOTLOADER_RESET_REGION + + .stack (NOLOAD): + { + . = ALIGN(8); + __StackLimit = .; + KEEP(*(.stack*)) + . = ALIGN(4); + __StackTop = .; + PROVIDE(__stack = __StackTop); + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(SORT_BY_ALIGNMENT(.bss*)) + *(COMMON) + . = ALIGN(32); + __bss_end__ = .; + } > RAM + + + .noinit (NOLOAD): + { + *(.noinit*); + . = ALIGN(32); + } > RAM + + + text_application_ram : + { + . = ALIGN(32); + __vma_ramfuncs_start__ = .; + __text_application_ram_start__ = .; + + *(text_application_ram) + + . = ALIGN(32); + __vma_ramfuncs_end__ = .; + __text_application_ram_end__ = .; + } > RAM AT > FLASH + + .rodata : + { + __lma_ramfuncs_end__ = .; + __rodata_start__ = .; + __rodata_end__ = .; + } > FLASH + + .text : + { + linker_code_begin = .; + *(SORT_BY_ALIGNMENT(.text*)) + *(SORT_BY_ALIGNMENT(text_*)) + . = ALIGN(32); + linker_code_end = .; + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + *(.eh_frame*) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + + LONG (__etext) + LONG (__data_start__) + LONG ((__data_end__ - __data_start__) / 4) + + /* Add each additional data section here */ + /* + LONG (__etext2) + LONG (__data2_start__) + LONG ((__data2_end__ - __data2_start__) / 4) + */ + + __copy_table_end__ = .; + } > FLASH + + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + /* Add each additional bss section here */ + /* + LONG (__bss2_start__) + LONG ((__bss2_end__ - __bss2_start__) / 4) + */ + + __zero_table_end__ = .; + __etext = .; + } > FLASH + + .data : + { + . = ALIGN(4); + __data_start__ = .; + *(vtable) + *(SORT_BY_ALIGNMENT(.data*)) + . = ALIGN(4); + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + . = ALIGN(4); + /* All data end */ + __data_end__ = .; + + } > RAM AT > FLASH + + +/* Calculate heap size based on RAM limits. */ +heap_limit = ORIGIN(RAM) + LENGTH(RAM); /* End of RAM */ +heap_size = heap_limit - __HeapBase; + .memory_manager_heap (NOLOAD): + { + . = ALIGN(8); + __HeapBase = .; + . += heap_size; + __end__ = .; + end = __end__; + _end = __end__; + KEEP(*(.memory_manager_heap*)) + __HeapLimit = ORIGIN(RAM) + LENGTH(RAM); + } > RAM + + __heap_size = __HeapLimit - __HeapBase; + __ram_end__ = 0x20000004 + 0x7fffc; + __main_flash_end__ = 0x8006000 + 0x318000; + + /* This is where we handle flash storage blocks. We use dummy sections for finding the configured + * block sizes and then "place" them at the end of flash when the size is known. */ + .internal_storage (DSECT) : { + KEEP(*(.internal_storage*)) + } > FLASH + + + .nvm (DSECT) : { + KEEP(*(.simee*)) + } > FLASH + + __ramfuncs_start__ = __vma_ramfuncs_start__; + __ramfuncs_end__ = __vma_ramfuncs_end__; + + linker_nvm_end = __main_flash_end__; + linker_nvm_begin = linker_nvm_end - SIZEOF(.nvm); + linker_storage_end = linker_nvm_begin; + __nvm3Base = linker_nvm_begin; + + linker_storage_begin = linker_storage_end - SIZEOF(.internal_storage); + ASSERT((linker_storage_begin >= (__etext + SIZEOF(.data))), "FLASH memory overflowed !") + + + app_flash_end = 0x8006000 + 0x318000; + ASSERT( (linker_nvm_begin + SIZEOF(.nvm)) <= app_flash_end, "NVM3 is excessing the flash size !") +} diff --git a/examples/platform/silabs/provision/BUILD.gn b/examples/platform/silabs/provision/BUILD.gn index 1ab4744a2e12e4..abcef208b04957 100644 --- a/examples/platform/silabs/provision/BUILD.gn +++ b/examples/platform/silabs/provision/BUILD.gn @@ -40,6 +40,9 @@ source_set("storage") { libs = [ "${sdk_support_root}/matter/provision/lib/libProvision_si917.a" ] } } else { + if (silabs_family == "mgm26") { + silabs_family = "efr32mg26" + } if (use_provision_flash_storage) { libs = [ "${sdk_support_root}/matter/provision/lib/libProvisionFlash_${silabs_family}.a" ] } else { diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 3611e7372cb3c9..4d3a8125ae6fd4 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -258,6 +258,9 @@ def BuildEfr32Target(): TargetPart('brd2605a', board=Efr32Board.BRD2605A, enable_wifi=True, enable_917_soc=True), TargetPart('brd4343a', board=Efr32Board.BRD4343A, enable_wifi=True, enable_917_soc=True), TargetPart('brd4342a', board=Efr32Board.BRD4342A, enable_wifi=True, enable_917_soc=True), + TargetPart('brd4350a', board=Efr32Board.BRD4350A), + TargetPart('brd4351a', board=Efr32Board.BRD4351A), + TargetPart('brd2709a', board=Efr32Board.BRD2709A), ]) # apps diff --git a/scripts/build/builders/efr32.py b/scripts/build/builders/efr32.py index 26944e6a724653..716a02a3bd5f4a 100644 --- a/scripts/build/builders/efr32.py +++ b/scripts/build/builders/efr32.py @@ -114,6 +114,9 @@ class Efr32Board(Enum): BRD2605A = 13 BRD4343A = 14 BRD4342A = 15 + BRD4350A = 16 + BRD4351A = 17 + BRD2709A = 18 def GnArgName(self): if self == Efr32Board.BRD2704B: @@ -146,6 +149,12 @@ def GnArgName(self): return 'BRD4343A' elif self == Efr32Board.BRD4342A: return 'BRD4342A' + elif self == Efr32Board.BRD4350A: + return 'BRD4350A' + elif self == Efr32Board.BRD4351A: + return 'BRD4351A' + elif self == Efr32Board.BRD2709A: + return 'BRD2709A' else: raise Exception('Unknown board #: %r' % self) diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 590844271d3ba6..c6f12f2141fe02 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -5,7 +5,7 @@ bouffalolab-{bl602dk,bl616dk,bl704ldk,bl706dk,bl602-night-light,bl706-night-ligh cc32xx-{lock,air-purifier} ti-cc13x4_26x4-{lighting,lock,pump,pump-controller}[-mtd][-ftd] cyw30739-{cyw30739b2_p5_evk_01,cyw30739b2_p5_evk_02,cyw30739b2_p5_evk_03,cyw930739m2evb_01,cyw930739m2evb_02}-{light,light-switch,lock,thermostat} -efr32-{brd2704b,brd4316a,brd4317a,brd4318a,brd4319a,brd4186a,brd4187a,brd2601b,brd4187c,brd4186c,brd2703a,brd4338a,brd2605a,brd4343a,brd4342a}-{window-covering,switch,unit-test,light,lock,thermostat,pump,air-quality-sensor-app}[-rpc][-with-ota-requestor][-icd][-low-power][-shell][-no-logging][-openthread-mtd][-heap-monitoring][-no-openthread-cli][-show-qr-code][-wifi][-rs9116][-wf200][-siwx917][-ipv4][-additional-data-advertising][-use-ot-lib][-use-ot-coap-lib][-no-version][-skip-rps-generation] +efr32-{brd2704b,brd4316a,brd4317a,brd4318a,brd4319a,brd4186a,brd4187a,brd2601b,brd4187c,brd4186c,brd2703a,brd4338a,brd2605a,brd4343a,brd4342a,brd4350a,brd4351a,brd2709a}-{window-covering,switch,unit-test,light,lock,thermostat,pump,air-quality-sensor-app}[-rpc][-with-ota-requestor][-icd][-low-power][-shell][-no-logging][-openthread-mtd][-heap-monitoring][-no-openthread-cli][-show-qr-code][-wifi][-rs9116][-wf200][-siwx917][-ipv4][-additional-data-advertising][-use-ot-lib][-use-ot-coap-lib][-no-version][-skip-rps-generation] esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,energy-management,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only][-tracing] genio-lighting-app linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-pw-fuzztest][-coverage][-dmalloc][-clang] diff --git a/scripts/examples/gn_silabs_example.sh b/scripts/examples/gn_silabs_example.sh index 11f65022709a30..87a0e05e05def5 100755 --- a/scripts/examples/gn_silabs_example.sh +++ b/scripts/examples/gn_silabs_example.sh @@ -77,6 +77,10 @@ if [ "$#" == "0" ]; then BRD4317A BRD4318A BRD4319A + BRD4350A + BRD4351A + BRD2709A + - optional noteworthy build options for EFR32 @@ -182,123 +186,123 @@ else shift while [ $# -gt 0 ]; do case $1 in - --clean) - DIR_CLEAN=true - shift - ;; - --wifi) - if [ -z "$2" ]; then - echo "--wifi requires rs9116 or SiWx917 or wf200" - exit 1 - fi - - if [ "$2" = "rs9116" ]; then - optArgs+="use_rs9116=true " - elif [ "$2" = "SiWx917" ]; then - optArgs+="use_SiWx917=true " - elif [ "$2" = "wf200" ]; then - optArgs+="use_wf200=true " - else - echo "Wifi usage: --wifi rs9116|SiWx917|wf200" - exit 1 - fi - - NCP_DIR_SUFFIX="/"$2 + --clean) + DIR_CLEAN=true + shift + ;; + --wifi) + if [ -z "$2" ]; then + echo "--wifi requires rs9116 or SiWx917 or wf200" + exit 1 + fi + + if [ "$2" = "rs9116" ]; then + optArgs+="use_rs9116=true " + elif [ "$2" = "SiWx917" ]; then + optArgs+="use_SiWx917=true " + elif [ "$2" = "wf200" ]; then + optArgs+="use_wf200=true " + else + echo "Wifi usage: --wifi rs9116|SiWx917|wf200" + exit 1 + fi + + NCP_DIR_SUFFIX="/"$2 + USE_WIFI=true + optArgs+="chip_device_platform =\"efr32\" chip_crypto_keystore=\"psa\" " + shift + shift + ;; + --icd) + optArgs+="chip_enable_icd_server=true chip_openthread_ftd=false sl_enable_test_event_trigger=true " + shift + ;; + --low-power) + optArgs+="chip_build_libshell=false enable_openthread_cli=false show_qr_code=false disable_lcd=true " + shift + ;; + --chip_enable_wifi_ipv4) + optArgs="chip_enable_wifi_ipv4=true chip_inet_config_enable_ipv4=true " + shift + ;; + --additional_data_advertising) + optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true " + shift + ;; + --use_ot_lib) + optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" " + shift + ;; + --use_ot_coap_lib) + optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" use_thread_coap_lib=true " + shift + ;; + --use_chip_lwip_lib) + optArgs+="lwip_root=\""//third_party/connectedhomeip/third_party/lwip"\" " + shift + ;; + # Option not to be used until ot-efr32 github is updated + # --use_ot_github_sources) + # optArgs+="openthread_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/openthread\" openthread_efr32_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/src/src\"" + # shift + # ;; + --release) + optArgs+="is_debug=false disable_lcd=true chip_build_libshell=false enable_openthread_cli=false use_external_flash=false chip_logging=false silabs_log_enabled=false " + shift + ;; + --bootloader) + USE_BOOTLOADER=true + shift + ;; + --docker) + optArgs+="efr32_sdk_root=\"$GSDK_ROOT\" " + optArgs+="wiseconnect_sdk_root=\"$WISECONNECT_SDK_ROOT\" " + optArgs+="wifi_sdk_root=\"$WIFI_SDK_ROOT\" " + USE_DOCKER=true + shift + ;; + --uart_log) + optArgs+="sl_uart_log_output=true " + shift + ;; + + --slc_generate) + optArgs+="slc_generate=true " + USE_SLC=true + shift + ;; + --use_pw_rpc) + optArgs+="import(\"//with_pw_rpc.gni\") " + shift + ;; + --slc_reuse_files) + optArgs+="slc_reuse_files=true " + shift + ;; + --gn_path) + if [ -z "$2" ]; then + echo "--gn_path requires a path to GN" + exit 1 + else + GN_PATH="$2" + fi + shift + shift + ;; + *"sl_matter_version_str="*) + optArgs+="$1 " + USE_GIT_SHA_FOR_VERSION=false + shift + ;; + *) + if [ "$1" =~ *"use_rs9116=true"* ] || [ "$1" =~ *"use_SiWx917=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then USE_WIFI=true - optArgs+="chip_device_platform =\"efr32\" chip_crypto_keystore=\"psa\" " - shift - shift - ;; - --icd) - optArgs+="chip_enable_icd_server=true chip_openthread_ftd=false sl_enable_test_event_trigger=true " - shift - ;; - --low-power) - optArgs+="chip_build_libshell=false enable_openthread_cli=false show_qr_code=false disable_lcd=true " - shift - ;; - --chip_enable_wifi_ipv4) - optArgs="chip_enable_wifi_ipv4=true chip_inet_config_enable_ipv4=true " - shift - ;; - --additional_data_advertising) - optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true " - shift - ;; - --use_ot_lib) - optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" " - shift - ;; - --use_ot_coap_lib) - optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" use_thread_coap_lib=true " - shift - ;; - --use_chip_lwip_lib) - optArgs+="lwip_root=\""//third_party/connectedhomeip/third_party/lwip"\" " - shift - ;; - # Option not to be used until ot-efr32 github is updated - # --use_ot_github_sources) - # optArgs+="openthread_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/openthread\" openthread_efr32_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/src/src\"" - # shift - # ;; - --release) - optArgs+="is_debug=false disable_lcd=true chip_build_libshell=false enable_openthread_cli=false use_external_flash=false chip_logging=false silabs_log_enabled=false " - shift - ;; - --bootloader) - USE_BOOTLOADER=true - shift - ;; - --docker) - optArgs+="efr32_sdk_root=\"$GSDK_ROOT\" " - optArgs+="wiseconnect_sdk_root=\"$WISECONNECT_SDK_ROOT\" " - optArgs+="wifi_sdk_root=\"$WIFI_SDK_ROOT\" " - USE_DOCKER=true - shift - ;; - --uart_log) - optArgs+="sl_uart_log_output=true " - shift - ;; - - --slc_generate) - optArgs+="slc_generate=true " - USE_SLC=true - shift - ;; - --use_pw_rpc) - optArgs+="import(\"//with_pw_rpc.gni\") " - shift - ;; - --slc_reuse_files) - optArgs+="slc_reuse_files=true " - shift - ;; - --gn_path) - if [ -z "$2" ]; then - echo "--gn_path requires a path to GN" - exit 1 - else - GN_PATH="$2" - fi - shift - shift - ;; - *"sl_matter_version_str="*) - optArgs+="$1 " - USE_GIT_SHA_FOR_VERSION=false - shift - ;; - *) - if [ "$1" =~ *"use_rs9116=true"* ] || [ "$1" =~ *"use_SiWx917=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then - USE_WIFI=true - # NCP Mode so base MCU is an EFR32 - optArgs+="chip_device_platform =\"efr32\" " - fi - optArgs+=$1" " - shift - ;; + # NCP Mode so base MCU is an EFR32 + optArgs+="chip_device_platform =\"efr32\" " + fi + optArgs+=$1" " + shift + ;; esac done @@ -363,7 +367,7 @@ else if [ "$USE_BOOTLOADER" == true ]; then binName="" - InternalBootloaderBoards=("BRD4337A" "BRD2704A" "BRD2703A" "BRD4319A") + InternalBootloaderBoards=("BRD4337A" "BRD2704A" "BRD2703A" "BRD4319A","BRD4350A","BRD4351A","BRD2709A") bootloaderPath="" commanderPath="" # find the matter root folder diff --git a/scripts/flashing/silabs_firmware_utils.py b/scripts/flashing/silabs_firmware_utils.py index bd7b64cf021bcd..08e6f9a02c5fba 100755 --- a/scripts/flashing/silabs_firmware_utils.py +++ b/scripts/flashing/silabs_firmware_utils.py @@ -79,7 +79,7 @@ """, }, 'device': { - 'help': 'Device family or platform to target (EFR32 or MGM240)', + 'help': 'Device family or platform to target (EFR32, MGM260 or MGM240)', 'default': None, 'alias': ['-d'], 'argparse': { diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index b1f7b6bd5e2b78..7a5872c14f5d10 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -247,6 +247,9 @@ if (wifi_soc != true) { # CCP board if (silabs_family == "mgm24") { # Locally set silabs_family to efr32mg24 as mgm24 doesn't have dedicated libsl_ot_stack lib silabs_family = "efr32mg24" + } else if (silabs_family == "mgm26") { + # Locally set silabs_family to efr32mg26 as mgm26 doesn't have dedicated libsl_ot_stack lib + silabs_family = "efr32mg26" } libs = [ "${sl_ot_libs_path}/libs/libsl_ot_stack_${XTD}_${COAP_API}${silabs_family}_gcc.a" ] diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 73a55503879a46..c200e5b996c100 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -99,7 +99,7 @@ silabs_common_plat_dir = "${chip_root}/examples/platform/silabs" silabs_platform_dir = "${chip_root}/src/platform/silabs" is_series_2 = silabs_family == "mgm24" || silabs_family == "efr32mg24" || - silabs_family == "efr32mg26" + silabs_family == "efr32mg26" || silabs_family == "mgm26" assert(efr32_sdk_root != "", "efr32_sdk_root must be specified") @@ -336,6 +336,24 @@ template("efr32_sdk") { ] defines += [ "EFR32MG26" ] + } else if (silabs_family == "mgm26") { + _include_dirs += [ + "${efr32_sdk_root}/platform/Device/SiliconLabs/MGM26/Include", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg26", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg26/config", + ] + + libs += [ + "${sdk_support_root}/protocol/bluetooth/bgstack/ll/build/gcc/xg26/release/liblinklayer.a", + "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg26_gcc_release.a", + ] + if (silabs_mcu == "MGM260PB22VNA") { + libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm260pb22vna_gcc.a" ] + } else if (silabs_mcu == "MGM260PB32VNA") { + libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm260pb32vna_gcc.a" ] + } + + defines += [ "MGM26" ] } if (use_wf200) { @@ -1058,6 +1076,14 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/service/device_manager/clocks/sl_device_clock_efr32xg26.c", "${efr32_sdk_root}/platform/service/device_manager/devices/sl_device_peripheral_hal_efr32xg26.c", ] + } else if (silabs_family == "mgm26") { + sources += [ + "${efr32_sdk_root}/platform/Device/SiliconLabs/MGM26/Source/startup_mgm26.c", + "${efr32_sdk_root}/platform/Device/SiliconLabs/MGM26/Source/system_mgm26.c", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/fem_util/sl_fem_util.c", + "${efr32_sdk_root}/platform/service/device_manager/clocks/sl_device_clock_efr32xg26.c", + "${efr32_sdk_root}/platform/service/device_manager/devices/sl_device_peripheral_hal_efr32xg26.c", + ] } if (is_series_2) { diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index 7ad2bdc6c2c100..2bf74550bff317 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 7ad2bdc6c2c100ee6775b76b6cd055c40d29e117 +Subproject commit 2bf74550bff3174ffb42ef6b1b0bdc5aa2ddfa94 diff --git a/third_party/silabs/silabs_arm.gni b/third_party/silabs/silabs_arm.gni index f5e77f0d3ee736..473b436f9876a1 100644 --- a/third_party/silabs/silabs_arm.gni +++ b/third_party/silabs/silabs_arm.gni @@ -21,7 +21,7 @@ if (silabs_family == "SiWx917-common") { arm_float_abi = "softfp" arm_fpu = "fpv4-sp-d16" } else if (silabs_family == "efr32mg24" || silabs_family == "mgm24" || - silabs_family == "efr32mg26") { + silabs_family == "efr32mg26" || silabs_family == "mgm26") { arm_arch = "armv8-m.main+dsp" arm_abi = "aapcs" arm_cpu = "cortex-m33" diff --git a/third_party/silabs/silabs_board.gni b/third_party/silabs/silabs_board.gni index 6385a880a47ff6..82288b0d505253 100644 --- a/third_party/silabs/silabs_board.gni +++ b/third_party/silabs/silabs_board.gni @@ -25,7 +25,7 @@ declare_args() { silabs_mcu = "" # LCD is enabled by default - # Boards BRD4166A, BRD2601B, BRD2703A and BRD4319A do not have a LCD so they disable it explicitly + # Boards BRD4166A, BRD2601B, BRD2703A, BRD2709A and BRD4319A do not have a LCD so they disable it explicitly disable_lcd = false # Enable Buttons by default @@ -35,7 +35,7 @@ declare_args() { # Boards BRD4317A, BRD4316A and BRD4319A disable this explicitly use_wstk_leds = true - # Boards BRD2703A and BRD4319A disable this explicitly + # Boards BRD2703A, BRD4350A, BRD4351A, BRD2709A and BRD4319A disable this explicitly use_external_flash = true # WIFI rcp boards options for wifi apps. @@ -174,6 +174,14 @@ if (silabs_board == "BRD4338A" || silabs_board == "BRD2605A" || } else if (silabs_board == "BRD4116A") { silabs_family = "efr32mg26" silabs_mcu = "EFR32MG26B410F3200IM48" +} else if (silabs_board == "BRD2709A") { + silabs_family = "efr32mg26" + silabs_mcu = "EFR32MG26B510F3200IM48" + + # BRD2709A do not have an external flash and lcd + show_qr_code = false + disable_lcd = true + use_external_flash = false } else if (silabs_board == "BRD4117A") { silabs_family = "efr32mg26" silabs_mcu = "EFR32MG26B420F3200IM48" @@ -187,6 +195,18 @@ if (silabs_board == "BRD4338A" || silabs_board == "BRD2605A" || # ThunderBoards don't have a LCD, show_qr_code = false disable_lcd = true +} else if (silabs_board == "BRD4350A") { + silabs_family = "mgm26" + silabs_mcu = "MGM260PB22VNA" + + # MGM260 do not have an external flash + use_external_flash = false +} else if (silabs_board == "BRD4351A") { + silabs_family = "mgm26" + silabs_mcu = "MGM260PB32VNA" + + # MGM260 do not have an external flash + use_external_flash = false # Custom Board ---------- } else if (silabs_board == "CUSTOM") { diff --git a/third_party/silabs/slc_gen/run_slc.py b/third_party/silabs/slc_gen/run_slc.py index 81e2fe25719fea..c8d7c497582ade 100644 --- a/third_party/silabs/slc_gen/run_slc.py +++ b/third_party/silabs/slc_gen/run_slc.py @@ -18,7 +18,7 @@ def isMG24(partnumber): def isMG26(partnumber): - return ("EFR32MG26" in partnumber) + return ("EFR32MG26" in partnumber or "MGM260" in partnumber) root_path = sys.argv[1] From e8146d87bbdfa490776ca377b7f5682dd4162f94 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Mon, 10 Feb 2025 15:42:21 +0000 Subject: [PATCH 2/4] minor fix --- scripts/examples/gn_silabs_example.sh | 234 +++++++++++++------------- third_party/silabs/efr32_sdk.gni | 8 +- third_party/silabs/matter_support | 2 +- 3 files changed, 122 insertions(+), 122 deletions(-) diff --git a/scripts/examples/gn_silabs_example.sh b/scripts/examples/gn_silabs_example.sh index b1587aa04321ed..14010e8104d291 100755 --- a/scripts/examples/gn_silabs_example.sh +++ b/scripts/examples/gn_silabs_example.sh @@ -80,7 +80,7 @@ if [ "$#" == "0" ]; then BRD4350A BRD4351A BRD2709A - + - optional noteworthy build options for EFR32 @@ -186,123 +186,123 @@ else shift while [ $# -gt 0 ]; do case $1 in - --clean) - DIR_CLEAN=true - shift - ;; - --wifi) - if [ -z "$2" ]; then - echo "--wifi requires rs9116 or SiWx917 or wf200" - exit 1 - fi - - if [ "$2" = "rs9116" ]; then - optArgs+="use_rs9116=true " - elif [ "$2" = "SiWx917" ]; then - optArgs+="use_SiWx917=true " - elif [ "$2" = "wf200" ]; then - optArgs+="use_wf200=true " - else - echo "Wifi usage: --wifi rs9116|SiWx917|wf200" - exit 1 - fi - - NCP_DIR_SUFFIX="/"$2 - USE_WIFI=true - optArgs+="chip_device_platform =\"efr32\" chip_crypto_keystore=\"psa\" " - shift - shift - ;; - --icd) - optArgs+="chip_enable_icd_server=true chip_openthread_ftd=false sl_enable_test_event_trigger=true " - shift - ;; - --low-power) - optArgs+="chip_build_libshell=false enable_openthread_cli=false show_qr_code=false disable_lcd=true " - shift - ;; - --chip_enable_wifi_ipv4) - optArgs="chip_enable_wifi_ipv4=true chip_inet_config_enable_ipv4=true " - shift - ;; - --additional_data_advertising) - optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true " - shift - ;; - --use_ot_lib) - optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" " - shift - ;; - --use_ot_coap_lib) - optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" use_thread_coap_lib=true " - shift - ;; - --use_chip_lwip_lib) - optArgs+="lwip_root=\""//third_party/connectedhomeip/third_party/lwip"\" " - shift - ;; - # Option not to be used until ot-efr32 github is updated - # --use_ot_github_sources) - # optArgs+="openthread_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/openthread\" openthread_efr32_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/src/src\"" - # shift - # ;; - --release) - optArgs+="is_debug=false disable_lcd=true chip_build_libshell=false enable_openthread_cli=false use_external_flash=false chip_logging=false silabs_log_enabled=false " - shift - ;; - --bootloader) - USE_BOOTLOADER=true - shift - ;; - --docker) - optArgs+="efr32_sdk_root=\"$GSDK_ROOT\" " - optArgs+="wiseconnect_sdk_root=\"$WISECONNECT_SDK_ROOT\" " - optArgs+="wifi_sdk_root=\"$WIFI_SDK_ROOT\" " - USE_DOCKER=true - shift - ;; - --uart_log) - optArgs+="sl_uart_log_output=true " - shift - ;; - - --slc_generate) - optArgs+="slc_generate=true " - USE_SLC=true - shift - ;; - --use_pw_rpc) - optArgs+="import(\"//with_pw_rpc.gni\") " - shift - ;; - --slc_reuse_files) - optArgs+="slc_reuse_files=true " - shift - ;; - --gn_path) - if [ -z "$2" ]; then - echo "--gn_path requires a path to GN" - exit 1 - else - GN_PATH="$2" - fi - shift - shift - ;; - *"sl_matter_version_str="*) - optArgs+="$1 " - USE_GIT_SHA_FOR_VERSION=false - shift - ;; - *) - if [ "$1" =~ *"use_rs9116=true"* ] || [ "$1" =~ *"use_SiWx917=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then + --clean) + DIR_CLEAN=true + shift + ;; + --wifi) + if [ -z "$2" ]; then + echo "--wifi requires rs9116 or SiWx917 or wf200" + exit 1 + fi + + if [ "$2" = "rs9116" ]; then + optArgs+="use_rs9116=true " + elif [ "$2" = "SiWx917" ]; then + optArgs+="use_SiWx917=true " + elif [ "$2" = "wf200" ]; then + optArgs+="use_wf200=true " + else + echo "Wifi usage: --wifi rs9116|SiWx917|wf200" + exit 1 + fi + + NCP_DIR_SUFFIX="/"$2 USE_WIFI=true - # NCP Mode so base MCU is an EFR32 - optArgs+="chip_device_platform =\"efr32\" " - fi - optArgs+=$1" " - shift - ;; + optArgs+="chip_device_platform =\"efr32\" chip_crypto_keystore=\"psa\" " + shift + shift + ;; + --icd) + optArgs+="chip_enable_icd_server=true chip_openthread_ftd=false sl_enable_test_event_trigger=true " + shift + ;; + --low-power) + optArgs+="chip_build_libshell=false enable_openthread_cli=false show_qr_code=false disable_lcd=true " + shift + ;; + --chip_enable_wifi_ipv4) + optArgs="chip_enable_wifi_ipv4=true chip_inet_config_enable_ipv4=true " + shift + ;; + --additional_data_advertising) + optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true " + shift + ;; + --use_ot_lib) + optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" " + shift + ;; + --use_ot_coap_lib) + optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" use_thread_coap_lib=true " + shift + ;; + --use_chip_lwip_lib) + optArgs+="lwip_root=\""//third_party/connectedhomeip/third_party/lwip"\" " + shift + ;; + # Option not to be used until ot-efr32 github is updated + # --use_ot_github_sources) + # optArgs+="openthread_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/openthread\" openthread_efr32_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/src/src\"" + # shift + # ;; + --release) + optArgs+="is_debug=false disable_lcd=true chip_build_libshell=false enable_openthread_cli=false use_external_flash=false chip_logging=false silabs_log_enabled=false " + shift + ;; + --bootloader) + USE_BOOTLOADER=true + shift + ;; + --docker) + optArgs+="efr32_sdk_root=\"$GSDK_ROOT\" " + optArgs+="wiseconnect_sdk_root=\"$WISECONNECT_SDK_ROOT\" " + optArgs+="wifi_sdk_root=\"$WIFI_SDK_ROOT\" " + USE_DOCKER=true + shift + ;; + --uart_log) + optArgs+="sl_uart_log_output=true " + shift + ;; + + --slc_generate) + optArgs+="slc_generate=true " + USE_SLC=true + shift + ;; + --use_pw_rpc) + optArgs+="import(\"//with_pw_rpc.gni\") " + shift + ;; + --slc_reuse_files) + optArgs+="slc_reuse_files=true " + shift + ;; + --gn_path) + if [ -z "$2" ]; then + echo "--gn_path requires a path to GN" + exit 1 + else + GN_PATH="$2" + fi + shift + shift + ;; + *"sl_matter_version_str="*) + optArgs+="$1 " + USE_GIT_SHA_FOR_VERSION=false + shift + ;; + *) + if [ "$1" =~ *"use_rs9116=true"* ] || [ "$1" =~ *"use_SiWx917=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then + USE_WIFI=true + # NCP Mode so base MCU is an EFR32 + optArgs+="chip_device_platform =\"efr32\" " + fi + optArgs+=$1" " + shift + ;; esac done diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index b3c5674eef545d..f9da3a1afd9dc4 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -343,13 +343,13 @@ template("efr32_sdk") { ] libs += [ - "${sdk_support_root}/protocol/bluetooth/bgstack/ll/build/gcc/xg26/release/liblinklayer.a", - "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg26_gcc_release.a", + "${matter_support_root}/protocol/bluetooth/bgstack/ll/build/gcc/xg26/release/liblinklayer.a", + "${matter_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg26_gcc_release.a", ] if (silabs_mcu == "MGM260PB22VNA") { - libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm260pb22vna_gcc.a" ] + libs += [ "${matter_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm260pb22vna_gcc.a" ] } else if (silabs_mcu == "MGM260PB32VNA") { - libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm260pb32vna_gcc.a" ] + libs += [ "${matter_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm260pb32vna_gcc.a" ] } defines += [ "MGM26" ] diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index 2bf74550bff317..1ad8c93b5e8b55 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 2bf74550bff3174ffb42ef6b1b0bdc5aa2ddfa94 +Subproject commit 1ad8c93b5e8b5529b888d3b41a8204dab9d89204 From 1611fae42f1ab08c5dd335f0bdaa5426c4f8a148 Mon Sep 17 00:00:00 2001 From: Sarthak Shaha Date: Mon, 10 Feb 2025 11:11:51 -0500 Subject: [PATCH 3/4] minor fix --- third_party/silabs/efr32_sdk.gni | 8 ++++---- third_party/silabs/matter_support | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index f9da3a1afd9dc4..ed0317fd6e1ac0 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -343,13 +343,13 @@ template("efr32_sdk") { ] libs += [ - "${matter_support_root}/protocol/bluetooth/bgstack/ll/build/gcc/xg26/release/liblinklayer.a", - "${matter_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg26_gcc_release.a", + "${matter_support_root}/sdk-copies/protocol/bluetooth/bgstack/ll/build/gcc/xg26/release/liblinklayer.a", + "${matter_support_root}/sdk-copies/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg26_gcc_release.a", ] if (silabs_mcu == "MGM260PB22VNA") { - libs += [ "${matter_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm260pb22vna_gcc.a" ] + libs += [ "${matter_support_root}/sdk-copies/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm260pb22vna_gcc.a" ] } else if (silabs_mcu == "MGM260PB32VNA") { - libs += [ "${matter_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm260pb32vna_gcc.a" ] + libs += [ "${matter_support_root}/sdk-copies/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm260pb32vna_gcc.a" ] } defines += [ "MGM26" ] diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index 1ad8c93b5e8b55..830b34f3630a6c 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 1ad8c93b5e8b5529b888d3b41a8204dab9d89204 +Subproject commit 830b34f3630a6c324f03a576ee085a44599ca47b From 81bc1a3be237d2eb3b2536d12e529a41b713f097 Mon Sep 17 00:00:00 2001 From: Sarthak Shaha Date: Mon, 10 Feb 2025 16:04:39 -0500 Subject: [PATCH 4/4] minor fix --- third_party/silabs/efr32_sdk.gni | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index ed0317fd6e1ac0..1cb1c8a4baf43d 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -344,7 +344,7 @@ template("efr32_sdk") { libs += [ "${matter_support_root}/sdk-copies/protocol/bluetooth/bgstack/ll/build/gcc/xg26/release/liblinklayer.a", - "${matter_support_root}/sdk-copies/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg26_gcc_release.a", + "${matter_support_root}/sdk-copies/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_module_efr32xg26_gcc_release.a", ] if (silabs_mcu == "MGM260PB22VNA") { libs += [ "${matter_support_root}/sdk-copies/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm260pb22vna_gcc.a" ] @@ -409,7 +409,7 @@ template("efr32_sdk") { _include_dirs += [ "${chip_root}/src/platform/silabs/wifi" ] } - if (silabs_family != "mgm24") { + if (silabs_family != "mgm24" && silabs_family != "mgm26") { _include_dirs += [ "${efr32_sdk_root}/platform/radio/rail_lib/hal", "${efr32_sdk_root}/platform/radio/rail_lib/hal/efr32",