Hi Aashir
I don't have any problems with the links - the first is to another forum entry - if the links don't work for you just do a search in the forum for "SWAP" and you will find these and possibly others.
If you check the uTasker open source project it includes an API that is simple to use.
fnSwapMemory(1); returns the present state of the SWAP blocks
#define SWAP_STATE_UNINITIALISED 3
#define SWAP_STATE_SWAPPED 2
#define SWAP_STATE_USING_1 1
#define SWAP_STATE_USING_0 0
#define SWAP_COMMAND_FAILURE -1
#define SWAP_ERASE_FAILURE -2
Once new code has been copied it is swapped using
fnSwapMemory(0);
At http://www.utasker.com/kinetis/FRDM-K64F.html you will find binaries that allow you to test this on a FRDM-K64F, as well as loading new code via USB, SD card or Web Browser.
If you are doing it for a school project you will find all that you need to experiment and learn in the open source version. Should you have a professional requirement it is all available as a supported turn-key solution that will avoid any project risks or delays.
Regards
Mark
P.S. No CPU register level coding is usually needed to do such things, although there is a routine called
extern void start_application(unsigned long app_link_location);
that is available in case one wants to jump to another application without going through a reset at the the usual reset vector location (which indeed sets PC and SP accordingly).