d flash memory re-programming : Query : help

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

d flash memory re-programming : Query : help

574 Views
FIDDO
Contributor III

Hi All,

Currently i'm using MC9S12xhy controller, where d flash is used instead of external EEprom.

 

As per my understanding, i will erase the the necessary d-flash sector in  my first operation cycle .According to the controller specification i can erase D-FLASH in  terms sectors  whereas i can  write it  in word-word basis.

 

Controller document advice us to keep the wod or phrase in erased state before programming it.

 

In case i need to re program only one particular word in a sector, then i need take the RAM copy  of the d flash sector ,erase the whole sector,update the RAM copy with the new change and then program it.

 

I'm confused..is it necessary to  erase for every re-programming?

 

Please helpe me on this regard!

Labels (1)
1 Reply

370 Views
DPB
NXP Employee
NXP Employee

Hello

Yes it is necessary to erase the associated sector before re-programming locations that are already programmed.

It is necessary that each D-FLASH word is in the erased state before being programmed.

If a location needs to be updated with a new value, then it must be erased first.

The smallest range of the D-FLASH that can be erased is a sector, which means that to update a single word, then the RAM copy and update method you described is correct.

If the application allows, the reprogramming can wait until multiple words in the RAM copy have been updated, to reduce the program/erase overhead.

Alternatively if the application has spare D-FLASH locations then multiple locations can be used for a parameter that requires frequent updates. So following each erase the parameter is first programmed to location n, then location n+2, then n+4 etc.. This limits the erase cycles. You would need to track the current location in software.