I'm using the swap facility on the MK22FN1M0 parts to implement bootloaders. Most parts this works fine on. I've got some parts that it gives me problems with and it appears to be something with a silicon revision... Specifically 2N03G doesn't usually work and 3N03G usually does. Not clear if this is the real problem but...
The command that eventually gives me problems is using the Freescale functions _PFlashSwapCtl() and related.
It ends up sending a flash command sequence to FCCOB of: 0x46 (FTFx_PFLASH_SWAP),addr MSB, addr, Addr LSB, 1, 0xFF, 0xFF, 0xFF
the FSTAT register comes back with a status of 0xA0 (setting the ACCERR bit).
So the question here is if there is some change to behaviour of the swap system over the various silicon revisions...
Also we've had 2N03G parts that have worked until we reprogrammed them with a J-Link flash (SWD) and then it stopped working. We have no problem programming 3N03G parts this way.
Going thru this closer the application first checks status of the swap system (swap command which returns fine and the FCC0B5 register is saying UNINIT. This then attemps to do the initialize abot with address 0x7F000 which is setting the ACCERR bit doing it.