Writing to and reading data from Flash using IAP
Have you seen the IAP flow mentioned in section 37.8 of the data sheet? Make sure you follow all the steps mentioned there. Also your flash can be written to only if the address does not contain any data currently. If it was previously written you need to erase the entire sector and then program it again.Read this application note for an example on IAP for LPC17xx series. You may have a certail level of write protection/security enabled by default.