Hi Lukas,
Thanks for the reply.
We are disabling the interrupts before jump. Please find the below code.
After the execution of jumptoUserApplication()
the code is getting stuck in AC0_IRQHandler().
Please help me where am I going wrong

#include "timeout.h"
#include "comm.h"
#include "clock.h"
/* Bootloader definitions */
/* Start address for the application received by the bootloader
* application vector table should start at this address
* */
#define APP_START_ADDRESS 0x1000
/* Global variables */
uint8_t boot_from_comm = 0; /* Used to signal activity on the comm channel */
/* Prototype */
void JumpToUserApplication( unsigned int userSP, unsigned int userStartup);
void NVIC_SCBDeInit(void);
/* Main Application*/
int main(void)
{
/* Initialize clock */
clock_initi();
/* Initialize communication interfaces */
init_comm();
/* Initialize timeout */
init_timeout();
/* Check if boot start has been received or timeout occurred */
do{
uint8_t word_received = comm_status_rx();
if(word_received){
boot_from_comm = 1;
comm_download_app();
}
} while((!timeout()) & (!boot_from_comm));
/* Disable all systems and leave device as if coming out of reset */
/* Relocate vector table */
S32_SCB->VTOR = (uint32_t)APP_START_ADDRESS;
NVIC_SCBDeInit();
uint8_t v_Index_u8r;
for(v_Index_u8r = 0U; v_Index_u8r < 8U; v_Index_u8r ++)
{
S32_NVIC->ICER[v_Index_u8r] = 0xffffffff;
S32_NVIC->ISER[v_Index_u8r] = 0xffffffff;
S32_NVIC->ICPR[v_Index_u8r] = 0xffffffff;
}
disable_timeout();
disable_comm();
reset_clock();
/* Check if a valid application is loaded and jump to it */
JumpToUserApplication(*((uint32_t*)APP_START_ADDRESS), *((uint32_t*)(APP_START_ADDRESS + 4)));
/* Should never return from application code */
for (;;) {};
/* Never leave main */
return 0;
}
void NVIC_SCBDeInit(void)
{
S32_SCB->ICSR = 0x0A000000;
S32_SCB->VTOR = 0x00000000;
S32_SCB->AIRCR = 0x05FA0000;
S32_SCB->SCR = 0x00000000;
S32_SCB->CCR = 0x00000000;
S32_SCB->SHPR1 =0x00000000;
S32_SCB->SHPR2 =0x00000000;
S32_SCB->SHPR3 =0x00000000;
S32_SCB->SHCSR = 0x00000000;
S32_SCB->CFSR = 0xFFFFFFFF;
S32_SCB->HFSR = 0xFFFFFFFF;
S32_SCB->DFSR = 0xFFFFFFFF;
}
/**
* Used to jump to the entry point of the user application
* The Vector table of the user application must be located at 0x1000
*
* */
void JumpToUserApplication( unsigned int userSP, unsigned int userStartup)
{
// /* Check if Entry address is erased and return if erased */
if(userSP == 0xFFFFFFFF){
return;
}
/* Set up stack pointer */
__asm("msr msp, r0");
__asm("msr psp, r0");
/* Jump to application PC (r1) */
__asm("mov pc, r1");
}