I've written and read from Flash with an LPC2148 without issues. I went to put this code into the LPC2378 and it locks up every time I try to do anything.
unsigned char vals[256]; . . . erase (10); //erase sector 10 program (0x18000, vals, sizeof (vals)); //program sector 10 with vals[256]
This is all I'm trying to do. I'm using the stock IAP.C code from Keil that I used last time. This disabled all interrupts before doing anything, sets the
iap.par[2] = CCLK;
, should take care of everything I think.
I have also tried separating this code out into a separate source file, and running that in IRAM along with the IAP.C to no avail.
Trying to erase or write to flash halts the running, and I'm forced to reset everything every time. I'm running out of ideas!