On Oct 19, 2009, at 8:28 PM, Prasad wrote:

For the NOR flash, when the write( , , 1) routine is called, the file
system(jffs2 in this case) has to read back the whole sector, modify
that byte, erase the sector and then write back the whole sector (in
order to write a single byte). Is it not so..So it does affect the
flash-lifetime right?

While you have to erase a whole block of NOR flash at a time, you don't have to write a whole block.
In fact, you can program a single bit. As long as you're writing a 0.

That is, when you erase a block, you set every bit to a 1. When you program a flash, you clear the bits you want cleared. So you can write at the same byte address multiple times, as long as none of those writes set a 0 to a 1. If you want to set even a single bit from a 0 to a 1, you have to erase the whole block.

Flash filesystems don't change the data in place to match some ideal - that would be silly. Instead, they invalidate the old data, and write a new copy. When they start running short of clean space, the file system consolidates the valid data, and garbage collects the invalidated data into clean space. This shuffling is why these file systems need some amount of headroom to reliably shuffle this data around. They have to plan for the operation to be interrupted at ANY time, and still maintain a recoverable state.

-
allon
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to