Content originally posted in LPCWare by Lea on Sat Feb 13 00:44:20 MST 2016
I have written a bootloader for the LPC11C24, that works so far.
The Blinky program from the LPCOpen is running when I flash the firmware with the bootloader, but it does not supports interrupts in my user app.
I copy the vector table from my user app to the location of the vector table of the bootloader before I call the user app.
Is there anything else to be noted?
void run_userApp(void)
{
unsigned int entry;
SysTick->CTRL = ~(1<<0);
NVIC_DisableIRQ(SysTick_IRQn);
__disable_irq();
// copy first 0x200 bytes (vector table)
Prepare_Copy((uint32_t *)APP_START_ADDR, (uint32_t *)0x10000000, 512);
// User RAM Mode. Interrupt vectors are re-mapped to Static RAM
LPC_SYSCTL -> SYSMEMREMAP = 0x01;
__enable_irq();
__set_MSP(*(uint32_t *)APP_START_ADDR);
entry = *((volatile unsigned int *)(APP_START_ADDR + 4));
((void(*)(void))entry)();
}