Forum Discussion
Altera_Forum
Honored Contributor
13 years agoDifference between alt_write_flash and alt_erase_flash_block/alt_write_flash_block
Hi, I have read the chapter on writing to Flash in chapter 6-19 of the Nios II Software Developer's Handbook. I understand the problem of overwriting data due to erasing and writing a whole bl...
Altera_Forum
Honored Contributor
13 years agoWith NOR flash (which the above sounds like) it is also possible to rewrite an area provided that you are only trying to clear bits.
So you can have a 'partial write' function that will do a read/erase/modify/write if any bits need to be set, and just a write if bits only need to be cleared. With a caches for a single full sized flash sector and a few 512 ones I got acceptable performance for a FAT16 filesystem. Although you really need a flash-friendly filesystem that treats both 0xff and 0x00 as 'unused' markers, and preferentially uses the 0xff entries.