300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > nand ubi -1 nand基础

nand ubi -1 nand基础

时间:2020-05-28 18:47:53

相关推荐

nand ubi -1 nand基础

micro2440有一个配置是三星K9F2G08U0B--256MB SLC

tiny6410有一个配置是三星K9F2G086U0B--256MB SLC,有一个配置是三星K9K8G08U0B--1GB SLC,有一个配置是三星K9GAG08U0E--2GB MLC

1.

关于nand的ecc,refer to

/thread-5051907-1-1.html

Nand Flash本身是不具备ECC功能的,目前Micro有内置ECC功能的FLASH,不过市场上很难看到。

Nand Flash由于工艺原因,栅极存储的电荷会慢慢漏电,导致数据丢失;erase和program次数越多漏电的过程会加快。为了保证数据的可靠性,设计应用中都需要添加ECC功能模块来纠正Nand Flash内部的随机bit错误,以及电路上的随机错误。ECC功能由外部电路FPGA来完成,或者MCU的code来完成。

SLC的Datasheet上强调需要ECC纠正1bit错误。实际应用也确实如此,三星的SLC通常只发生1bit错误,很少有2bit以上的错误发生;intel的SLC 1bit,2bit错误都有很多。为了更可靠的数据,你可以采用纠正4bit或8bit的ECC算法,纠正bit数越多code越耗费时间和FPGA越耗费资源,ASIC也是。采用哪种ECC方式由设计者决定,通常你是不知道别人采用的ECC方式,除非他们告诉你。

2.

以K9F2G08xx--256MB SLC为例说明nandflash的内部结构:

可以看到,nandflash的构成方式是 页->块->device

每页2K+64B

每块64页

每个设备2048块

而每页的结构如下:

分为主区和空白区,主区用于存储真正的数据;空白区即传说的OOB(out of band带外数据),里面分了几个字节用于ECC(error correcting code 错误校验码)

main主区域,包含4个人扇区;空白区页包含4个扇区

OOB为spare区,除OOB第六字节外,通常至少把OOB的前3个字节存放Nand Flash硬件ECC码

1GB SLC的组成,与上面的page,block的结构一致,但是每块nand所含block增加。

2GB MLC的组成

nand flash是以页为单位读或写,是因为验证ecc时是整页验证的。以块为单位擦除,ubi里有个物理擦除块的概念,指的就是它。

--------没有子页时。

3

SLC和MLC的结构区别,一图以蔽之

4.

6410的nand接口及硬件ecc过程

tiny6410电路图接K9F2G08xx

6410的nand控制器

8.8 1-BIT / 4-BIT / 8-BIT ECC (ERROR CORRECTION CODE)

NAND flash controller has four ECC (Error Correction Code) modules for 1 bit ECC , one for 4bit ECC and one for

8bit ECC.

The 1bit ECC modules for main data area can be used for (up to) 2048 bytes ECC parity code generation, and 1

bit ECC module for spare area can be used for (up to) 4 bytes ECC Parity code generation.

Both 4bit and 8bit ECC modules can be used for only 512 bytes ECC parity code generation.

4 bit and 8bit ECC modules generate the parity codes for each 512 byte. However, 1 bit ECC modules generate

parity code per byte lane separately.

4bit ECC modules generate max 7byte parity codes and 8 bit ECC modules generate 13byteparity codes at each

512/24 bytes.

nand控制器有4个1bit-ecc模块,1个4bit-ecc模块,1个8bit-ecc模块

(Recommend: 1bit ECC for SLC, 4bit and 8bit ECC for MLC NAND Flash)--是因为MLC比SLC出错几率高

1bit-ecc 每2048B可校正1位错误数据,产生多少个字节校验码?

4bit-ecc 每512B可校正4位错误数据,最大产生7个字节校验码。一般的OOB可以提供如此多字节空间用于存储校验码。

8bit-ecc 每512B可校正8位错误数据,最大产生13个字节校验码

1bit ecc 编码和解码

8.8.2 1-BIT ECC PROGRAMMING ENCODING AND DECODING

1. To use 1-bit ECC in software mode, reset the ECCType to ‘0’ (enable 1-bit ECC)‘. ECC module generates

ECC parity code for all read / write data when MainECCLock (NFCONT[7]) and SpareECCLock (NFCONT[6])

are unlocked(‘0’). You must reset ECC value by writing the InitMECC (NFCONT[5]) and InitSECC

(NFCONT[4]) bit as ‘1’ and have to clear the MainECCLock (NFCONT[7]) bit to ‘0’(Unlock) before read or

write data.

MainECCLock (NFCONT[7]) and SpareECCLock(NFCONT[6]) bit controls whether ECC Parity code is

generated or not.

2. Whenever data is read or written, the ECC module generates ECC parity code on register NFMECC0/1.

3. After you complete read or write one page (does not include spare area data), Set the MainECCLock bit to ‘1’

(Lock). ECC Parity code is locked and the value of the ECC status register will not be changed.

4. To generate spare area ECC parity code, Clear SpareECCLock (NFCONT[6]) bit to ‘0’ (unlock).

5. Whenever data is read or written, the spare area ECC module generates ECC parity code on register

NFSECC.

6. After you complete read or write spare area, set the SpareECCLock bit to '1' (Lock). ECC Parity code is

locked and the value of the ECC status register will not be changed.

7. From now on, you can use these values to record to the spare area or check the bit error.

8. For example, to check the bit error of main data area on page read operation, after generating of ECC codes

for main data area, you have to move the ECC parity codes (is stored to spare area) to NFMECCD0 and

NFMECCD1. From this time, the NFECCERR0 have the valid error status values.

简解:

手动清零MainECCLock位,开启main区域的ecc硬件自动校验。

在cpu从nand main区上读取数据或者写入数据到nand main区时,ecc模块自动产生ecc校验码,放在寄存器NFMECC0/1里面.

当写完一页之后--- (一页的由自己定义,要按照nand说明书查看一页的大小,每页都有一个OOB用于存放该页的校验码),需要手动置MainECCLock 1,以便停止硬件ecc。此时寄存器NFMECC0/1的值将不会改变。

手动清零SpareECCLock 位,启动ecc spare区域的硬件自动校验。

在cpu从nand spare上读取数据或者写入数据到nand spare区时,ecc模块自动产生ecc校验码,放在寄存器NFSECC里面.

当写完nandspare区域之后,需要手动置SpareECCLock1,以便停止ecc spare区域的硬件自动校验。此时寄存器NFSECC的值将不会改变。

在写操作时,每写完一个页,就将NFMECC0/1的值写入nand的相应页的oob的某部分作为校验码。

在读操作时,每读完一页,就接着读取相应页的oob中的校验码,写入NFMECCD0/1寄存器,此时cpu会自动比较NFMECCD0/1和NFMECC0/1的值,结果存入NFECCERR0 寄存器。

5

ecc校验原理

/nhczp/article/details/1700031

/blog/upfile2/080702112233.pdf

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。