I ported my project that ran on LPCXPresso version 7.9.2 to MCUXpresso 11.6. The project worked normally, however I had a failure in a feature. In this functionality, at some point I run the software only in RAM and completely erase the flash and then write a new version to the flash. The process fails with a hard fault error when I try to delete the flash. I am using the IAP_ENTRY functions. I suspect the boot sector is protected but I can't figure out how to unlock it.
Hi Alice, The memory I'm erasing is the entire flash. When I try to delete it, the code is running in RAM. I'm trying to do this so that new code can be written to flash. This code works perfectly in LPCXpresso version 7.9.2. IDE. I can't figure out why after importing the project, it doesn't work in MCUXpresso.
Thanks Alice, but it isn't the question. We need to erase the flash on the flight, in run time, for updating with a new code, why we need to use IAP functions. If you want, I can post the code.
Recommend you use this tool to erase to check whether the flash can erased, because you said "boot sector is protected", also we can eliminate hardware issue firstly.