Content originally posted in LPCWare by PawelWos on Mon Dec 21 21:03:01 MST 2015
What is the sense of Erase Page?
I want to update my firmware, so my steps are as follows:
1. my memory looks like: some pages app1 that is responsible for update; some pages app2; some pages data
2. I run app1 and in app1 move page by page the data to end of flash because I don't know the size of new app2
3. I update app2
4. I move data back to the next page just after the app2.
When I use PrepareSector, Erase Page, Prepare Sector, Write Page some of my data dissapear. (seems like sector is errased but I want to erase just single page).
Do I have to always use sector update basis? So erase backup sector, move data to backup, erase original sector, move data back to original?
What is the sense of Erase Page?
Ps.
I use the IAP programming schema from the sample code included to LPCXpresso, just instead erase/write sector I use erase/write page commands.