SD card interface

Committer:
lharoon
Date:
Mon Oct 08 11:14:07 2012 +0000
Revision:
0:22612ae617a0
1st edition

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lharoon 0:22612ae617a0 1 /* mbed - LPC11U24 linker script
lharoon 0:22612ae617a0 2 * Based linker script generated by Code Red Technologies Red Suite 4.1
lharoon 0:22612ae617a0 3 */
lharoon 0:22612ae617a0 4 GROUP(libgcc.a libc.a libstdc++.a libm.a libcr_newlib_nohost.a crti.o crtn.o crtbegin.o crtend.o)
lharoon 0:22612ae617a0 5
lharoon 0:22612ae617a0 6 MEMORY
lharoon 0:22612ae617a0 7 {
lharoon 0:22612ae617a0 8 /* Define each memory region */
lharoon 0:22612ae617a0 9 MFlash32 (rx) : ORIGIN = 0x0, LENGTH = 0x8000 /* 32k */
lharoon 0:22612ae617a0 10 RamLoc4 (rwx) : ORIGIN = 0x100000C0, LENGTH = 0xF40 /* 4k */
lharoon 0:22612ae617a0 11 RamUsb2 (rwx) : ORIGIN = 0x20004000, LENGTH = 0x800 /* 2k */
lharoon 0:22612ae617a0 12 }
lharoon 0:22612ae617a0 13 /* Define a symbol for the top of each memory region */
lharoon 0:22612ae617a0 14 __top_MFlash32 = 0x0 + 0x8000;
lharoon 0:22612ae617a0 15 __top_RamLoc4 = 0x10000000 + 0x1000;
lharoon 0:22612ae617a0 16 __top_RamUsb2 = 0x20004000 + 0x800;
lharoon 0:22612ae617a0 17
lharoon 0:22612ae617a0 18 ENTRY(ResetISR)
lharoon 0:22612ae617a0 19
lharoon 0:22612ae617a0 20 SECTIONS
lharoon 0:22612ae617a0 21 {
lharoon 0:22612ae617a0 22
lharoon 0:22612ae617a0 23 /* MAIN TEXT SECTION */
lharoon 0:22612ae617a0 24 .text : ALIGN(4)
lharoon 0:22612ae617a0 25 {
lharoon 0:22612ae617a0 26 FILL(0xff)
lharoon 0:22612ae617a0 27 KEEP(*(.isr_vector))
lharoon 0:22612ae617a0 28
lharoon 0:22612ae617a0 29 /* Global Section Table */
lharoon 0:22612ae617a0 30 . = ALIGN(4) ;
lharoon 0:22612ae617a0 31 __section_table_start = .;
lharoon 0:22612ae617a0 32 __data_section_table = .;
lharoon 0:22612ae617a0 33 LONG(LOADADDR(.data));
lharoon 0:22612ae617a0 34 LONG( ADDR(.data)) ;
lharoon 0:22612ae617a0 35 LONG( SIZEOF(.data));
lharoon 0:22612ae617a0 36 LONG(LOADADDR(.data_RAM2));
lharoon 0:22612ae617a0 37 LONG( ADDR(.data_RAM2)) ;
lharoon 0:22612ae617a0 38 LONG( SIZEOF(.data_RAM2));
lharoon 0:22612ae617a0 39 __data_section_table_end = .;
lharoon 0:22612ae617a0 40 __bss_section_table = .;
lharoon 0:22612ae617a0 41 LONG( ADDR(.bss));
lharoon 0:22612ae617a0 42 LONG( SIZEOF(.bss));
lharoon 0:22612ae617a0 43 LONG( ADDR(.bss_RAM2));
lharoon 0:22612ae617a0 44 LONG( SIZEOF(.bss_RAM2));
lharoon 0:22612ae617a0 45 __bss_section_table_end = .;
lharoon 0:22612ae617a0 46 __section_table_end = . ;
lharoon 0:22612ae617a0 47 /* End of Global Section Table */
lharoon 0:22612ae617a0 48
lharoon 0:22612ae617a0 49
lharoon 0:22612ae617a0 50 *(.after_vectors*)
lharoon 0:22612ae617a0 51
lharoon 0:22612ae617a0 52 *(.text*)
lharoon 0:22612ae617a0 53 *(.rodata .rodata.*)
lharoon 0:22612ae617a0 54 . = ALIGN(4);
lharoon 0:22612ae617a0 55
lharoon 0:22612ae617a0 56 /* C++ constructors etc */
lharoon 0:22612ae617a0 57 . = ALIGN(4);
lharoon 0:22612ae617a0 58 KEEP(*(.init))
lharoon 0:22612ae617a0 59
lharoon 0:22612ae617a0 60 . = ALIGN(4);
lharoon 0:22612ae617a0 61 __preinit_array_start = .;
lharoon 0:22612ae617a0 62 KEEP (*(.preinit_array))
lharoon 0:22612ae617a0 63 __preinit_array_end = .;
lharoon 0:22612ae617a0 64
lharoon 0:22612ae617a0 65 . = ALIGN(4);
lharoon 0:22612ae617a0 66 __init_array_start = .;
lharoon 0:22612ae617a0 67 KEEP (*(SORT(.init_array.*)))
lharoon 0:22612ae617a0 68 KEEP (*(.init_array))
lharoon 0:22612ae617a0 69 __init_array_end = .;
lharoon 0:22612ae617a0 70
lharoon 0:22612ae617a0 71 KEEP(*(.fini));
lharoon 0:22612ae617a0 72
lharoon 0:22612ae617a0 73 . = ALIGN(0x4);
lharoon 0:22612ae617a0 74 KEEP (*crtbegin.o(.ctors))
lharoon 0:22612ae617a0 75 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
lharoon 0:22612ae617a0 76 KEEP (*(SORT(.ctors.*)))
lharoon 0:22612ae617a0 77 KEEP (*crtend.o(.ctors))
lharoon 0:22612ae617a0 78
lharoon 0:22612ae617a0 79 . = ALIGN(0x4);
lharoon 0:22612ae617a0 80 KEEP (*crtbegin.o(.dtors))
lharoon 0:22612ae617a0 81 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
lharoon 0:22612ae617a0 82 KEEP (*(SORT(.dtors.*)))
lharoon 0:22612ae617a0 83 KEEP (*crtend.o(.dtors))
lharoon 0:22612ae617a0 84 /* End C++ */
lharoon 0:22612ae617a0 85 } > MFlash32
lharoon 0:22612ae617a0 86
lharoon 0:22612ae617a0 87 /*
lharoon 0:22612ae617a0 88 * for exception handling/unwind - some Newlib functions (in common
lharoon 0:22612ae617a0 89 * with C++ and STDC++) use this.
lharoon 0:22612ae617a0 90 */
lharoon 0:22612ae617a0 91 .ARM.extab : ALIGN(4)
lharoon 0:22612ae617a0 92 {
lharoon 0:22612ae617a0 93 *(.ARM.extab* .gnu.linkonce.armextab.*)
lharoon 0:22612ae617a0 94 } > MFlash32
lharoon 0:22612ae617a0 95 __exidx_start = .;
lharoon 0:22612ae617a0 96
lharoon 0:22612ae617a0 97 .ARM.exidx : ALIGN(4)
lharoon 0:22612ae617a0 98 {
lharoon 0:22612ae617a0 99 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
lharoon 0:22612ae617a0 100 } > MFlash32
lharoon 0:22612ae617a0 101 __exidx_end = .;
lharoon 0:22612ae617a0 102
lharoon 0:22612ae617a0 103 _etext = .;
lharoon 0:22612ae617a0 104
lharoon 0:22612ae617a0 105
lharoon 0:22612ae617a0 106 .data_RAM2 : ALIGN(4)
lharoon 0:22612ae617a0 107 {
lharoon 0:22612ae617a0 108 FILL(0xff)
lharoon 0:22612ae617a0 109 *(.data.$RAM2*)
lharoon 0:22612ae617a0 110 *(.data.$RamUsb2*)
lharoon 0:22612ae617a0 111 . = ALIGN(4) ;
lharoon 0:22612ae617a0 112 } > RamUsb2 AT>MFlash32
lharoon 0:22612ae617a0 113
lharoon 0:22612ae617a0 114 /* MAIN DATA SECTION */
lharoon 0:22612ae617a0 115
lharoon 0:22612ae617a0 116 .uninit_RESERVED : ALIGN(4)
lharoon 0:22612ae617a0 117 {
lharoon 0:22612ae617a0 118 KEEP(*(.bss.$RESERVED*))
lharoon 0:22612ae617a0 119 } > RamLoc4
lharoon 0:22612ae617a0 120
lharoon 0:22612ae617a0 121 .data : ALIGN(4)
lharoon 0:22612ae617a0 122 {
lharoon 0:22612ae617a0 123 FILL(0xff)
lharoon 0:22612ae617a0 124 _data = .;
lharoon 0:22612ae617a0 125 *(vtable)
lharoon 0:22612ae617a0 126 *(.data*)
lharoon 0:22612ae617a0 127 . = ALIGN(4) ;
lharoon 0:22612ae617a0 128 _edata = .;
lharoon 0:22612ae617a0 129 } > RamLoc4 AT>MFlash32
lharoon 0:22612ae617a0 130
lharoon 0:22612ae617a0 131
lharoon 0:22612ae617a0 132 .bss_RAM2 : ALIGN(4)
lharoon 0:22612ae617a0 133 {
lharoon 0:22612ae617a0 134 *(.bss.$RAM2*)
lharoon 0:22612ae617a0 135 *(.bss.$RamUsb2*)
lharoon 0:22612ae617a0 136 . = ALIGN(4) ;
lharoon 0:22612ae617a0 137 } > RamUsb2
lharoon 0:22612ae617a0 138
lharoon 0:22612ae617a0 139 /* MAIN BSS SECTION */
lharoon 0:22612ae617a0 140 .bss : ALIGN(4)
lharoon 0:22612ae617a0 141 {
lharoon 0:22612ae617a0 142 _bss = .;
lharoon 0:22612ae617a0 143 *(.bss*)
lharoon 0:22612ae617a0 144 *(COMMON)
lharoon 0:22612ae617a0 145 . = ALIGN(4) ;
lharoon 0:22612ae617a0 146 _ebss = .;
lharoon 0:22612ae617a0 147 PROVIDE(end = .);
lharoon 0:22612ae617a0 148 } > RamLoc4
lharoon 0:22612ae617a0 149
lharoon 0:22612ae617a0 150 PROVIDE(_pvHeapStart = .);
lharoon 0:22612ae617a0 151 PROVIDE(_vStackTop = __top_RamLoc4 - 0);
lharoon 0:22612ae617a0 152 }