IAP
1, APP receiving program data, there are two serial commands, packet 1 is an integer, bulk packages 2 (last packet);
2, enter a conditional jump:
/*
APP program has been downloaded by entering the time-out program update is complete
ABCD
meet the following conditions will jump:
AB + the ABD the ABC + *
A * D
* /
Timeout: enter the APP, but serial communication is suddenly interrupted, the program will continue to run down, it can only be a case of the program has been downloaded more than a certain time has not downloaded the new program, directly jump
APP
1, magic wand set start address of the program;
2, the program set the interrupt vector table a new address: SCB-> VTOR = FLASH_BASE | 0x10000; / * the Vector Relocation in the Table Internal FLASH * /.
3, can be reset into the IAP: __ set_FAULTMASK (. 1); NVIC_SystemReset ();