I want to write a simple code read protection for LPC5528, which can be enabled/disabled via USB.
Until now, I have only LPC55S28.
Afraid of bricking the device, I tried writing in customer area first.
I tried writing on a LPC55S28 via FFR this way:
DisableIRQ(); setcpu100MHz();
Status = FLASH_Init(&flashInstance); //returns 0
Status = FFR_Init(&flashInstance); //returns 0=ok
FLASH_GetProperty(&flashInstance, kFLASH_PropertyPflashPageSize, &PflashPageSize);
Status = FFR_InfieldPageWrite(&flashInstance, iap_FlashRam, len);
//returns 0x64. why?
iap_flashram contains a copy of the 0x09df00 region with modified data at offset 0x100. len is 32 bytes.