diff --git a/.github/silabs-builds-mg26.json b/.github/silabs-builds-mg26.json index 6a00fd7154c..a301e56dedb 100644 --- a/.github/silabs-builds-mg26.json +++ b/.github/silabs-builds-mg26.json @@ -1,7 +1,7 @@ { "default": [ { - "boards": ["BRD4116A", "BRD4117A", "BRD4118A", "BRD2608A"], + "boards": ["BRD2709A","BRD4116A", "BRD4117A", "BRD4118A", "BRD2608A"], "arguments": ["--docker"] } ] diff --git a/.github/silabs-builds-mgm26.json b/.github/silabs-builds-mgm26.json new file mode 100644 index 00000000000..42da4c0cd6d --- /dev/null +++ b/.github/silabs-builds-mgm26.json @@ -0,0 +1,8 @@ +{ + "default": [ + { + "boards": ["BRD4350A","BRD4351A"], + "arguments": ["--docker"] + } + ] +} \ No newline at end of file diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index bed526f1c14..2c2bcfe465f 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -41,7 +41,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-efr32:95 + image: ghcr.io/project-chip/chip-build-efr32:101 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index 6df4cdefc7a..29502ca15cc 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -64,7 +64,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-efr32:97 + image: ghcr.io/project-chip/chip-build-efr32:101 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/silabs-common-build.yaml b/.github/workflows/silabs-common-build.yaml index f7b2b19db36..fb968931e97 100644 --- a/.github/workflows/silabs-common-build.yaml +++ b/.github/workflows/silabs-common-build.yaml @@ -15,11 +15,11 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-efr32:95 + image: ghcr.io/project-chip/chip-build-efr32:101 strategy: matrix: - platform: [mg24, mgm24, mg26, siwx] + platform: [mg24, mgm24, mg26, mgm26, siwx] steps: - name: Checkout @@ -38,6 +38,7 @@ jobs: ${{ matrix.platform == 'mg24' && './.github/silabs-builds-mg24.json' || matrix.platform == 'mgm24' && './.github/silabs-builds-mgm24.json' || matrix.platform == 'mg26' && './.github/silabs-builds-mg26.json' || + matrix.platform == 'mgm26' && './.github/silabs-builds-mgm26.json' || matrix.platform == 'siwx' && './.github/silabs-builds-siwx.json' }} example-app: ${{ inputs.example-app }} build-script: "./scripts/examples/gn_silabs_example.sh" diff --git a/examples/platform/silabs/ldscripts/mgm26.ld b/examples/platform/silabs/ldscripts/mgm26.ld new file mode 100644 index 00000000000..fccededc141 --- /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 1ab4744a2e1..abcef208b04 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 ef34fb6e480..7584bb918e4 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 26944e6a724..716a02a3bd5 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 96a6f218d77..943ec2f3532 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/flashing/silabs_firmware_utils.py b/scripts/flashing/silabs_firmware_utils.py index bd7b64cf021..08e6f9a02c5 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 b1f7b6bd5e2..151de6a9f5a 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 efr32mg24 as mgm24 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 73a55503879..5069128dafa 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_module_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 7ad2bdc6c2c..c11fffc6b33 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 7ad2bdc6c2c100ee6775b76b6cd055c40d29e117 +Subproject commit c11fffc6b33392f3fb84fc178d5fc211f47c6c57 diff --git a/third_party/silabs/silabs_arm.gni b/third_party/silabs/silabs_arm.gni index f5e77f0d3ee..473b436f987 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 6385a880a47..82288b0d505 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 81e2fe25719..c8d7c497582 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]