关于norflash

http://en.wikipedia.org/wiki/Flash_memory#NOR_flash

 

下面这段很重要:摘自维基百科

NOR memories

Reading from NOR flash is similar to reading from random-access memory, provided the address and data bus are mapped correctly. Because of this, most microprocessors can use NOR flash memory asexecute in place (XIP) memory, meaning that programs stored in NOR flash can be executed directly from the NOR flash without needing to be copied into RAM first. NOR flash may be programmed in a random-access manner similar to reading. Programming changes bits from a logical one to a zero. Bits that are already zero are left unchanged. Erasure must happen a block at a time, and resets all the bits in the erased block back to one. Typical block sizes are 64, 128, or 256 KB.

Bad block management is a relatively new feature in NOR chips. In older NOR devices not supporting bad block management, the software ordevice driver controlling the memory chip must correct for blocks that wear out, or the device will cease to work reliably.

The specific commands used to lock, unlock, program, or erase NOR memories differ for each manufacturer. To avoid needing unique driver software for every device made, specialCommon Flash Memory Interface (CFI) commands allow the device to identify itself and its critical operating parameters.  (所以这样看CFI一般主要是针对norflash的,而不是针对nandflash

Besides its use as random-access ROM, NOR flash can also be used as a storage device, by taking advantage of random-access programming. Some devices offer read-while-write functionality so that code continues to execute even while a program or erase operation is occurring in the background. For sequential data writes, NOR flash chips typically have slow write speeds, compared with NAND flash.

Typical NOR flash does not need an error correcting code.[31]

 

================

再摘一点:

单来说,flash按照内部访问接口不同,分为两种:nor flash和nand flash。

nor flash:像访问SDRAM一样,按照数据/地址总线直接访问;

nand flash:只有8位/16位/32位甚至更多位宽的总线,每次访问,都要将长地址分为几部分,一点点的分布传入才能访问nand flash。

Nand和Nor的使用寿命,块擦除的速度,数据存储的出错几率等,都有很大区别。

 

其中的Nor Flash,根据外部接口分,又有普通的接口和SPI接口。
而普通接口的Nor Flash,多数支持CFI接口,所以,一般也叫做CFI接口。
CFI接口,相对于串口的SPI来说,也被称为parallel接口,并行接口;
另外,CFI接口是JEDEC定义的,所以,有的又成CFI接口为JEDEC接口。
所以,可以简单理解为:对于Nor Flash来说,CFI接口=JEDEC接口=Parallel接口

 

最近在用的AT45DB161D就属于nor flash中的spi flash。

对于Nor Flash来说,CFI接口 = JEDEC接口 = Parallel接口。

 

普通的parallel/CFI/JEDEC接口的的Nor Flash的针脚比较多,芯片比较大。之所有会有SPI接口的,主要是相对CFI/Parallel的Nor,可以减少针脚数目,减少芯片封装大小,采用了SPI后的Nor Flash,针脚只有8个。


另外,文件系统的移植不是仅仅实现底层存储介质的读写函数即可,还需要考虑坏块管理,内存管理以及平均读写次数等等。下面接着研究fatfs文件系统中以上三个问题。

 

你可能感兴趣的:(存储及文件系统)