About IAP mechanism:
Firstlet’s talk about why to use the IAP. Most obviously, using IAP will replace theoutside Flash burner like JLINK. Using IAP will also give the user the freedomto change their code as their program is running. More specifically, in somecases when we put the chip into a hermitic box, like the sensor placed underthe water, we will have much more difficulties to change and burn the code intothe chip. But with the help of the IAP, we can avoid such difficulties bychanging the process of embedding code. The original way is to burn the flashof the chip by the outside burner physically connected to the chip while theIAP is burning the code by the chip itself. Therefore, there are actually two partsof the code burnt in the chip. One is the IAP code which plays the role of theboot loader and APP burner and the other is the APP code which is programmed bythe user. When the chip is reset and the flash pointer will point at the beginningof the IAP