Content originally posted in LPCWare by kraln on Sat May 31 13:10:35 MST 2014
Hi All,
I'm having an issue whereby sometimes the IAP call to erase sectors on a LPC1343 doesn't ever return... but it erases the sectors. This leads to the awkward situation in which the watchdog kicks and the micro reboots with a completely erased internal flash.
I have reserved 32 bytes of memory for IAP as per the datasheet, relocated the relevant code to RAM, and disabled interrupts globally before attempting to use the IAP. Depending on the exact order of operations, I can either reliably cause a hard fault, or somewhat reliably avoid it.
I was wondering if there is any documentation, beyond the 32 bytes of RAM, on what the exact setup for the IAP commands should be? Or, failing that, any further best practices for avoiding lockups?
Regards,
Jeff