IAP Flash Erase

cancel
Showing results for 
Search instead for 
Did you mean: 

IAP Flash Erase

684 Views
theodorosveryki
Contributor II

Hi,

I am using an LPC812 to write data to Flash and I am using the IAP to prepare, erase and write a page of 64B or a whole sector. 

I noticed that if I select more than one pages to be erased simultaneously, the process occurs in series and it takes a very long time (~100ms per page). However, on the datasheet (LPC81xM) it mentions that the erase time should be ~100ms for a page or multiple consecutive pages, a sector or multiple consecutive sectors which means that the process should happen in parallel.

Am I using the IAP routines in a wrong way or it is possible to erase in parallel only using the ISP?


Thanks in advance,
Theo

Labels (1)
0 Kudos
5 Replies

193 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi Theodoros Verykios,

Thank you for your interest in NXP Semiconductor products and the opportunity to serve you.

I was wondering if you can share the demo then I can ran it with the LPCXpresso812 board to replicate the issue.

I'm looking forward to your reply.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

193 Views
theodorosveryki
Contributor II

Hi jeremyzhou,

Thank you very much for your kind response and I really appreciate your time.

The bit of code that does the part I am interested into is the following:

#include "LPC8xx.h"
#include <stdio.h>

#include "iap_driver.h"

int main(void) 
{

iap_status = (__e_iap_status) iap_prepare_sector(1,1);

iap_status = (__e_iap_status) iap_erase_page(16,25);

}

The iap_erase_page command is given in the User Manual on page 294 and the two arguments it accepts is the first and the last page that are going to be erased. Sector 1 includes pages 16-31 and according to the datasheet the erase time should be ~100ms for a page or multiple consecutive pages, a sector or multiple consecutive sectors which means that the process should happen in parallel. However, according to my measurements, each page takes ~100ms to be erased which is not what I expected.

Does this mean that in order to erase consecutive pages/sectors in parallel I need to do it via ISP and when using the IAP commands the process will be executed in series?

Thanks in advance,
Theo

0 Kudos

193 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi Theodoros Verykios,,

Thanks for your reply.

1) Does this mean that in order to erase consecutive pages/sectors in parallel I need to do it via ISP and when using the IAP commands the process will be executed in series?

Yes, I think so.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

193 Views
theodorosveryki
Contributor II

Hi again jeremyzhou‌,

I ran a quick test to erase consecutive sectors instead of consecutive pages and I found out that the time remains constant regardless of the number of sectors - ie when you erase consecutive sectors it takes only ~100ms whereas when you erase consecutive pages on the same sector it takes ~100ms per page. What really impressed me however is that the amount of energy required to erase a single sector is identical with the energy required to erase a number of consecutive sectors which does not apply for erasing pages as the time is multiple.

Can you please confirm whether this is expected and if so, why does it happen.

Thanks in advance,
Theo

0 Kudos

193 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi Theodoros Verykios,

1) Can you please confirm whether this is expected and if so, why does it happen.

Sorry, I'm afraid that I can't answer this you right now, it beyond my ability and I need to contact with Design team for checking.

I'll you ASAP if I get some replies.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos