CMSIS2000
0.0.7
|
* * * THIS SCRIPT HAS NO MEMORY SECTIONS DEFENITON !!!!! USE THIS SCRIPT AS A PART OF OTHER * * * * FOR EXAMPLE: * * INCLUDE ../CMSIS/Device/NXP/LPC2xxx/Source/GCC/lpc24x8_sect.ld * * INCLUDE ../CMSIS/Device/NXP/LPC2xxx/Source/GCC/lpc2xxx_generic_flash.ld * * * * The Linker Script defines how the code and data emitted by the GNU C compiler and * * assembler are to be loaded into memory (code goes into FLASH, variables go into RAM). * * * * Any symbols defined in the Linker Script are automatically global and available * * to the rest of the program. * * * * To force the linker to use this LINKER SCRIPT, just add the * * -T demo2106_blink_flash.cmd directive to the linker flags in the makefile. * * * * LFLAGS = -Map main.map -nostartfiles -T YOU_SCRIPT.cmd * * * * * * The Philips boot loader supports the ISP (In System Programming) via the serial port and the IAP * * (In Application Programming) for flash programming from within your application. * * * * The boot loader uses RAM memory and we MUST NOT load variables or code in these areas. * * The easy way to prevent the linker from loading anything into a memory area is to define* * a MEMORY region for it and then avoid assigning any .text, .data or .bss sections into it.* * MEMORY * * { * * ram_isp_low(A) : ORIGIN = 0x40000120, LENGTH = 223 * * * * } * * * * RAM used by boot loader: 0x40000120 - 0x400001FF (223 bytes) for ISP variables * * 0x4000FFE0 - 0x4000FFFF (32 bytes) for ISP and IAP variables* * 0x4000FEE0 - 0x4000FFDF (256 bytes) stack for ISP and IAP * * * *-----------------------------------------------------------------------------------------* * * * * * MEMORY MAP * * | |0x40xx0000 * * END OF RAM.-------->|---------------------------------| * * | SVC Stack 8 bytes |0x40xxxFFC <------- _stack_end * * .-------->|---------------------------------| * * | FIQ Stack X bytes |0x40xxxxxx * * .-------->|---------------------------------| * * | ABT Stack Y bytes |0x40xxxxxx * * .-------->|---------------------------------| * * | UDF Stack Z bytes |0x40xxxxxx * * .-------->|---------------------------------| * * | IRQ Stack I bytes |0x40xxxxxx * * .-------->|---------------------------------| * * . | |0x40xxxxxx * * . | stack area for user program | * * . | | * * . | | * * . | | * * . | | * * . | | * * . | | * * . | free ram | * * ram | | * * . | | * * . | ^^ ^MALLOC HEAP HERE ?^^^^^ | * * . | | * * . |.................................|0x40000xxx <---------- _bss_end * * . | | * * . | .bss uninitialized variables | * * . |.................................|0x40000xxx <- _bss_start, _edata* * . |.................................| * * . | | * * . | | * * . | | * * . | DATA AREA | * * . | (.data) | * * . | (.text.ram_code) | * * . | | * * .-------> |---------------------------------|0x00000xxx <----------- _data * * . |---------------------------------|0x40000040 * * . | |0x4000003F * * . | Interrupt Vectors (re-mapped) | * * . | 56-64 bytes |0x40000000 * * .-------->|---------------------------------| * * | | * * * * * * * * | | * * .--------> |---------------------------------| * * . | |0x00xxxFFF * * . | | * * . | | * * . | | * * . | | * * . | | * * . | unused flash eprom | * * . | | * * . |.................................| * * . | | * * . | | * * . | | * * . | copy of .data area | * * flash | (.data) | * * . | (.text.ram_code) | * * . | | * * . |---------------------------------|0x00000xxx <----------- _etext * * . | | * * . | READ ONLY DATA | * * . | *(.rodata*) | * * . | | * * . |---------------------------------| * * . | | * * . | C code | * * . | *(.text) | * * . |---------------------------------| * * . | |0x00000xxx * * . | Startup Code | * * . | (assembler) | * * . | *(.text.vectors) | * * . |---------------------------------|0x00000064 Reset_Handler * * . | SELF COPY CODE HERE (assembler) | * * . | *(.text.vectors) |0x00000040 sc_here * * . |---------------------------------| * * . | Interrupt Vector Table | * * . | 56-64 bytes | * * .--------->|---------------------------------|0x00000000 _vectors, * * _vectors_start,_startup * * * * * * * * Author: James P. Lynch * * Author: Dmitriy A. Cherepanov *