Hello,
There is a jump function from bootloader to application code, you can refer to:
//-----------------------------------------------------------------------------
// FUNCTION: JumpToUserApplication
// SCOPE: Bootloader application system function
// DESCRIPTION: The function startup user application
//
// PARAMETERS: pointer on user vector table
//
// RETURNS: function never go back
//-----------------------------------------------------------------------------
void JumpToUserApplication(LWord userSP, LWord userStartup)
{
// set up stack pointer
__asm("msr msp, r0");
__asm("msr psp, r0");
// Jump to PC (r1)
__asm("mov pc, r1");
}
Before jump, you'd better disable interrupt, and call this jump function like below:
// relocate vector table
SCB_VTOR = RELOCATED_VECTORS;
AppIDC = 0;
// Jump to user application
JumpToUserApplication(*((unsigned long*)RELOCATED_VECTORS), *((unsigned long*)(RELOCATED_VECTORS+4)));
return 0;
About Copy Flash to RAM, I think you need copy before mian of application project, you can refer to the file startup_lpc804.c of SDK demos.
BR
Alice