Erasing and writing to the MC9S12XS128 D-Flash

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Erasing and writing to the MC9S12XS128 D-Flash

1,494件の閲覧回数
aceshigh
Contributor I

Quick question:

I'm setting up my data flash write routines for the MC9S12XS128 MCU.  From my understanding, any location in the data flash that is to be written to must first be in the erase state (0xFF) or an error occurs.

 

It appears that the absolute minimum amount of data flash that can be erased is a single sector (256 bytes) using the Erase D-Flash Sector command (0x12), while the maximum number of words that can be written to is 4 using the Program D-Flash command (0x11).

 

This seems inefficient, given that if I need to simply write to a single word-length parameter in my data flash, I need to first erase 256 bytes of flash at a minimum while making sure all the data I've just erased is saved, and then RE-WRITE all the data I just erased just to update one word.

 

Is my understanding of how the data flash works correct, or is there a more efficient way to erase/write (erase a single word perhaps?).

 

Thanks in advance.

ラベル(1)
0 件の賞賛
返信
1 返信

482件の閲覧回数
Lundin
Senior Contributor IV
Yes you understand it correctly - it is very inefficient. This is a major weakness with most new Freescale MCUs. They used to come with EEPROM (or emulated EEPROM) that only needed a few cells erased, but for reasons unknown Freescale stopped using it. The new "data flash" in the latest S12X seems to solve nothing of this, it is roughly the same crap still.

The solution is to use the old S12D family (without X), the new S08D family or to look at the competition.

0 件の賞賛
返信