Compare commits
3 commits
1a980a9ffd
...
533d9ab020
Author | SHA1 | Date | |
---|---|---|---|
533d9ab020 | |||
0f331293d0 | |||
bfe0676079 |
1 changed files with 51 additions and 4 deletions
51
linker.ld
51
linker.ld
|
@ -1,6 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Filename: linker.ld
|
* Filename: linker.ld
|
||||||
* Micro-Controller: stm32f103c8t6
|
* Micro-Controller: stm32f103c8t6
|
||||||
|
* Cortex-M3 and Cortex-M4 only need to be 4byte aligned where as
|
||||||
|
* other's might need 8byte or something different.
|
||||||
|
*
|
||||||
|
* The M3/M4 are ARMv7 and ARMv7E-M respectively.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,6 +14,14 @@
|
||||||
*/
|
*/
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
/* Highest address of user mode stack */
|
||||||
|
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
|
||||||
|
|
||||||
|
/* Generate a link error if heap and stack don't fit into RAM */
|
||||||
|
_Min_Heap_Size = 0x200; /* required amount of heap. */
|
||||||
|
_Min_Stack_Size = 0x400; /* required amount of stack. */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FORMAT:
|
* FORMAT:
|
||||||
|
@ -34,11 +46,15 @@ MEMORY
|
||||||
SRAM(rwx): ORIGIN = 0x20000000, LENGTH = 20K
|
SRAM(rwx): ORIGIN = 0x20000000, LENGTH = 20K
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* VMA: virtual memory address.*/
|
||||||
|
/* LMA: Load memory address. */
|
||||||
|
|
||||||
floating_point = 0;
|
floating_point = 0;
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Code section, mapped to Flash memory */
|
/* Code section, mapped to Flash memory */
|
||||||
.tect :
|
.text :
|
||||||
{
|
{
|
||||||
KEEP(*(.isr_vector)) /* Vector table, which must be at the beginning of Flash*/
|
KEEP(*(.isr_vector)) /* Vector table, which must be at the beginning of Flash*/
|
||||||
*(.text) /* All code goes here */
|
*(.text) /* All code goes here */
|
||||||
|
@ -53,6 +69,37 @@ SECTIONS
|
||||||
*(.data) /* Initialized data */
|
*(.data) /* Initialized data */
|
||||||
_edata = .; /* End of data section */
|
_edata = .; /* End of data section */
|
||||||
} > RAM AT > FLASH
|
} > RAM AT > FLASH
|
||||||
|
|
||||||
|
/* BSS: Placed in SRAM memory types. */
|
||||||
|
/* Holds all uninitialized globals and static variables.*/
|
||||||
|
.bss :
|
||||||
|
{
|
||||||
|
_sbss = .; /* Start of BSS */
|
||||||
|
*(.bss) /* Uninitialized data */
|
||||||
|
*(COMMON) /* Common symbols (zero-init) */
|
||||||
|
_ebss = .; /* End of BSS */
|
||||||
|
} > RAM
|
||||||
|
|
||||||
|
/* Stack Section: Sizes known at compile time. */
|
||||||
|
._stack :
|
||||||
|
{
|
||||||
|
. = ALIGN(8); /* Align to 8-byte boundry */
|
||||||
|
_estack = .; /* End of stack (top of the stack) */
|
||||||
|
. = . + 2048; /* Reserve 2KB for stack */
|
||||||
|
_sstack = .; /*Start of stack */
|
||||||
|
} > RAM
|
||||||
|
|
||||||
|
/* Heap Section: Used for dynamic memory allocation. */
|
||||||
|
.heap :
|
||||||
|
{
|
||||||
|
_sheap = .; /* Start of heap */
|
||||||
|
. = . + 2048; /* Reserve 2 KB for heap */
|
||||||
|
_eheap = .; /* End of heap */
|
||||||
|
} > RAM
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Provide symbols to be used in the startup code */
|
||||||
|
PROVIDE(_stack_start = _sstack);
|
||||||
|
PROVIDE(_stack_end = _estack);
|
||||||
|
PROVIDE(_heap_start = _sheap);
|
||||||
|
PROVIDE(_heap_end = _eheap);
|
||||||
|
|
Loading…
Add table
Reference in a new issue