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 79931e3c609568..6645eeccb03096 100644 --- a/examples/platform/silabs/provision/BUILD.gn +++ b/examples/platform/silabs/provision/BUILD.gn @@ -40,6 +40,9 @@ source_set("storage") { libs = [ "${sl_provision_root}/libs/libProvision_si917.a" ] } } else { + if (silabs_family == "mgm26") { + silabs_family = "efr32mg26" + } if (use_provision_flash_storage) { libs = [ "${sl_provision_root}/libs/libProvisionFlash_${silabs_family}.a" ] 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 32c542b3efc4d5..14010e8104d291 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 @@ -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 45f81cf18c1af6..dc059b4c231ebb 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 742da0a3b3dda4..1cb1c8a4baf43d 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") @@ -335,6 +335,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 += [ + "${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_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" ] + } else if (silabs_mcu == "MGM260PB32VNA") { + libs += [ "${matter_support_root}/sdk-copies/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm260pb32vna_gcc.a" ] + } + + defines += [ "MGM26" ] } if (use_wf200) { @@ -391,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", @@ -1057,6 +1075,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 2db499924fd24a..830b34f3630a6c 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 2db499924fd24a9ff045ad5831438ee79e46a8ac +Subproject commit 830b34f3630a6c324f03a576ee085a44599ca47b 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]