Flash read-Write and erase

Source: Internet
Author: User

For the understanding of flash, relatively superficial, in the Internet to find some information, thank http://blog.csdn.net/lin364812726/article/details/18815395 Bloggers,

The blog post is reproduced for later viewing.

Flash Flash memory is non-volatile memory, can be called Block of memory unit block for Erasure and re-programming.

Flash follows the internal storage structure in two categories: NOR Flash and NAND flash.
(1) Nor flash: like access to the SDRAM, according to data/address bus direct access, can write less times, slow, because its reading timing is similar to SRAM, read address is a linear structure, more for program code storage.
(2) NAND Flash: only 8-bit/16-bit/32-bit or more bit-wide bus, each access, the long address will be divided into a few parts, a little bit of step in to access NAND flash. Nand Flash compared to the rest of the other flash advantage lies in the number of erasable, write faster, but in the use and use of the process will have a bad block so need to do special processing to use. It is mainly used for data storage, and most USB drives are NAND Flash.

There is a big difference between the life of NAND and NOR, the speed of block erase, the chance of error in data storage, and so on.

The write operation of any flash device can only be done within an empty or erased unit, so in most cases the erase must be performed before the write operation. The erasure of NAND devices is straightforward, and nor does it require that all bits in the target block be written to 1 before erasing.

Since the erase nor device is carried out in a 64~128kb block, the time to perform a write/erase operation is 5s, in contrast, the erasure of the NAND device is carried out in a 8~32kb block, and the same operation is performed for up to 4ms. The difference in block size when performing the erase further widens the performance gap between nor and NAND.

NOR Flash has an SRAM interface with enough address pins to be addressable, which makes it easy to access every byte inside of it.

NAND devices use complex I/O ports to sequentially access data, and the methods of each product or vendor may vary. 8 pins are used to transmit control, address, and data information. NAND read and write operations using 512 words

section of the block, which is somewhat like a hard drive to manage such operations, it is natural that NAND-based storage can replace hard disks or other block devices. NAND Flash data is stored in the memory cell as a bit,

In general, only one bit can be stored in a cell. These cells are bitline in 8 or 16 units, forming the so-called byte (x8)/word (x16), which is the bit width of the NAND device. These line

will be formed page, (NAND Flash has a variety of structures to Samsung's k9f1208u0m), each page 528Bytes (512byte (Mainarea) +16byte (Spare area) as an example, each 32 page form a

Block (32*528b). The specific piece of flash on how many blocks as required, the instance of NAND FLASH has 4,096 blocks, the total capacity of 4096* (32*528b) =66MB, but the

2MB is used to save additional data such as ECC check code, so the actual can be used for 64MB.

NAND Flash reads and writes data in pages, and erases data in blocks. In this way, three types of addresses can be formed:

Column Address: Columns addresses

Page Address: Pages addresses

Block Address: Blocks addresses

For NAND flash, the address and command can only be passed on i/o[7:0], and the data width is 8 bits. All flash devices are subject to the phenomenon of bit switching. In some cases, a bit is reversed or

The report was reversed. One change may not be obvious, but if it happens on a critical file, this small glitch can lead to system downtime. If you just report a problem, read it a few times and it can be solved. Of course

If this bit really changes, then the error detection/error correction (EDC/ECC) algorithm must be used. Bit reversal problem is more common in NAND flash, NAND vendors recommend using NAND flash while using

EDC/ECC algorithm. This problem is not fatal when storing multimedia information in NAND. Of course, if you use a local storage device to store the operating system, configuration files, or other sensitive information, you must use the

EDC/ECC system to ensure reliability. The bad blocks in the NAND device are randomly distributed. The NAND device requires an initial scan of the media to discover the bad block and mark the bad block as unavailable. In a device that has been made,

Failure to do so through a reliable method will result in high fault rates.

You can use nor-based flash memory very directly, you can connect like other storage, and you can run code directly on it. For NAND devices, the NAND device uses a complex

Many. Access methods for various NAND devices vary by manufacturer. When using a NAND device, you must write to the driver before you can continue with other operations. Writing information to NAND devices requires considerable skill, as it is not

Can write to the bad block, which means that the virtual mapping must be done throughout the NAND device.

No software support is required to run code on nor devices, and in the same operation on NAND devices, drivers are often required, i.e. memory technology drivers (MTD), NAND and NOR devices

MTD is required for line write and erase operations.

The drive is also used to simulate and manage NAND flash for diskonchip products, including error correction, bad block handling, and loss balancing. The main suppliers of NAND Flash are Samsung and Toshiba, on USB drives,

Memory cards, MP3 players are all of this flash, because of the different process, it has more storage capacity than Norflash, and cheap. But there are shortcomings, that is, can not be addressed directly to run the program, can only

Store data. In addition, NAND FLASH is very prone to bad areas, so it needs to have a checksum algorithm.

Flash read-Write and erase

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.