Hey have you got any solution of your problem? If yes, please convey it to me, i m also struck here only, not able to write from RAM to flash bank 0 sector 1..
You haven't told us where the code that performs the IAP is - remember that when programming the flash, the flash is not at the same time available for running any code.