NandFlash online burning system based on PNX1501

Publisher:极地征服者Latest update time:2011-08-03 Keywords:PNX1501 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

As the electronic product market continues to expand, flash memory will undoubtedly achieve great growth. This growth depends largely on the non-volatility, low power consumption, high density and light weight of the memory. The combination of multiple advantages has made flash memory widely used in mobile electronics and embedded fields. Nand-Flash is cheap and sufficient, with a high cost performance, and is very light and shock-resistant. It is very suitable for digital products. The storage capacity of a single-chip nandFlash chip can now reach 4 GB. It is hard to imagine that such a capacity can be achieved in a chip that is only 12×20×1.2mm in size. However, due to the large number of Flash pins, small size, and inconvenient disassembly after use, the development of an online burning system has become an indispensable step in the field of embedded development.

1 NandFlash Introduction

NOR and NAND are the two main non-volatile flash memory technologies on the market today. Intel first developed NOR flash technology in 1988, which completely changed the situation where EPROM and EEPROM dominated the market. Then, in 1989, Toshiba released the NAND flash structure, which emphasizes reducing the cost per bit and providing higher performance, and can be easily upgraded through the interface like a disk. NandFlash is an ideal solution for high data storage density. It can achieve high storage density and has fast writing and erasing speeds. The difficulty in applying NAND lies in the management of flash and the need for special system interfaces. Nand-Flash devices use complex I/O ports to access data serially, and the methods of each product or manufacturer may be different. It uses 8 pins to transmit control, address and data information. NandFlash uses 512-byte blocks for read and write operations, which is a bit like such operations managed by hard disks. In this way, NandFlash-based memory can naturally replace hard disks or other block devices because it can also erase and reprogram blocks of memory cells called blocks. The write operation of any flash device can only be performed in empty or erased cells, so in most cases, it must be erased before the write operation (the maximum number of erases and writes per block in NandFlash flash memory is one million times). In short, the storage systems of digital devices such as USB flash drives, MP3 and MP4 that are common on the market are all implemented using NandFlash storage chips.

2 Online Burning System Architecture

The entire burning system introduced in this article consists of three parts. The PC provides the data to be burned through the PCI bus and is responsible for controlling the PNX1051 DSP, while the DSP is responsible for parsing the commands and data sent by the upper PC to control the communication timing of NandFlash and the realization of burning by controlling the GPIO pins. Figure 1 shows the system structure block diagram of the burning system.

System structure diagram of the burning system

PNX1501 is an audio and video processing chip launched by Philips. The working frequency of the chip is 300 MHz, and it has a rich communication interface, which can support DDR, SDRAM, Nand-Flash, NorFlash and IDE. In addition, it has more than 30 GPIO pins that can be used as ordinary IO to control peripheral chips. This system is only used to realize the burning of NandFlash bare chips, so it does not use its own NandFlash interface, but uses GPIO direct control, which is more flexible in timing and logic. The communication between DSP and computer is realized through PCI bus. In addition, DSP has 32MB DDR external expansion. The NandFlash uses GPIO0~GPIO7 as data port and GPIO8~GPIO12 as control signal pin. For the dedicated burning devices on the market, the bottleneck of its burning speed lies in data transmission. At present, the data transmission speed of most burners is very low and their own cache is very small. The burning process requires frequent data communication with the PC, so when burning a relatively large file system, it takes a long time and the operation is extremely complicated. More importantly, it cannot be burned online. Once the finished product needs to be updated, the Flash chip must be removed. For this system, the PCI transmission bandwidth can reach 133 MB/s, even a large file system can be quickly transmitted. In addition, since it is burned online, there is no need to disassemble the Flash, so it is very convenient for product updates. The HY27US08121M NandFlash selected in this system is a 64MB Flash produced by Samsung. The block erase time of this device is 2ms and the page write time is 0.5 ms, which can achieve high-speed reading and writing. [page]

3 System Software

At present, the storage space of Flash in the market is managed in blocks. Each block is 32 pages in size. Each page contains 512 bytes of valid data space and 16 bytes of spare space. The valid data is used to store actual data, and the spare area is used to store additional descriptive information of the valid data (ECC, bad block information, index number, etc.). Different file systems have different data structures, of which the two most important parts are ECC and bad block information. Bad block information is usually represented by the 6th byte of the spare area of ​​page 0 or page 1 of the block (0xFF is valid, and the rest are invalid). ECC is the check value obtained after a series of XOR checks on all valid data, usually 3 bytes (512 bytes check) or 6 bytes (256 bytes check). Due to the manufacturing process, Nand-Flash may produce bad blocks during the production process. For bad blocks, the storage information may be lost and cannot be used. Each Flash has the original bad block information written into the Spare area of ​​page 0 and page 1 of each block before leaving the factory. When erasing, you must first check whether it is a bad block, otherwise the bad block information will be erased (and can never be restored). In addition, in order to ensure the reliability of stored information, ECC verification can be introduced when reading data from NandFlash, and a new ECC is calculated for each 512-byte page of data read, and compared with the ECC stored in the Spare area of ​​the page. In this way, 1-bit flips can be corrected, or flips of more than 2 bits can be detected.

The burning file in this system adopts 6-byte ECC according to the Philips protocol. Since NandFlash manages data in blocks and pages, the data should be mapped according to the Nand-Flash structure on the PC side. The code is as follows:

After that, the burning file data can be filled into DataBuf. After filling every 512 bytes, ECC and other Spare interval contents are calculated. When 32 pages are filled, a new data structure can be opened and hung in the linked list.

The communication between PC and DSP is the key of this system. You can use the message method when designing, or you can open a shared area in the external DDR of the receiving DSP, and then the PC directly writes the data, and then sends a command to burn it. This system adopts the second method. For Philips' DSP, the DSP has mapped all its DDR space to the physical space of the PC in the driver, so you can directly add a simple interface function in the driver SDK to send the address of the shared area opened by the DSP to the PC through the message method, so that the PC can directly read and write the area. The specific code of this operation is as follows:

In this way, when the DSP receives the burning command sent by the PC, the system can read the contents of the shared buffer and start burning the Flash. The specific process is shown in Figure 2, and some function source codes are as follows:

The specific timing during design can refer to the timing circuit provided by the chip data to control the MMIO register to realize the control of GPIO, which will not be repeated here. It should be noted that NandFlash may fail and generate bad blocks during the burning or erasing process. For the treatment of bad blocks. Different systems have different methods, mainly direct Skip and Reserved Block Area (using reserved blocks), etc. This system uses the former method. In addition, for the sake of reliability, the ECC check should be performed on the block data that has been successfully burned if time permits, that is, all data is read to calculate the ECC and compare it with the ECC calculated before burning to determine whether a bit flip has occurred, so as to determine whether the burning is correct. If more than two bits of flip occur, it means that the block is burned incorrectly, and a new block should be selected for burning and the original block should be marked as a bad block.

4 Conclusion

Although DSP external Flash programming is not a key technology, it plays a vital role in the entire DSP embedded system development process. How to conveniently and quickly burn the boot file (BootLodaer) and the file system is an important link that directly affects the production and update of the product. This system can quickly and easily burn all the initial startup files. Actual tests have proved that it only takes less than 3 minutes to burn a 40 MB file system, which is superior to general programming devices in terms of speed and economy.

Keywords:PNX1501 Reference address:NandFlash online burning system based on PNX1501

Previous article:ATtiny25/45/85 microcontroller circuit board production
Next article:Application of synchronous queue serial interface QSPI

Recommended ReadingLatest update time:2024-11-16 20:40

NandFlash Application of S5PV210 (Part 3)
Prepare for analysis After reading "NandFlash Application of S5PV210 (II)", I have a certain understanding of the access method of the first 16k of binary files. This time, I want to prove the access method after the 4th page of NandFlash. 210.bin (16k in size) in "NandFlash Application of S5PV210 (II)" is stored in
[Microcontroller]
NandFlash Application of S5PV210 (Part 3)
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号