-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SBT vs non-SBT Linkerfile Selection to MAX32672 LP Example (#401)
* Clean up script * Add secure vs non-secure linker selection * Revert "Clean up script" This reverts commit fcde559.
- Loading branch information
1 parent
c8cfd0c
commit d998f01
Showing
3 changed files
with
169 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
/******************************************************************************* | ||
* Copyright (C) 2017 Maxim Integrated Products, Inc., All Rights Reserved. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a | ||
* copy of this software and associated documentation files (the "Software"), | ||
* to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
* and/or sell copies of the Software, and to permit persons to whom the | ||
* Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included | ||
* in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES | ||
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
* OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
* Except as contained in this notice, the name of Maxim Integrated | ||
* Products, Inc. shall not be used except as stated in the Maxim Integrated | ||
* Products, Inc. Branding Policy. | ||
* | ||
* The mere transfer of this software does not imply any licenses | ||
* of trade secrets, proprietary technology, copyrights, patents, | ||
* trademarks, maskwork rights, or any other form of intellectual | ||
* property whatsoever. Maxim Integrated Products, Inc. retains all | ||
* ownership rights. | ||
* | ||
* $Date: 2016-05-02 14:15:59 -0700 (Mon, 02 May 2016) $ | ||
* $Revision: 22594 $ | ||
* | ||
******************************************************************************/ | ||
|
||
MEMORY { | ||
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 1024K /* 1024kB "FLASH" */ | ||
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 32K /* 32kB LP reduced SRAM with ECC */ | ||
/* SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 160K /* 160kB max SRAM with ECC */ | ||
/*^ If ECC is enabled, the stack size must be reduced. Otherwise, a | ||
HardFault will occur on startup as the stack is expanded into the | ||
ECC's reserved SRAM space. | ||
*/ | ||
/* SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 200K /* 200kB SRAM, no ECC */ | ||
} | ||
|
||
SECTIONS { | ||
|
||
.text : | ||
{ | ||
_text = .; | ||
KEEP(*(.isr_vector)) | ||
*(.text*) /* program code */ | ||
*(.rodata*) /* read-only data: "const" */ | ||
|
||
KEEP(*(.init)) | ||
KEEP(*(.fini)) | ||
|
||
/* C++ Exception handling */ | ||
KEEP(*(.eh_frame*)) | ||
_etext = .; | ||
} > FLASH | ||
|
||
/* Binary import */ | ||
.bin_storage : | ||
{ | ||
FILL(0xFF) | ||
_bin_start_ = .; | ||
KEEP(*(.bin_storage_img)) | ||
_bin_end_ = .; | ||
. = ALIGN(4); | ||
} > FLASH | ||
|
||
/* it's used for C++ exception handling */ | ||
/* we need to keep this to avoid overlapping */ | ||
.ARM.exidx : | ||
{ | ||
__exidx_start = .; | ||
*(.ARM.exidx*) | ||
__exidx_end = .; | ||
} > FLASH | ||
|
||
.data : | ||
{ | ||
_data = ALIGN(., 4); | ||
*(.data*) /*read-write initialized data: initialized global variable*/ | ||
*(.spix_config*) /* SPIX configuration functions need to be run from SRAM */ | ||
*(.flashprog*) /* Flash program */ | ||
|
||
/* These array sections are used by __libc_init_array to call static C++ constructors */ | ||
. = 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 = .); | ||
|
||
_edata = ALIGN(., 4); | ||
} > SRAM AT>FLASH | ||
__load_data = LOADADDR(.data); | ||
|
||
.bss : | ||
{ | ||
. = ALIGN(4); | ||
_bss = .; | ||
*(.bss*) /*read-write zero initialized data: uninitialzed global variable*/ | ||
*(COMMON) | ||
_ebss = ALIGN(., 4); | ||
} > SRAM | ||
|
||
/* Set stack top to end of RAM, and stack limit move down by | ||
* size of stack_dummy section */ | ||
__StackTop = ORIGIN(SRAM) + LENGTH(SRAM); | ||
__StackLimit = __StackTop - SIZEOF(.stack_dummy); | ||
|
||
/* .stack_dummy section doesn't contains any symbols. It is only | ||
* used for linker to calculate size of stack sections, and assign | ||
* values to stack symbols later */ | ||
.stack_dummy (COPY): | ||
{ | ||
*(.stack*) | ||
} > SRAM | ||
|
||
.heap (COPY): | ||
{ | ||
. = ALIGN(4); | ||
*(.heap*) | ||
__HeapLimit = ABSOLUTE(__StackLimit); | ||
} > SRAM | ||
|
||
PROVIDE(__stack = __StackTop); | ||
|
||
/* Check if data + heap + stack exceeds RAM limit */ | ||
ASSERT(__StackLimit >= _ebss, "region RAM overflowed with stack") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters