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:
Tue Feb 03 15:31:20 2015 +0000
Revision:
93:e188a91d3eaa
Child:
98:8ab26030e058
Release 93 of the mbed library

Main changes:

- Renesas RZ_A1H bugfixes - i2c, ticker
- new targets - Nucleo F303RE, Nucleo F070RB, BLE SMURFS,
Dragonfly 411RE,
- BusXXX - is connected method, plus operators addition
- LPC8xx - I2c fixes
- timestamp_t reverted to uint32_t
- RTX - fixes regarding stack (alignment, magic word)

Who changed what in which revision?

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