[LEFT]MEMORY { /* Define each memory region */ MFlash512 (rx) : ORIGIN = 0x0, LENGTH = 0x72000 /* 512k - 28k - 4k*/ RamLoc32 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x8000 /* 32k */ RamAHB32 (rwx) : ORIGIN = 0x2007c000, LENGTH = 0x8000 /* 32k */[/LEFT] [LEFT]} /* Define a symbol for the top of each memory region */ __top_MFlash512 = 0x0 + 0x72000; __top_RamLoc32 = 0x10000000 + 0x8000; __top_RamAHB32 = 0x2007c000 + 0x8000;[/LEFT] [LEFT]SECTIONS {[/LEFT] [LEFT]/* MAIN TEXT SECTION */ .text : ALIGN(4) { FILL(0xff) KEEP(*(.isr_vector))[/LEFT] [LEFT]/* Global Section Table */ . = ALIGN(4) ; __section_table_start = .; __data_section_table = .; LONG(LOADADDR(.data)); LONG( ADDR(.data)) ; LONG( SIZEOF(.data)); LONG(LOADADDR(.data_RAM2)); LONG( ADDR(.data_RAM2)) ; LONG( SIZEOF(.data_RAM2)); __data_section_table_end = .; __bss_section_table = .; LONG( ADDR(.bss)); LONG( SIZEOF(.bss)); LONG( ADDR(.bss_RAM2)); LONG( SIZEOF(.bss_RAM2)); __bss_section_table_end = .; __section_table_end = . ; /* End of Global Section Table */[/LEFT] [LEFT]*(.after_vectors*)[/LEFT] [LEFT]*(.text*) *(.rodata .rodata.*) . = ALIGN(4);[/LEFT] [LEFT]} > MFlash512[/LEFT] [LEFT]/* * for exception handling/unwind - some Newlib functions (in common * with C++ and STDC++) use this. */ .ARM.extab : ALIGN(4) { *(.ARM.extab* .gnu.linkonce.armextab.*) } > MFlash512 __exidx_start = .;[/LEFT] [LEFT].ARM.exidx : ALIGN(4) { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } > MFlash512 __exidx_end = .;[/LEFT] [LEFT]_etext = .;[/LEFT] [LEFT].data_RAM2 : ALIGN(4) { FILL(0xff) *(.data.$RAM2*) *(.data.$RamAHB32*) . = ALIGN(4) ; } > RamAHB32 AT>MFlash512[/LEFT] [LEFT]/* MAIN DATA SECTION */[/LEFT] [LEFT].uninit_RESERVED : ALIGN(4) { KEEP(*(.bss.$RESERVED*)) } > RamLoc32[/LEFT] [LEFT].data : ALIGN(4) { FILL(0xff) _data = .; *(vtable) *(.data*) . = ALIGN(4) ; _edata = .; } > RamLoc32 AT>MFlash512[/LEFT] [LEFT].bss_RAM2 : ALIGN(4) { *(.bss.$RAM2*) *(.bss.$RamAHB32*) . = ALIGN(4) ; } > RamAHB32[/LEFT] [LEFT]/* MAIN BSS SECTION */ .bss : ALIGN(4) { _bss = .; *(.bss*) *(COMMON) . = ALIGN(4) ; _ebss = .; PROVIDE(end = .); } > RamLoc32[/LEFT] [LEFT]PROVIDE(_pvHeapStart = .); PROVIDE(_vStackTop = __top_RamLoc32 - 0);[/LEFT] } |
/* =============================================================================== Name : main.c Author : $(author) Version : Copyright : $(copyright) Description : main definition =============================================================================== */ #ifdef __USE_CMSIS #include "LPC17xx.h" #endif #include <cr_section_macros.h> #include <NXP/crp.h> // Variable to store CRP value in. Will be placed automatically // by the linker when "Enable Code Read Protect" selected. // See crp.h header for more information __CRP const unsigned int CRP_WORD = CRP_NO_CRP ; #include <stdio.h> [COLOR=Red]__DATA(RAM2) uint16_t demo[200];[/COLOR] int main(void) { [COLOR=Red] demo[0] = 0x1234;[/COLOR] printf("Hello World\n"); .... |