The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
Anna Bridge
Date:
Fri Jun 22 15:38:59 2018 +0100
Revision:
169:a7c7b631e539
Parent:
156:ff21514d8981
Child:
171:3a7713b1edbc
mbed library. Release version 162

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 156:ff21514d8981 1 /*
AnnaBridge 156:ff21514d8981 2 * NCS36510 ARM GCC linker script file
AnnaBridge 156:ff21514d8981 3 */
AnnaBridge 156:ff21514d8981 4
AnnaBridge 156:ff21514d8981 5 MEMORY {
Anna Bridge 169:a7c7b631e539 6 FIB (rx) : ORIGIN = 0x00002000, LENGTH = 0x00000800
Anna Bridge 169:a7c7b631e539 7 TRIM (rx) : ORIGIN = 0x00002800, LENGTH = 0x00000800
AnnaBridge 156:ff21514d8981 8 VECTORS (rx) : ORIGIN = 0x00003000, LENGTH = 0x00000090
Anna Bridge 169:a7c7b631e539 9 FLASH (rx) : ORIGIN = 0x00003090, LENGTH = 320K - 4K - 0x90
Anna Bridge 169:a7c7b631e539 10 RAM (rwx) : ORIGIN = 0x3FFF4090, LENGTH = 48K - 0x90 /* 8_byte_aligned(35 vectors * 4 bytes each) = 0x90 */
Anna Bridge 169:a7c7b631e539 11 }
AnnaBridge 156:ff21514d8981 12
AnnaBridge 156:ff21514d8981 13 /* Linker script to place sections and symbol values. Should be used together
AnnaBridge 156:ff21514d8981 14 * with other linker script that defines memory regions FLASH and RAM.
AnnaBridge 156:ff21514d8981 15 * It references following symbols, which must be defined in code:
AnnaBridge 156:ff21514d8981 16 * _reset_init : Entry of reset handler
AnnaBridge 156:ff21514d8981 17 *
AnnaBridge 156:ff21514d8981 18 * It defines following symbols, which code can use without definition:
AnnaBridge 156:ff21514d8981 19 * __exidx_start
AnnaBridge 156:ff21514d8981 20 * __exidx_end
AnnaBridge 156:ff21514d8981 21 * __etext
AnnaBridge 156:ff21514d8981 22 * __data_start__
AnnaBridge 156:ff21514d8981 23 * __preinit_array_start
AnnaBridge 156:ff21514d8981 24 * __preinit_array_end
AnnaBridge 156:ff21514d8981 25 * __init_array_start
AnnaBridge 156:ff21514d8981 26 * __init_array_end
AnnaBridge 156:ff21514d8981 27 * __fini_array_start
AnnaBridge 156:ff21514d8981 28 * __fini_array_end
AnnaBridge 156:ff21514d8981 29 * __data_end__
AnnaBridge 156:ff21514d8981 30 * __bss_start__
AnnaBridge 156:ff21514d8981 31 * __bss_end__
AnnaBridge 156:ff21514d8981 32 * __end__
AnnaBridge 156:ff21514d8981 33 * end
AnnaBridge 156:ff21514d8981 34 * __HeapLimit
AnnaBridge 156:ff21514d8981 35 * __StackLimit
AnnaBridge 156:ff21514d8981 36 * __StackTop
AnnaBridge 156:ff21514d8981 37 * __stack
AnnaBridge 156:ff21514d8981 38 */
AnnaBridge 156:ff21514d8981 39 ENTRY(Reset_Handler)
AnnaBridge 156:ff21514d8981 40
AnnaBridge 156:ff21514d8981 41 SECTIONS {
Anna Bridge 169:a7c7b631e539 42 .fib :
Anna Bridge 169:a7c7b631e539 43 {
Anna Bridge 169:a7c7b631e539 44 KEEP(*(.fib))
Anna Bridge 169:a7c7b631e539 45 } > FIB
Anna Bridge 169:a7c7b631e539 46
Anna Bridge 169:a7c7b631e539 47 .trim :
Anna Bridge 169:a7c7b631e539 48 {
Anna Bridge 169:a7c7b631e539 49 KEEP(*(.trim))
Anna Bridge 169:a7c7b631e539 50 } > TRIM
Anna Bridge 169:a7c7b631e539 51
Anna Bridge 169:a7c7b631e539 52 .isr_vector :
AnnaBridge 156:ff21514d8981 53 {
AnnaBridge 156:ff21514d8981 54 __vector_table = .;
AnnaBridge 156:ff21514d8981 55 KEEP(*(.vector_table))
AnnaBridge 156:ff21514d8981 56 . = ALIGN(4);
AnnaBridge 156:ff21514d8981 57 } > VECTORS
AnnaBridge 156:ff21514d8981 58
AnnaBridge 156:ff21514d8981 59 /* ensure that uvisor bss is at the beginning of memory */
AnnaBridge 156:ff21514d8981 60 .uvisor.bss (NOLOAD):
AnnaBridge 156:ff21514d8981 61 {
AnnaBridge 156:ff21514d8981 62 . = ALIGN(32);
AnnaBridge 156:ff21514d8981 63 __uvisor_bss_start = .;
AnnaBridge 156:ff21514d8981 64
AnnaBridge 156:ff21514d8981 65 /* protected uvisor main bss */
AnnaBridge 156:ff21514d8981 66 . = ALIGN(32);
AnnaBridge 156:ff21514d8981 67 __uvisor_bss_main_start = .;
AnnaBridge 156:ff21514d8981 68 KEEP(*(.keep.uvisor.bss.main))
AnnaBridge 156:ff21514d8981 69 . = ALIGN(32);
AnnaBridge 156:ff21514d8981 70 __uvisor_bss_main_end = .;
AnnaBridge 156:ff21514d8981 71
AnnaBridge 156:ff21514d8981 72 /* protected uvisor secure boxes bss */
AnnaBridge 156:ff21514d8981 73 . = ALIGN(32);
AnnaBridge 156:ff21514d8981 74 __uvisor_bss_boxes_start = .;
AnnaBridge 156:ff21514d8981 75 KEEP(*(.keep.uvisor.bss.boxes))
AnnaBridge 156:ff21514d8981 76 . = ALIGN(32);
AnnaBridge 156:ff21514d8981 77 __uvisor_bss_boxes_end = .;
AnnaBridge 156:ff21514d8981 78
AnnaBridge 156:ff21514d8981 79 . = ALIGN(32);
AnnaBridge 156:ff21514d8981 80 __uvisor_bss_end = .;
AnnaBridge 156:ff21514d8981 81 } > RAM
AnnaBridge 156:ff21514d8981 82
AnnaBridge 156:ff21514d8981 83 .text :
AnnaBridge 156:ff21514d8981 84 {
AnnaBridge 156:ff21514d8981 85 /* uVisor code and data */
AnnaBridge 156:ff21514d8981 86 . = ALIGN(4);
AnnaBridge 156:ff21514d8981 87 __uvisor_main_start = .;
AnnaBridge 156:ff21514d8981 88 *(.uvisor.main)
AnnaBridge 156:ff21514d8981 89 __uvisor_main_end = .;
AnnaBridge 156:ff21514d8981 90
AnnaBridge 156:ff21514d8981 91 *(.text*)
AnnaBridge 156:ff21514d8981 92
AnnaBridge 156:ff21514d8981 93 KEEP(*(.init))
AnnaBridge 156:ff21514d8981 94 KEEP(*(.fini))
AnnaBridge 156:ff21514d8981 95
AnnaBridge 156:ff21514d8981 96 /* .ctors */
AnnaBridge 156:ff21514d8981 97 *crtbegin.o(.ctors)
AnnaBridge 156:ff21514d8981 98 *crtbegin?.o(.ctors)
AnnaBridge 156:ff21514d8981 99 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
AnnaBridge 156:ff21514d8981 100 *(SORT(.ctors.*))
AnnaBridge 156:ff21514d8981 101 *(.ctors)
AnnaBridge 156:ff21514d8981 102
AnnaBridge 156:ff21514d8981 103 /* .dtors */
AnnaBridge 156:ff21514d8981 104 *crtbegin.o(.dtors)
AnnaBridge 156:ff21514d8981 105 *crtbegin?.o(.dtors)
AnnaBridge 156:ff21514d8981 106 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
AnnaBridge 156:ff21514d8981 107 *(SORT(.dtors.*))
AnnaBridge 156:ff21514d8981 108 *(.dtors)
AnnaBridge 156:ff21514d8981 109
AnnaBridge 156:ff21514d8981 110 *(.rodata*)
AnnaBridge 156:ff21514d8981 111
AnnaBridge 156:ff21514d8981 112 KEEP(*(.eh_frame*))
AnnaBridge 156:ff21514d8981 113 } > FLASH
AnnaBridge 156:ff21514d8981 114
AnnaBridge 156:ff21514d8981 115 .ARM.extab :
AnnaBridge 156:ff21514d8981 116 {
AnnaBridge 156:ff21514d8981 117 *(.ARM.extab* .gnu.linkonce.armextab.*)
AnnaBridge 156:ff21514d8981 118 } > FLASH
AnnaBridge 156:ff21514d8981 119
AnnaBridge 156:ff21514d8981 120 .ARM.exidx :
AnnaBridge 156:ff21514d8981 121 {
AnnaBridge 156:ff21514d8981 122 __exidx_start = .;
AnnaBridge 156:ff21514d8981 123 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
AnnaBridge 156:ff21514d8981 124 __exidx_end = .;
AnnaBridge 156:ff21514d8981 125 } > FLASH
AnnaBridge 156:ff21514d8981 126
AnnaBridge 156:ff21514d8981 127 .data :
AnnaBridge 156:ff21514d8981 128 {
AnnaBridge 156:ff21514d8981 129 PROVIDE( __etext = LOADADDR(.data) );
AnnaBridge 156:ff21514d8981 130
AnnaBridge 156:ff21514d8981 131 __data_start__ = .;
AnnaBridge 156:ff21514d8981 132 *(vtable)
AnnaBridge 156:ff21514d8981 133 *(.data*)
AnnaBridge 156:ff21514d8981 134
AnnaBridge 156:ff21514d8981 135 . = ALIGN(4);
AnnaBridge 156:ff21514d8981 136 /* preinit data */
AnnaBridge 156:ff21514d8981 137 PROVIDE_HIDDEN (__preinit_array_start = .);
AnnaBridge 156:ff21514d8981 138 KEEP(*(.preinit_array))
AnnaBridge 156:ff21514d8981 139 PROVIDE_HIDDEN (__preinit_array_end = .);
AnnaBridge 156:ff21514d8981 140
AnnaBridge 156:ff21514d8981 141 . = ALIGN(4);
AnnaBridge 156:ff21514d8981 142 /* init data */
AnnaBridge 156:ff21514d8981 143 PROVIDE_HIDDEN (__init_array_start = .);
AnnaBridge 156:ff21514d8981 144 KEEP(*(SORT(.init_array.*)))
AnnaBridge 156:ff21514d8981 145 KEEP(*(.init_array))
AnnaBridge 156:ff21514d8981 146 PROVIDE_HIDDEN (__init_array_end = .);
AnnaBridge 156:ff21514d8981 147
AnnaBridge 156:ff21514d8981 148 . = ALIGN(4);
AnnaBridge 156:ff21514d8981 149 /* finit data */
AnnaBridge 156:ff21514d8981 150 PROVIDE_HIDDEN (__fini_array_start = .);
AnnaBridge 156:ff21514d8981 151 KEEP(*(SORT(.fini_array.*)))
AnnaBridge 156:ff21514d8981 152 KEEP(*(.fini_array))
AnnaBridge 156:ff21514d8981 153 PROVIDE_HIDDEN (__fini_array_end = .);
AnnaBridge 156:ff21514d8981 154
AnnaBridge 156:ff21514d8981 155 /* All data end */
AnnaBridge 156:ff21514d8981 156 . = ALIGN(32);
AnnaBridge 156:ff21514d8981 157 __data_end__ = .;
AnnaBridge 156:ff21514d8981 158
AnnaBridge 156:ff21514d8981 159 } >RAM AT>FLASH
AnnaBridge 156:ff21514d8981 160
AnnaBridge 156:ff21514d8981 161 /* uvisor configuration data */
AnnaBridge 156:ff21514d8981 162 .uvisor.secure :
AnnaBridge 156:ff21514d8981 163 {
AnnaBridge 156:ff21514d8981 164 . = ALIGN(32);
AnnaBridge 156:ff21514d8981 165 __uvisor_secure_start = .;
AnnaBridge 156:ff21514d8981 166
AnnaBridge 156:ff21514d8981 167 /* uvisor secure boxes configuration tables */
AnnaBridge 156:ff21514d8981 168 . = ALIGN(32);
AnnaBridge 156:ff21514d8981 169 __uvisor_cfgtbl_start = .;
AnnaBridge 156:ff21514d8981 170 KEEP(*(.keep.uvisor.cfgtbl))
AnnaBridge 156:ff21514d8981 171 . = ALIGN(32);
AnnaBridge 156:ff21514d8981 172 __uvisor_cfgtbl_end = .;
AnnaBridge 156:ff21514d8981 173
AnnaBridge 156:ff21514d8981 174 /* pointers to uvisor secure boxes configuration tables */
AnnaBridge 156:ff21514d8981 175 /* note: no further alignment here, we need to have the exact list of pointers */
AnnaBridge 156:ff21514d8981 176 __uvisor_cfgtbl_ptr_start = .;
AnnaBridge 156:ff21514d8981 177 KEEP(*(.keep.uvisor.cfgtbl_ptr_first))
AnnaBridge 156:ff21514d8981 178 KEEP(*(.keep.uvisor.cfgtbl_ptr))
AnnaBridge 156:ff21514d8981 179 __uvisor_cfgtbl_ptr_end = .;
AnnaBridge 156:ff21514d8981 180
AnnaBridge 156:ff21514d8981 181 /* the following symbols are kept for backward compatibility and will be soon
AnnaBridge 156:ff21514d8981 182 * deprecated; applications actively using uVisor (__uvisor_mode == UVISOR_ENABLED)
AnnaBridge 156:ff21514d8981 183 * will need to use uVisor 0.8.x or above, or the security assetions will halt the
AnnaBridge 156:ff21514d8981 184 * system */
AnnaBridge 156:ff21514d8981 185 /************************/
AnnaBridge 156:ff21514d8981 186 __uvisor_data_src = .;
AnnaBridge 156:ff21514d8981 187 __uvisor_data_start = .;
AnnaBridge 156:ff21514d8981 188 __uvisor_data_end = .;
AnnaBridge 156:ff21514d8981 189 /************************/
AnnaBridge 156:ff21514d8981 190
AnnaBridge 156:ff21514d8981 191 . = ALIGN(32);
AnnaBridge 156:ff21514d8981 192 __uvisor_secure_end = .;
AnnaBridge 156:ff21514d8981 193 } >FLASH
AnnaBridge 156:ff21514d8981 194
AnnaBridge 156:ff21514d8981 195 .uninitialized (NOLOAD):
AnnaBridge 156:ff21514d8981 196 {
AnnaBridge 156:ff21514d8981 197 . = ALIGN(32);
AnnaBridge 156:ff21514d8981 198 __uninitialized_start = .;
AnnaBridge 156:ff21514d8981 199 *(.uninitialized)
AnnaBridge 156:ff21514d8981 200 KEEP(*(.keep.uninitialized))
AnnaBridge 156:ff21514d8981 201 . = ALIGN(32);
AnnaBridge 156:ff21514d8981 202 __uninitialized_end = .;
AnnaBridge 156:ff21514d8981 203 } > RAM
AnnaBridge 156:ff21514d8981 204
AnnaBridge 156:ff21514d8981 205 .bss (NOLOAD):
AnnaBridge 156:ff21514d8981 206 {
AnnaBridge 156:ff21514d8981 207 __bss_start__ = .;
AnnaBridge 156:ff21514d8981 208 *(.bss*)
AnnaBridge 156:ff21514d8981 209 *(COMMON)
AnnaBridge 156:ff21514d8981 210 __bss_end__ = .;
AnnaBridge 156:ff21514d8981 211 } > RAM
AnnaBridge 156:ff21514d8981 212
AnnaBridge 156:ff21514d8981 213 .heap (NOLOAD):
AnnaBridge 156:ff21514d8981 214 {
AnnaBridge 156:ff21514d8981 215 __end__ = .;
AnnaBridge 156:ff21514d8981 216 end = __end__;
AnnaBridge 156:ff21514d8981 217 *(.heap*);
AnnaBridge 156:ff21514d8981 218 . += 0x800;
AnnaBridge 156:ff21514d8981 219 __HeapLimit = .;
AnnaBridge 156:ff21514d8981 220 } > RAM
AnnaBridge 156:ff21514d8981 221 PROVIDE(__heap_size = SIZEOF(.heap));
AnnaBridge 156:ff21514d8981 222 PROVIDE(__mbed_sbrk_start = ADDR(.heap));
AnnaBridge 156:ff21514d8981 223 PROVIDE(__mbed_krbs_start = ADDR(.heap) + SIZEOF(.heap));
AnnaBridge 156:ff21514d8981 224
AnnaBridge 156:ff21514d8981 225 /* .stack section doesn't contains any symbols. It is only
AnnaBridge 156:ff21514d8981 226 * used for linker to reserve space for the main stack section
AnnaBridge 156:ff21514d8981 227 * WARNING: .stack should come immediately after the last secure memory
AnnaBridge 156:ff21514d8981 228 * section. This provides stack overflow detection. */
AnnaBridge 156:ff21514d8981 229 .stack (NOLOAD):
AnnaBridge 156:ff21514d8981 230 {
AnnaBridge 156:ff21514d8981 231 __StackLimit = .;
AnnaBridge 156:ff21514d8981 232 *(.stack*);
AnnaBridge 156:ff21514d8981 233 . += 0x800 - (. - __StackLimit);
AnnaBridge 156:ff21514d8981 234 } > RAM
AnnaBridge 156:ff21514d8981 235
AnnaBridge 156:ff21514d8981 236 /* Set stack top to end of RAM */
AnnaBridge 156:ff21514d8981 237 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
AnnaBridge 156:ff21514d8981 238 __StackLimit = __StackTop - SIZEOF(.stack);
AnnaBridge 156:ff21514d8981 239 PROVIDE(__stack = __StackTop);
AnnaBridge 156:ff21514d8981 240
AnnaBridge 156:ff21514d8981 241 }