Erase operation taking too long to complete

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Erase operation taking too long to complete

1,733 Views
satyapraneethvu
Contributor I

We are using a Freescale microcontroller for a project and have a few queries about the time required to erase the flash memory. We are currently using the Freescale MC9S12ZVC-64 Pin (ECC: 192 Kbyte) package option, Compiler as Freescale CodeWarrior v10.6.4 .

 

We have created a Flash library, which is executing from the RAM for the erase and program functionalities. Please find the attachment of the code for Erase functionality. This function updates the necessary registers such as the FCLKDIV,FSTAT and the FCCOB register. And monitor the FSTAT register to ensure that the erase is complete.

 

Similarly the same is done for the Program function. We have observed that both the Erase and Program operations work as expected to. But the Erase operation takes a very long time to erase the Flash area.

 

These are the timings observed during our internal testing.

 

Size ( in bytes)

Time ( in Seconds)

10

0.05

10Kb

26

120Kb

320

 

 

Can you help us analyze why the microcontroller is taking so much time to erase the Flash Memory.

Edit:  Added the attachment

0 Kudos
Reply
3 Replies

1,550 Views
satyapraneethvu
Contributor I

Sorry for the Delayed response Daniel,

We placed only the launch and wait command in RAM. This works fine.. Thanks !

0 Kudos
Reply

1,550 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

The code you attached is full of macros and functions without definition. I’m not able to understand what it does.

Is the whole function in ram? The only code that needs to be in ram is

FSTAT_CCIF = 1;              // launch command

while(FSTAT_CCIF == 0); // wait for done

 

Please try the example.

 

Regards,

Daniel

0 Kudos
Reply

1,550 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Do you erase the flash by sectors?

I do not see the attachment. Could you please attach the erase function?

You can refer to the attached example.

Regards,

Daniel

0 Kudos
Reply