Hello,
My IAP functions update the flash, but toward the end of each programmed block there is always inconsistent data at the same offset from the beginning of the block (mostly): it differs from the data provided by the buffer in internal RAM but the IAP function "copy RAM to flash" returns no error (and yet - the programmed code is corrupt)! My chip is clocked by IRC, 12[MHz] (no PLL). I tried different IAP blocks sizes (using 256 now but it does not matter), clock speeds - to no avail. What could be the cause of this?
I did manage to make this work by copying the payload into a separate buffer and programming that one. "Ah", you're probably saying, "it's alignment of the source buffer". Maybe, but the original address of the source buffer was word aligned (0x1000000C). About stack overflows: Maybe, but not very likely given that the source buffer was intact _after_ programming...! It must be an alignment issue of some kind - it is indeed encouraging to know that the IAP procedures of the LPC1114 report "I'm done, no issues encountered" even if programming actually failed...! I asked NXP.
At least for other NXP chips, the IAP functions does need a number of bytes of RAM for own use.