Content originally posted in LPCWare by usb10185 on Tue Sep 17 07:09:14 MST 2013
Hi,
You need to setup a pointer to the memory location of interest.
Have a look at some of the IAP Application notes and associated code for the various LPC parts, in there there is code that programs Flash via IAP and then does a compare. Exactly what you are looking for! Snip below....
/** The area will be erase and program */
#define FLASH_PROG_AREA_START 0x8000
/** The origin buffer on RAM */
#define BUFF_SIZE 1024
// Compare
for ( i = 0; i < FLASH_PROG_AREA_SIZE/BUFF_SIZE; i++ )
{
ptr = (uint8_t*)(FLASH_PROG_AREA_START + i*BUFF_SIZE);
status = Compare(ptr, buffer,BUFF_SIZE);
if(status != CMD_SUCCESS)
{
_DBG("Compare memory failed with code is ");_DBD(status);_DBG_("");
while(1);
}
}