Hi Hui_Ma,
See code source, other code normal error, I creat simple test = error , when use ISR in App2.
//------------------------------------------------------------
void main_run (void){ // App1
uint32 i=0,x=0,_addr, _stackp;
byte asc=0;
BL_FLASH1 = FLASH1_Init( &OpStatus); // init Flash
WAIT1_Waitms(1);
while( asc != 'N'){ // wait end table
UTIL1_strcpy(in_buffer,46,app2_hex[x++] ); // Copy App2 ( Hex, charged table )
asc = in_buffer[0];
if( asc != 'N' ){
convert_line_hex(); // convert hex ascii to Hex value
status_flash_busy();
i = FLASH1_Write( BL_FLASH1, my_hexline.HEX_linedata,
my_hexline.hex_addr,
my_hexline.hex_count); //program App2 in flash memory
WAIT1_Waitms(5);
status_flash_busy();
}
}
x=0;
for(;;){
if( x == 9){ // insert value 9, to goto App2
_stackp = ( *(( unsigned long*)&MEMBASE + 0)); /// BASE = 0x8000
_addr = ( *(( unsigned long*)&MEMBASE + 0x6E)); // BASE + 0x6E = address direct entry pointer main_run
// SCB_VTOR = 0x8000; // vector in fash_0x8000
reloked_vector(); // vector in ram_0x1FFF8000
JumpToUserApplication( _stackp , _addr );
x=0;
}
WAIT1_Waitms(1000);
LED1_Neg();
}
}
//----------------------------------------------------- see debug

thanks,
Carlos