Content originally posted in LPCWare by Sbriz on Fri Sep 28 03:46:58 MST 2012
Hi Daniel,
sorry, I was wrong with the code I posted to you.
I use iap_entry (command,&result) because I declare "result" as a single unsigned long variable, and not as an unsigned long array of 4 elements, as wrongly described in my previous post. So the function I used was correct.
However, to be sure, I tried also with the code you kindly posted in this tread, but the result is still a BUSY response from the microcontroller (result[0]=0x0B). As for my previous code, also with your code the Page Erase fails too, while the Sector BlankCheck (substantially the same procedure structure as Sector Erase except for Prepare Erase) works correctly.
The Sector Erase and Page Erase routine work only when the start address and end address covers the entire memory, that means that the microcontroller recognizes correctly the parameters and skips to the internal masserase routine, as described in the user's manual (page 309).
So my question is: could be something corrupted in this NXP embedded routines for some microcontrollers? (I tried also with another LPC1225 microcontroller, with the same mask, and the result was the same).