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:
Kojto
Date:
Wed Jul 19 16:46:19 2017 +0100
Revision:
147:a97add6d7e64
Parent:
95:7e07b6fb45cf
Child:
160:5571c4ff569f
Release 147 of the mbed library.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 95:7e07b6fb45cf 1 /* Linker script for mbed RZ_A1H */
Kojto 95:7e07b6fb45cf 2
Kojto 95:7e07b6fb45cf 3 /* Linker script to configure memory regions. */
Kojto 95:7e07b6fb45cf 4 MEMORY
Kojto 95:7e07b6fb45cf 5 {
Kojto 95:7e07b6fb45cf 6 ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x02000000
Kojto 95:7e07b6fb45cf 7 BOOT_LOADER (rx) : ORIGIN = 0x18000000, LENGTH = 0x00004000
Kojto 95:7e07b6fb45cf 8 SFLASH (rx) : ORIGIN = 0x18004000, LENGTH = 0x07FFC000
Kojto 95:7e07b6fb45cf 9 L_TTB (rw) : ORIGIN = 0x20000000, LENGTH = 0x00004000
Kojto 95:7e07b6fb45cf 10 RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 0x00700000
Kojto 95:7e07b6fb45cf 11 RAM_NC (rwx) : ORIGIN = 0x20900000, LENGTH = 0x00100000
Kojto 95:7e07b6fb45cf 12 }
Kojto 95:7e07b6fb45cf 13
Kojto 95:7e07b6fb45cf 14 /* Linker script to place sections and symbol values. Should be used together
Kojto 95:7e07b6fb45cf 15 * with other linker script that defines memory regions FLASH and RAM.
Kojto 95:7e07b6fb45cf 16 * It references following symbols, which must be defined in code:
Kojto 95:7e07b6fb45cf 17 * Reset_Handler : Entry of reset handler
Kojto 95:7e07b6fb45cf 18 *
Kojto 95:7e07b6fb45cf 19 * It defines following symbols, which code can use without definition:
Kojto 95:7e07b6fb45cf 20 * __exidx_start
Kojto 95:7e07b6fb45cf 21 * __exidx_end
Kojto 95:7e07b6fb45cf 22 * __etext
Kojto 95:7e07b6fb45cf 23 * __data_start__
Kojto 95:7e07b6fb45cf 24 * __preinit_array_start
Kojto 95:7e07b6fb45cf 25 * __preinit_array_end
Kojto 95:7e07b6fb45cf 26 * __init_array_start
Kojto 95:7e07b6fb45cf 27 * __init_array_end
Kojto 95:7e07b6fb45cf 28 * __fini_array_start
Kojto 95:7e07b6fb45cf 29 * __fini_array_end
Kojto 95:7e07b6fb45cf 30 * __data_end__
Kojto 95:7e07b6fb45cf 31 * __bss_start__
Kojto 95:7e07b6fb45cf 32 * __bss_end__
Kojto 95:7e07b6fb45cf 33 * __end__
Kojto 95:7e07b6fb45cf 34 * end
Kojto 95:7e07b6fb45cf 35 * __HeapLimit
Kojto 95:7e07b6fb45cf 36 * __StackLimit
Kojto 95:7e07b6fb45cf 37 * __StackTop
Kojto 95:7e07b6fb45cf 38 * __stack
Kojto 95:7e07b6fb45cf 39 */
Kojto 95:7e07b6fb45cf 40 ENTRY(Reset_Handler)
Kojto 95:7e07b6fb45cf 41
Kojto 95:7e07b6fb45cf 42 SECTIONS
Kojto 95:7e07b6fb45cf 43 {
Kojto 95:7e07b6fb45cf 44 .boot :
Kojto 95:7e07b6fb45cf 45 {
Kojto 95:7e07b6fb45cf 46 KEEP(*(.boot_loader))
Kojto 95:7e07b6fb45cf 47 } > BOOT_LOADER
Kojto 95:7e07b6fb45cf 48
Kojto 95:7e07b6fb45cf 49 .text :
Kojto 95:7e07b6fb45cf 50 {
Kojto 95:7e07b6fb45cf 51
Kojto 95:7e07b6fb45cf 52 Image$$VECTORS$$Base = .;
Kojto 95:7e07b6fb45cf 53 * (RESET)
Kojto 95:7e07b6fb45cf 54 Image$$VECTORS$$Limit = .;
Kojto 95:7e07b6fb45cf 55 . += 0x00000400;
Kojto 95:7e07b6fb45cf 56
Kojto 95:7e07b6fb45cf 57 KEEP(*(.isr_vector))
Kojto 95:7e07b6fb45cf 58 *(SVC_TABLE)
Kojto 95:7e07b6fb45cf 59 *(.text*)
Kojto 95:7e07b6fb45cf 60
Kojto 95:7e07b6fb45cf 61 KEEP(*(.init))
Kojto 95:7e07b6fb45cf 62 KEEP(*(.fini))
Kojto 95:7e07b6fb45cf 63
Kojto 95:7e07b6fb45cf 64 /* .ctors */
Kojto 95:7e07b6fb45cf 65 *crtbegin.o(.ctors)
Kojto 95:7e07b6fb45cf 66 *crtbegin?.o(.ctors)
Kojto 95:7e07b6fb45cf 67 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
Kojto 95:7e07b6fb45cf 68 *(SORT(.ctors.*))
Kojto 95:7e07b6fb45cf 69 *(.ctors)
Kojto 95:7e07b6fb45cf 70
Kojto 95:7e07b6fb45cf 71 /* .dtors */
Kojto 95:7e07b6fb45cf 72 *crtbegin.o(.dtors)
Kojto 95:7e07b6fb45cf 73 *crtbegin?.o(.dtors)
Kojto 95:7e07b6fb45cf 74 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
Kojto 95:7e07b6fb45cf 75 *(SORT(.dtors.*))
Kojto 95:7e07b6fb45cf 76 *(.dtors)
Kojto 95:7e07b6fb45cf 77
Kojto 95:7e07b6fb45cf 78 Image$$RO_DATA$$Base = .;
Kojto 95:7e07b6fb45cf 79 *(.rodata*)
Kojto 95:7e07b6fb45cf 80 Image$$RO_DATA$$Limit = .;
Kojto 95:7e07b6fb45cf 81
Kojto 95:7e07b6fb45cf 82 KEEP(*(.eh_frame*))
Kojto 95:7e07b6fb45cf 83 } > SFLASH
Kojto 95:7e07b6fb45cf 84
Kojto 95:7e07b6fb45cf 85 .ARM.extab :
Kojto 95:7e07b6fb45cf 86 {
Kojto 95:7e07b6fb45cf 87 *(.ARM.extab* .gnu.linkonce.armextab.*)
Kojto 95:7e07b6fb45cf 88 } > SFLASH
Kojto 95:7e07b6fb45cf 89
Kojto 95:7e07b6fb45cf 90 __exidx_start = .;
Kojto 95:7e07b6fb45cf 91 .ARM.exidx :
Kojto 95:7e07b6fb45cf 92 {
Kojto 95:7e07b6fb45cf 93 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
Kojto 95:7e07b6fb45cf 94 } > SFLASH
Kojto 95:7e07b6fb45cf 95 __exidx_end = .;
Kojto 95:7e07b6fb45cf 96
Kojto 95:7e07b6fb45cf 97
Kojto 95:7e07b6fb45cf 98 .copy.table :
Kojto 95:7e07b6fb45cf 99 {
Kojto 95:7e07b6fb45cf 100 . = ALIGN(4);
Kojto 95:7e07b6fb45cf 101 __copy_table_start__ = .;
Kojto 95:7e07b6fb45cf 102 LONG (__etext)
Kojto 95:7e07b6fb45cf 103 LONG (__data_start__)
Kojto 95:7e07b6fb45cf 104 LONG (__data_end__ - __data_start__)
Kojto 95:7e07b6fb45cf 105 LONG (__etext2)
Kojto 95:7e07b6fb45cf 106 LONG (__nc_data_start)
Kojto 95:7e07b6fb45cf 107 LONG (__nc_data_end - __nc_data_start)
Kojto 95:7e07b6fb45cf 108 __copy_table_end__ = .;
Kojto 95:7e07b6fb45cf 109 } > SFLASH
Kojto 95:7e07b6fb45cf 110
Kojto 95:7e07b6fb45cf 111 .zero.table :
Kojto 95:7e07b6fb45cf 112 {
Kojto 95:7e07b6fb45cf 113 . = ALIGN(4);
Kojto 95:7e07b6fb45cf 114 __zero_table_start__ = .;
Kojto 95:7e07b6fb45cf 115 LONG (__bss_start__)
Kojto 95:7e07b6fb45cf 116 LONG (__bss_end__ - __bss_start__)
Kojto 95:7e07b6fb45cf 117 LONG (__nc_bss_start)
Kojto 95:7e07b6fb45cf 118 LONG (__nc_bss_end - __nc_bss_start)
Kojto 95:7e07b6fb45cf 119 __zero_table_end__ = .;
Kojto 95:7e07b6fb45cf 120 } > SFLASH
Kojto 95:7e07b6fb45cf 121
Kojto 95:7e07b6fb45cf 122 __etext = .;
Kojto 95:7e07b6fb45cf 123
Kojto 95:7e07b6fb45cf 124 .ttb :
Kojto 95:7e07b6fb45cf 125 {
Kojto 95:7e07b6fb45cf 126 Image$$TTB$$ZI$$Base = .;
Kojto 95:7e07b6fb45cf 127 . += 0x00004000;
Kojto 95:7e07b6fb45cf 128 Image$$TTB$$ZI$$Limit = .;
Kojto 95:7e07b6fb45cf 129 } > L_TTB
Kojto 95:7e07b6fb45cf 130
Kojto 95:7e07b6fb45cf 131 .data : AT (__etext)
Kojto 95:7e07b6fb45cf 132 {
Kojto 95:7e07b6fb45cf 133 Image$$RW_DATA$$Base = .;
Kojto 95:7e07b6fb45cf 134 __data_start__ = .;
Kojto 95:7e07b6fb45cf 135 *(vtable)
Kojto 95:7e07b6fb45cf 136 *(.data*)
Kojto 95:7e07b6fb45cf 137 Image$$RW_DATA$$Limit = .;
Kojto 95:7e07b6fb45cf 138
Kojto 95:7e07b6fb45cf 139 . = ALIGN(4);
Kojto 95:7e07b6fb45cf 140 /* preinit data */
Kojto 95:7e07b6fb45cf 141 PROVIDE (__preinit_array_start = .);
Kojto 95:7e07b6fb45cf 142 KEEP(*(.preinit_array))
Kojto 95:7e07b6fb45cf 143 PROVIDE (__preinit_array_end = .);
Kojto 95:7e07b6fb45cf 144
Kojto 95:7e07b6fb45cf 145 . = ALIGN(4);
Kojto 95:7e07b6fb45cf 146 /* init data */
Kojto 95:7e07b6fb45cf 147 PROVIDE (__init_array_start = .);
Kojto 95:7e07b6fb45cf 148 KEEP(*(SORT(.init_array.*)))
Kojto 95:7e07b6fb45cf 149 KEEP(*(.init_array))
Kojto 95:7e07b6fb45cf 150 PROVIDE (__init_array_end = .);
Kojto 95:7e07b6fb45cf 151
Kojto 95:7e07b6fb45cf 152
Kojto 95:7e07b6fb45cf 153 . = ALIGN(4);
Kojto 95:7e07b6fb45cf 154 /* finit data */
Kojto 95:7e07b6fb45cf 155 PROVIDE (__fini_array_start = .);
Kojto 95:7e07b6fb45cf 156 KEEP(*(SORT(.fini_array.*)))
Kojto 95:7e07b6fb45cf 157 KEEP(*(.fini_array))
Kojto 95:7e07b6fb45cf 158 PROVIDE (__fini_array_end = .);
Kojto 95:7e07b6fb45cf 159
Kojto 95:7e07b6fb45cf 160 . = ALIGN(4);
Kojto 95:7e07b6fb45cf 161 /* All data end */
Kojto 95:7e07b6fb45cf 162 __data_end__ = .;
Kojto 95:7e07b6fb45cf 163
Kojto 95:7e07b6fb45cf 164 } > RAM
Kojto 95:7e07b6fb45cf 165
Kojto 95:7e07b6fb45cf 166
Kojto 95:7e07b6fb45cf 167 .bss ALIGN(0x400):
Kojto 95:7e07b6fb45cf 168 {
Kojto 95:7e07b6fb45cf 169 Image$$ZI_DATA$$Base = .;
Kojto 95:7e07b6fb45cf 170 __bss_start__ = .;
Kojto 95:7e07b6fb45cf 171 *(.bss*)
Kojto 95:7e07b6fb45cf 172 *(COMMON)
Kojto 95:7e07b6fb45cf 173 __bss_end__ = .;
Kojto 95:7e07b6fb45cf 174 Image$$ZI_DATA$$Limit = .;
Kojto 95:7e07b6fb45cf 175 } > RAM
Kojto 95:7e07b6fb45cf 176
Kojto 95:7e07b6fb45cf 177
Kojto 95:7e07b6fb45cf 178 .heap :
Kojto 95:7e07b6fb45cf 179 {
Kojto 95:7e07b6fb45cf 180 __end__ = .;
Kojto 95:7e07b6fb45cf 181 end = __end__;
Kojto 95:7e07b6fb45cf 182 *(.heap*)
Kojto 95:7e07b6fb45cf 183 __HeapLimit = .;
Kojto 95:7e07b6fb45cf 184 } > RAM
Kojto 95:7e07b6fb45cf 185
Kojto 95:7e07b6fb45cf 186 /* .stack_dummy section doesn't contains any symbols. It is only
Kojto 95:7e07b6fb45cf 187 * used for linker to calculate size of stack sections, and assign
Kojto 95:7e07b6fb45cf 188 * values to stack symbols later */
Kojto 95:7e07b6fb45cf 189 .stack_dummy :
Kojto 95:7e07b6fb45cf 190 {
Kojto 95:7e07b6fb45cf 191 *(.stack)
Kojto 95:7e07b6fb45cf 192 } > RAM
Kojto 95:7e07b6fb45cf 193
Kojto 95:7e07b6fb45cf 194 __etext2 = __etext + SIZEOF(.data);
Kojto 95:7e07b6fb45cf 195 .nc_data : AT (__etext2)
Kojto 95:7e07b6fb45cf 196 {
Kojto 95:7e07b6fb45cf 197 Image$$RW_DATA_NC$$Base = .;
Kojto 95:7e07b6fb45cf 198 __nc_data_start = .;
Kojto 95:7e07b6fb45cf 199 *(NC_DATA)
Kojto 95:7e07b6fb45cf 200
Kojto 95:7e07b6fb45cf 201 . = ALIGN(4);
Kojto 95:7e07b6fb45cf 202 __nc_data_end = .;
Kojto 95:7e07b6fb45cf 203 Image$$RW_DATA_NC$$Limit = .;
Kojto 95:7e07b6fb45cf 204 } > RAM_NC
Kojto 95:7e07b6fb45cf 205
Kojto 95:7e07b6fb45cf 206 .nc_bss (NOLOAD) :
Kojto 95:7e07b6fb45cf 207 {
Kojto 95:7e07b6fb45cf 208 Image$$ZI_DATA_NC$$Base = .;
Kojto 95:7e07b6fb45cf 209 __nc_bss_start = .;
Kojto 95:7e07b6fb45cf 210 *(NC_BSS)
Kojto 95:7e07b6fb45cf 211
Kojto 95:7e07b6fb45cf 212 . = ALIGN(4);
Kojto 95:7e07b6fb45cf 213 __nc_bss_end = .;
Kojto 95:7e07b6fb45cf 214 Image$$ZI_DATA_NC$$Limit = .;
Kojto 95:7e07b6fb45cf 215 } > RAM_NC
Kojto 95:7e07b6fb45cf 216
Kojto 95:7e07b6fb45cf 217 /* Set stack top to end of RAM, and stack limit move down by
Kojto 95:7e07b6fb45cf 218 * size of stack_dummy section */
Kojto 95:7e07b6fb45cf 219 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
Kojto 95:7e07b6fb45cf 220 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
Kojto 95:7e07b6fb45cf 221 PROVIDE(__stack = __StackTop);
Kojto 95:7e07b6fb45cf 222
Kojto 95:7e07b6fb45cf 223 /* Check if data + heap + stack exceeds RAM limit */
Kojto 95:7e07b6fb45cf 224 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
Kojto 95:7e07b6fb45cf 225
Kojto 95:7e07b6fb45cf 226
Kojto 95:7e07b6fb45cf 227 }