Skip to content

Commit

Permalink
added support for BRD4350A, BRD4351A and BRD2709A
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarthak-Shaha committed Jan 29, 2025
1 parent ef193bc commit fe3fdc1
Show file tree
Hide file tree
Showing 12 changed files with 324 additions and 8 deletions.
261 changes: 261 additions & 0 deletions examples/platform/silabs/ldscripts/mgm26.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
/***************************************************************************//**
* GCC Linker script for Silicon Labs devices
*******************************************************************************
* # License
* <b>Copyright 2020 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* 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 !")
}
3 changes: 3 additions & 0 deletions examples/platform/silabs/provision/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ def BuildEfr32Target():
TargetPart('brd4187c', board=Efr32Board.BRD4187C),
TargetPart('brd4186c', board=Efr32Board.BRD4186C),
TargetPart('brd2703a', board=Efr32Board.BRD2703A),
TargetPart('brd4350a', board=Efr32Board.BRD4350A),
TargetPart('brd4351a', board=Efr32Board.BRD4351A),
TargetPart('brd2709a', board=Efr32Board.BRD2709A),
TargetPart('brd4338a', board=Efr32Board.BRD4338A, enable_wifi=True, enable_917_soc=True),
TargetPart('brd2605a', board=Efr32Board.BRD2605A, enable_wifi=True, enable_917_soc=True),
TargetPart('brd4343a', board=Efr32Board.BRD4343A, enable_wifi=True, enable_917_soc=True),
Expand Down
9 changes: 9 additions & 0 deletions scripts/build/builders/efr32.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion scripts/build/testdata/all_targets_linux_x64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion scripts/flashing/silabs_firmware_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
""",
},
'device': {
'help': 'Device family or platform to target (EFR32 or MGM240)',
'help': 'Device family or platform to target (EFR32,MG26, MGM260 or MGM240)',
'default': None,
'alias': ['-d'],
'argparse': {
Expand Down
4 changes: 3 additions & 1 deletion third_party/silabs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +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" ]
}
Expand Down
18 changes: 18 additions & 0 deletions third_party/silabs/efr32_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion third_party/silabs/matter_support
Submodule matter_support updated 231 files
2 changes: 1 addition & 1 deletion third_party/silabs/silabs_arm.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading

0 comments on commit fe3fdc1

Please sign in to comment.