LPC2103 IAR 配置文件详解

操作系统:ucos

编译器: IAR 5.4

处理器:LPC2103


LPC2103_Flash.icf

/*###ICF### Section handled by ICF editor, don't touch! ****/

/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
/*-Memory Regions-*/
/*这是由于在启动文件中跳转指令占前面的0x00~0x1f,接下来是跳转的地址标号0x20~0x3f*/
/*不知道后面为什么空了4个字节*/
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;
/*-Sizes-*/
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;
/**** End of ICF editor section. ###ICF###*/

/*定义一个可编址的存储地址空*/
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__     { };

/*jtk 在程序启动时初始化读写段*/
initialize by copy { readwrite };
/*jtk 对声明为_no_init_的段启动时不初始化*/
do not initialize  { section .noinit };
/*把 intvec 段定义到地址0x00处*/
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };

/*把一系列sections和blocks放置在某个region中。sections和blocks将按任意顺序放置。*/
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中

你可能感兴趣的:(ucos)