Hi Michael
If you want to jump to your application, you should be sure of the memory allocation, the memory address of your app and the interrupt vector table.
The next image show an example of memory map

For more information about the memory distribution and the protocol see the next application note
http://cache.nxp.com/files/microcontrollers/doc/app_note/AN2295.pdf
To be sure in which mode the uC is, you should ask of the status and decide if you want to jump to the application.
// read the srs register
if(SRS_REG & SRS_POR_MASK)
enableBootMode = 1;
. // Bootloader protocol runs !
After that you will jump to the application sending parameters the stack pointer and the program counter and do some assembly instructions
// Jump to user application
JumpToUserApplication(*((unsigned long*)RELOCATED_VECTORS), *((unsigned long*)(RELOCATED_VECTORS+4)));
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");
}
For more details, please check this document
https://community.freescale.com/docs/DOC-330712
Also, there is an USB Bootloader that is similar than the other one, provides different architecture for the bootloader, but needs the same memory distribution.
And for be sure if you want to jump to the application.
static void Switch_mode(void)
{
/* Body */
volatile uint_32 temp = 1; /* default the button is not pressed */
/* Get PC and SP of application region */
New_sp = IMAGE_ADDR[0];
New_pc = IMAGE_ADDR[1];
if(temp)
{
if((New_sp != 0xffffffff)&&(New_pc != 0xffffffff))
{
asm
{
ldr r4,=New_sp
ldr sp, [r4]
ldr r4,=New_pc
ldr r5, [r4]
blx r5
}
}
You already have the image address for the stack pointer and the program counter, you verify that the address are correct and if exist a code for application and then you load to the SP and PC in an assembly way.
Hope it helps
Mario