Nicolas Borla / Mbed OS BBR_1Ebene
Committer:
borlanic
Date:
Mon May 14 11:29:06 2018 +0000
Revision:
0:fbdae7e6d805
BBR

Who changed what in which revision?

UserRevisionLine numberNew contents of line
borlanic 0:fbdae7e6d805 1 /* Linker script to configure memory regions. */
borlanic 0:fbdae7e6d805 2 MEMORY
borlanic 0:fbdae7e6d805 3 {
borlanic 0:fbdae7e6d805 4 /* First 64kB of flash reserved for bootloader */
borlanic 0:fbdae7e6d805 5 /* Other 448kB for application */
borlanic 0:fbdae7e6d805 6 FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 448K
borlanic 0:fbdae7e6d805 7 RAM (rwx) : ORIGIN = 0x20000198, LENGTH = 128k - 0x198
borlanic 0:fbdae7e6d805 8 }
borlanic 0:fbdae7e6d805 9
borlanic 0:fbdae7e6d805 10 /* Linker script to place sections and symbol values. Should be used together
borlanic 0:fbdae7e6d805 11 * with other linker script that defines memory regions FLASH and RAM.
borlanic 0:fbdae7e6d805 12 * It references following symbols, which must be defined in code:
borlanic 0:fbdae7e6d805 13 * Reset_Handler : Entry of reset handler
borlanic 0:fbdae7e6d805 14 *
borlanic 0:fbdae7e6d805 15 * It defines following symbols, which code can use without definition:
borlanic 0:fbdae7e6d805 16 * __exidx_start
borlanic 0:fbdae7e6d805 17 * __exidx_end
borlanic 0:fbdae7e6d805 18 * __etext
borlanic 0:fbdae7e6d805 19 * __data_start__
borlanic 0:fbdae7e6d805 20 * __preinit_array_start
borlanic 0:fbdae7e6d805 21 * __preinit_array_end
borlanic 0:fbdae7e6d805 22 * __init_array_start
borlanic 0:fbdae7e6d805 23 * __init_array_end
borlanic 0:fbdae7e6d805 24 * __fini_array_start
borlanic 0:fbdae7e6d805 25 * __fini_array_end
borlanic 0:fbdae7e6d805 26 * __data_end__
borlanic 0:fbdae7e6d805 27 * __bss_start__
borlanic 0:fbdae7e6d805 28 * __bss_end__
borlanic 0:fbdae7e6d805 29 * __end__
borlanic 0:fbdae7e6d805 30 * end
borlanic 0:fbdae7e6d805 31 * __HeapLimit
borlanic 0:fbdae7e6d805 32 * __StackLimit
borlanic 0:fbdae7e6d805 33 * __StackTop
borlanic 0:fbdae7e6d805 34 * __stack
borlanic 0:fbdae7e6d805 35 * _estack
borlanic 0:fbdae7e6d805 36 */
borlanic 0:fbdae7e6d805 37 ENTRY(Reset_Handler)
borlanic 0:fbdae7e6d805 38
borlanic 0:fbdae7e6d805 39 SECTIONS
borlanic 0:fbdae7e6d805 40 {
borlanic 0:fbdae7e6d805 41 .text :
borlanic 0:fbdae7e6d805 42 {
borlanic 0:fbdae7e6d805 43 KEEP(*(.isr_vector))
borlanic 0:fbdae7e6d805 44 *(.text*)
borlanic 0:fbdae7e6d805 45 KEEP(*(.init))
borlanic 0:fbdae7e6d805 46 KEEP(*(.fini))
borlanic 0:fbdae7e6d805 47
borlanic 0:fbdae7e6d805 48 /* .ctors */
borlanic 0:fbdae7e6d805 49 *crtbegin.o(.ctors)
borlanic 0:fbdae7e6d805 50 *crtbegin?.o(.ctors)
borlanic 0:fbdae7e6d805 51 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
borlanic 0:fbdae7e6d805 52 *(SORT(.ctors.*))
borlanic 0:fbdae7e6d805 53 *(.ctors)
borlanic 0:fbdae7e6d805 54
borlanic 0:fbdae7e6d805 55 /* .dtors */
borlanic 0:fbdae7e6d805 56 *crtbegin.o(.dtors)
borlanic 0:fbdae7e6d805 57 *crtbegin?.o(.dtors)
borlanic 0:fbdae7e6d805 58 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
borlanic 0:fbdae7e6d805 59 *(SORT(.dtors.*))
borlanic 0:fbdae7e6d805 60 *(.dtors)
borlanic 0:fbdae7e6d805 61
borlanic 0:fbdae7e6d805 62 *(.rodata*)
borlanic 0:fbdae7e6d805 63
borlanic 0:fbdae7e6d805 64 KEEP(*(.eh_frame*))
borlanic 0:fbdae7e6d805 65 } > FLASH
borlanic 0:fbdae7e6d805 66
borlanic 0:fbdae7e6d805 67 .ARM.extab :
borlanic 0:fbdae7e6d805 68 {
borlanic 0:fbdae7e6d805 69 *(.ARM.extab* .gnu.linkonce.armextab.*)
borlanic 0:fbdae7e6d805 70 } > FLASH
borlanic 0:fbdae7e6d805 71
borlanic 0:fbdae7e6d805 72 __exidx_start = .;
borlanic 0:fbdae7e6d805 73 .ARM.exidx :
borlanic 0:fbdae7e6d805 74 {
borlanic 0:fbdae7e6d805 75 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
borlanic 0:fbdae7e6d805 76 } > FLASH
borlanic 0:fbdae7e6d805 77 __exidx_end = .;
borlanic 0:fbdae7e6d805 78
borlanic 0:fbdae7e6d805 79 __etext = .;
borlanic 0:fbdae7e6d805 80 _sidata = .;
borlanic 0:fbdae7e6d805 81
borlanic 0:fbdae7e6d805 82 .data : AT (__etext)
borlanic 0:fbdae7e6d805 83 {
borlanic 0:fbdae7e6d805 84 __data_start__ = .;
borlanic 0:fbdae7e6d805 85 _sdata = .;
borlanic 0:fbdae7e6d805 86 *(vtable)
borlanic 0:fbdae7e6d805 87 *(.data*)
borlanic 0:fbdae7e6d805 88
borlanic 0:fbdae7e6d805 89 . = ALIGN(4);
borlanic 0:fbdae7e6d805 90 /* preinit data */
borlanic 0:fbdae7e6d805 91 PROVIDE_HIDDEN (__preinit_array_start = .);
borlanic 0:fbdae7e6d805 92 KEEP(*(.preinit_array))
borlanic 0:fbdae7e6d805 93 PROVIDE_HIDDEN (__preinit_array_end = .);
borlanic 0:fbdae7e6d805 94
borlanic 0:fbdae7e6d805 95 . = ALIGN(4);
borlanic 0:fbdae7e6d805 96 /* init data */
borlanic 0:fbdae7e6d805 97 PROVIDE_HIDDEN (__init_array_start = .);
borlanic 0:fbdae7e6d805 98 KEEP(*(SORT(.init_array.*)))
borlanic 0:fbdae7e6d805 99 KEEP(*(.init_array))
borlanic 0:fbdae7e6d805 100 PROVIDE_HIDDEN (__init_array_end = .);
borlanic 0:fbdae7e6d805 101
borlanic 0:fbdae7e6d805 102
borlanic 0:fbdae7e6d805 103 . = ALIGN(4);
borlanic 0:fbdae7e6d805 104 /* finit data */
borlanic 0:fbdae7e6d805 105 PROVIDE_HIDDEN (__fini_array_start = .);
borlanic 0:fbdae7e6d805 106 KEEP(*(SORT(.fini_array.*)))
borlanic 0:fbdae7e6d805 107 KEEP(*(.fini_array))
borlanic 0:fbdae7e6d805 108 PROVIDE_HIDDEN (__fini_array_end = .);
borlanic 0:fbdae7e6d805 109
borlanic 0:fbdae7e6d805 110 KEEP(*(.jcr*))
borlanic 0:fbdae7e6d805 111 . = ALIGN(4);
borlanic 0:fbdae7e6d805 112 /* All data end */
borlanic 0:fbdae7e6d805 113 __data_end__ = .;
borlanic 0:fbdae7e6d805 114 _edata = .;
borlanic 0:fbdae7e6d805 115
borlanic 0:fbdae7e6d805 116 } > RAM
borlanic 0:fbdae7e6d805 117
borlanic 0:fbdae7e6d805 118 .bss :
borlanic 0:fbdae7e6d805 119 {
borlanic 0:fbdae7e6d805 120 . = ALIGN(4);
borlanic 0:fbdae7e6d805 121 __bss_start__ = .;
borlanic 0:fbdae7e6d805 122 _sbss = .;
borlanic 0:fbdae7e6d805 123 *(.bss*)
borlanic 0:fbdae7e6d805 124 *(COMMON)
borlanic 0:fbdae7e6d805 125 . = ALIGN(4);
borlanic 0:fbdae7e6d805 126 __bss_end__ = .;
borlanic 0:fbdae7e6d805 127 _ebss = .;
borlanic 0:fbdae7e6d805 128 } > RAM
borlanic 0:fbdae7e6d805 129
borlanic 0:fbdae7e6d805 130 .heap (COPY):
borlanic 0:fbdae7e6d805 131 {
borlanic 0:fbdae7e6d805 132 __end__ = .;
borlanic 0:fbdae7e6d805 133 end = __end__;
borlanic 0:fbdae7e6d805 134 *(.heap*)
borlanic 0:fbdae7e6d805 135 __HeapLimit = .;
borlanic 0:fbdae7e6d805 136 } > RAM
borlanic 0:fbdae7e6d805 137
borlanic 0:fbdae7e6d805 138 /* .stack_dummy section doesn't contains any symbols. It is only
borlanic 0:fbdae7e6d805 139 * used for linker to calculate size of stack sections, and assign
borlanic 0:fbdae7e6d805 140 * values to stack symbols later */
borlanic 0:fbdae7e6d805 141 .stack_dummy (COPY):
borlanic 0:fbdae7e6d805 142 {
borlanic 0:fbdae7e6d805 143 *(.stack*)
borlanic 0:fbdae7e6d805 144 } > RAM
borlanic 0:fbdae7e6d805 145
borlanic 0:fbdae7e6d805 146 /* Set stack top to end of RAM, and stack limit move down by
borlanic 0:fbdae7e6d805 147 * size of stack_dummy section */
borlanic 0:fbdae7e6d805 148 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
borlanic 0:fbdae7e6d805 149 _estack = __StackTop;
borlanic 0:fbdae7e6d805 150 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
borlanic 0:fbdae7e6d805 151 PROVIDE(__stack = __StackTop);
borlanic 0:fbdae7e6d805 152
borlanic 0:fbdae7e6d805 153 /* Check if data + heap + stack exceeds RAM limit */
borlanic 0:fbdae7e6d805 154 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
borlanic 0:fbdae7e6d805 155 }