Check out this thread, possibly this was the problem: LPC4337 IAP erase flash hang
In one version of LpcOpen, LPC_FMC is being declared as a pointer to a pointer but it is not. It is a pointer to a struct.
#define LPC_FMC ((LPC_FMC_T * *) LPC_FMCA_BASE)
Let me know if this has helped, as I was facing some similar issues.