Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for BRD4350A, BRD4351A and BRD2709A #37305

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = [ "${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" ]
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 @@ -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
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
6 changes: 5 additions & 1 deletion scripts/examples/gn_silabs_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ if [ "$#" == "0" ]; then
BRD4317A
BRD4318A
BRD4319A
BRD4350A
BRD4351A
BRD2709A



<Build options> - optional noteworthy build options for EFR32
Expand Down Expand Up @@ -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
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, MGM260 or MGM240)',
'default': None,
'alias': ['-d'],
'argparse': {
Expand Down
3 changes: 3 additions & 0 deletions third_party/silabs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down
Loading
Loading