从规格书上看,SPI flash一般支持3种擦写方式:按sector擦写,按block擦写,整片chip擦写。
以KH25L3255E为例,
• Serial Peripheral Interface compatible -- Mode 0 and Mode 3
• 33,554,432 x 1 bit structure or 16,777,216 x 2 bits (two I/O mode) structure or 8,388,608 x 4 bits (four I/O
mode) structure
• 1024 Equal Sectors with 4K bytes each
- Any Sector can be erased individually
• 128 Equal Blocks with 32K bytes each
- Any Block can be erased individually
• 64 Equal Blocks with 64K bytes each
- Any Block can be erased individually
• Power Supply Operation
- 2.7 to 3.6 volt for read, erase, and program operations
• Latch-up protected to 100mA from -1V to Vcc +1V
由此可以看出,KH25L3255E的sector大小是4K,block大小是32K/64K.因此,可以一次性擦除4K/32K/64K.
三种擦写方式的性能比较:
- Fast erase time: 30ms (typ.)/sector (4K-byte per sector) ; 0.25s(typ.) /block (64K-byte per block); 10s(typ.) /
chip