小弟想把keil mdk下的LPC1114工程移植到IAR for ARM下,目前来说已经成了一个半成品,在keil下工程调试时可以在IDE中复位MCU,然后从头开始运行。但这个功能在IAR下不知道为何就是无法正常使用,如果点击回到程序开头那个按钮,程序依然不会回去到main函数开始处,而是继续保留在当前执行的地方。我怀疑我的启动文件有问题,大家知道在IAR下可以使用c文件编写启动文件也可以使用汇编文件编写启动文件,我自己参照其他的厂商的芯片编写了一个c语言版本的启动文件,如下,可能存在问题。但是不知道问题在哪?哪位大侠知道LPC11xx系列片子的IAR启动文件(.s 或.c都可以,只要能正常使用)能不能帮我贴一份出来,感激不尽!
//***************************************************************************** // // Enable the IAR extensions for this source file. // //***************************************************************************** #pragma language=extended
//***************************************************************************** // // The entry point for the application. // //***************************************************************************** extern void __iar_program_start(void);
//***************************************************************************** // // Reserve space for the system stack. // //***************************************************************************** #ifndef STACK_SIZE #define STACK_SIZE 120 #endif static unsigned long pulStack[STACK_SIZE] @ ".noinit";
//***************************************************************************** // // A union that describes the entries of the vector table. The union is needed // since the first entry is the stack pointer and the remainder are function // pointers. // //***************************************************************************** typedef union { void (*pfnHandler)(void); unsigned long ulPtr; } uVectorEntry;
//***************************************************************************** // // The minimal vector table for a Cortex-M0. Note that the proper constructs // must be placed on this to ensure that it ends up at physical address // 0x0000.0000. // //*****************************************************************************
__root const uVectorEntry __vector_table[] @ ".intvec" = { { .ulPtr = (unsigned long)pulStack + sizeof(pulStack) }, // The initial stack pointer __iar_program_start, // The reset handler NmiSR, // The NMI handler FaultISR, // The hard fault handler 0, // The MPU fault handler 0, // The bus fault handler 0, // The usage fault handler 0, // Reserved 0, // Reserved 0, // Reserved 0, // Reserved IntDefaultHandler, // SVCall handler IntDefaultHandler, // Debug monitor handler 0, // Reserved IntDefaultHandler, // The PendSV handler IntDefaultHandler, // The SysTick handler
//***************************************************************************** // // This is the code that gets called when the processor receives a NMI. This // simply enters an infinite loop, preserving the system state for examination // by a debugger. // //***************************************************************************** static void NmiSR(void) { // // Enter an infinite loop. // while(1) { } }
//***************************************************************************** // // This is the code that gets called when the processor receives a fault // interrupt. This simply enters an infinite loop, preserving the system state // for examination by a debugger. // //***************************************************************************** static void FaultISR(void) { // // Enter an infinite loop. // while(1) { } }
//***************************************************************************** // // This is the code that gets called when the processor receives an unexpected // interrupt. This simply enters an infinite loop, preserving the system state // for examination by a debugger. // //***************************************************************************** static void IntDefaultHandler(void) { // // Go into an infinite loop. // while(1) { } }