天天看點

LPC2103 IAR 配置檔案詳解

作業系統:ucos

編譯器: IAR 5.4

處理器:LPC2103

LPC2103_Flash.icf

define symbol __ICFEDIT_intvec_start__ = 0x00000000;

define symbol __ICFEDIT_region_ROM_start__ = 0x00000044;

define symbol __ICFEDIT_region_ROM_end__   = 0x00007FFF;

define symbol __ICFEDIT_region_RAM_start__ = 0x40000040;

define symbol __ICFEDIT_region_RAM_end__   = 0x40001FFF;

define symbol __ICFEDIT_size_cstack__   = 0x200;

define symbol __ICFEDIT_size_svcstack__ = 0x10;

define symbol __ICFEDIT_size_irqstack__ = 0x50;

define symbol __ICFEDIT_size_fiqstack__ = 0x10;

define symbol __ICFEDIT_size_undstack__ = 0x10;

define symbol __ICFEDIT_size_abtstack__ = 0x10;

define symbol __ICFEDIT_size_heap__     = 0x500;

define memory mem with size = 4G;

define region ROM_region   = mem:[from __ICFEDIT_region_ROM_start__   to __ICFEDIT_region_ROM_end__];

define region RAM_region   = mem:[from __ICFEDIT_region_RAM_start__   to __ICFEDIT_region_RAM_end__];

define block CSTACK    with alignment = 8, size = __ICFEDIT_size_cstack__   { };

define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { };

define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { };

define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { };

define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { };

define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { };

define block HEAP      with alignment = 8, size = __ICFEDIT_size_heap__     { };

initialize by copy { readwrite };

do not initialize  { section .noinit };

place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };

place in ROM_region   { readonly };

place in RAM_region   { readwrite,

                        block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK,

                        block UND_STACK, block ABT_STACK, block HEAP };

LPC2103_RAM.mac

execUserPreload()

{

    __writeMemory32(0x00000002, 0xE01FC040, "Memory"); // MEMMAP = 2;

}

//0xE01FC040為存儲器映射控制寄存器的位址,這條語句的作用是給存儲器映射控制寄存//器寫2即選擇為使用者RAM模式。中斷向量被重新映射到靜态RAM中