#ifdef __DEBUG_RAM
LPC_SYSCON->SYSMEMREMAP = 0x1; //01向量表映射在内部RAM
#else
#ifdef __DEBUG_FLASH
LPC_SYSCON->SYSMEMREMAP = 0x2; //02或03向量表映射在内部FLASH(00映射在Boot Rom)
#endif
#endif
系统默认是将向量表映射在内部FLASH的0地址起始,但是我试着想将向量表映射到内部RAM,系统却跑飞了或者进入死循环!
用下面的代码在系统初始化完毕后,将向量表COPY过来也不行,不知道大家有没有试过?
#ifdef __DEBUG_RAM
// Copy vectors table from 0x0 to RAM
src = (volatile unsigned int *)0;
dst = (volatile unsigned int *)0x10000000;
size = 0xc0 >> 2;
//size = 0x200>> 2;
do
{
*dst++ = *src++;
}while (--size);
LPC_SYSCON->SYSMEMREMAP = 0x1; //01向量表映射在内部RAM
#endif
while(1)
{
LED_TOG;
delay(8000);
} |