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