• With realizes - en.51rd.net based on the FLASH medium embedded storage scheme’s design

    The abstract takes one kind of new storage medium, FLASH by its fine characteristic, obtained the widespread application in the embedded domain. This article through analyzes the FLASH medium own characteristic, and unifies embedded system’s characteristic, the design realizes in aspects and so on compatibility, reliability as well as expenses obtains the full optimized FLASH memory system.

    Key words embedded system filing system FLASH
    1 introduction
        FLASH (dodges fast memory) to take one kind of security, the fast storage medium, has the volume to be small, the capacity is big, the cost is low, the power failure data does not lose and so on a series of merits, has become in the embedded system the data and the procedure most main carrier. Because FLASH in the structure and the operating mode with the hard disk, E2ROM and so on other storage medium has distinguishes greatly, uses when FLASH must act according to its own characteristic, carries on the special design to the memory system, guarantee system’s performance achieves superiorly.
    2 FLASH characteristics
        FLASH is one kind of nonvolatile storage NVM (Non-Volatile Memory), different may divide into according to the structure it NOR FLASH and NAND the FLASH two kinds. But no matter which one kind has the following characteristic:
    1.  Sub-area structure
        FLASH divides into certain sub-areas in the physical structure, between the sub-area mutually independent. For instance NOR FLASH divides into entire Memory certain Sector, but NAND FLASH divides into entire Memory certain Block;
    2.  Scratches after first, writes
         Because FLASH wrote the operation only to be able from 1 to write the data position 0, could not from 0 write 1, therefore in carried on before the memory read in must carry out first scratches the operation, will read in advance the data position initialization was 1. Scratches the operation the smallest unit is a sub-area, but is not the single byte.
    3.  Operational order
        Except NOR FLASH reading, FLASH other operations cannot look like RAM such, carries on the main line operation directly to the goal address. For instance carries out one time to write the operation, it must input a string special instruction (NOR FLASH), or completes section of successions (NAND FLASH) to be able to read in the data in FLASH.
    4.  Position reverse
         As a result of the FLASH inherent electric appliance characteristic, in the read-write data process, will accidentally produce or several bit data is wrong. This is the position reverse. The position reverses avoidless, can only carry on through other methods to the result processes afterward.
    5.  Bad block
        FLASH in the use process, possibly causes certain sub-areas the damage. Once the sub-area damages, will be unable to carry on the repair. If to has damaged the sub-area carries on the operation, possibly will bring the uncertain mistake. Especially NAND FLASH when leaving the plant had such bad block on the possibility (already to mark).
    3 key designs
    3.1 FLASH stable designs
        Regarding an embedded system, equipment’s compatibility is better, the system feasibility is better, the product also more has the competitive power. Therefore, for the compatible different type’s FLASH equipment, carries on the stable design to FLASH to be very important.
    Regarding NOR FLASH, the data reads the operation to be possible completes fast through the independent data bus and the address bus, however NOR FLASH other operations need to complete through the special instruction, what is worse is different manufacturer production chip these instructions is not mutually same. This caused the equipment not to be incompatible.
        Regarding NAND FLASH, also has such problem. NAND FLASH may act according to the same instruction read chip the manufacturer number and the equipment number, thus realizes the operation through the identification equipment number transfer correspondence’s succession flow. But, in the system too many judgments, will cause the procedure the structure will become very complex. Therefore, under certain condition, NAND the FLASH equipment is incompatible.
        In order to solve this problem, a good method is deposits the FLASH each operational order as well as the structural property according to the unified form to FLASH in the stationary position. When system initialization, this structure read-in system, through analyzes this structure, may obtain about the chip all related information, including operational order, sub-area distribution and so on. Thus, the system may with ease realize to different model FLASH all operations, enhanced equipment’s extension enormously.
    3.2 double model type filing system design
        In the embedded system file data’s depositing has two kind of structures generally, one kind is the index form linear structure, one kind is the misalignment chain table type structure. These two kind of structures have the good and bad points respectively. For instance regarding the system disposition, the lattice fonts and so on some have the fixed structure system data, the index structure compares the chain table type structure to be more effective. But regarding the user data which renews frequently, the chain table type structure must the index structure be more nimble. If the system can two kind of structure integrations, be able to display superiorly inevitably the performance.
        Realizes this integrated method is defines the equipment certain districts, each district is mutually independent, the different district may use the different mode of file. Thus, the different type’s data may act according to own attribute choice depositing the district. For instance the system data deposits in the use index linear structure district, the user data deposits in the use chain type misalignment structure district.
    3.3 bad processing
         In the FLASH bad block processing is a very thorny question, if does not have the effective management, will have the serious influence to system’s stability. A feasible solution produces a bad block table, in the bad block table records all bad blocks the block number, and sorts from infancy to maturity according to the block number, bad block table in read-write process dynamic updating. When read-write data, traversal in the bad block table the block number, transforms the document logical address corresponds the FLASH physical address, guaranteed uses the FLASH address space does not have the bad block.
    4 systems realize
    4.1 structure definitions
    Figure 1 - memory structure

         System’s memory structure as shown in Figure 1, records SR in the FLASH Block0 position depositing overall system most important data - pneumatic system (System Record). When chooses Block0 the reason is the general FLASH leaving the plant, can guarantee that Block0 is complete, therefore may avoid inconvenient which the bad block question brings. SR is actually one defines the good construction of data, it including medium information and filing system information two parts. Medium information including FLASH memory’s type, capacity, block type size and quantity (BlockInfo), FLASH operational order (CommandInfo) and so on. Filing system information including edition information, various logical district start address (physical address) and end address. The FLASH equipment may divide into or many logical districts, each logical district uses the operating mode may not be mutually same, what like Figure 1 Device0 district uses is the linear filing system, what the Device1 district uses is the chained file system. What if uses is the linear filing system, joins document indexed list INDEX information and so on start address, size behind the district information; What if uses is the chained file system, then joins information and so on position which the filing system page size, file allocation table FAT and document registration form FRT is.

        Document registration form FRT after in the FAT page, is depositing in the logical district the document information, like document total, each document short title, position, length as well as verification pattern. And, the verification pattern uses for marks when the document read-write to use the mistake verification the rank. The different type’s document uses the different rank the verification way. 0 levels do not carry on the verification, 1 level of ECC verification, 2 level of one by one byte comparisons.
        Regarding the linear filing system district, all document order saves, when reads the data, directly through the INDEX index obtains some document logic start address, then starts the smooth search from this address, gains under some displacement position n continual Byte. The chained file system is divides into the address space certain divisions, namely Sector, it is the operation smallest unit; A big document may distribute in not continual many Sector, then connects through the FAT table them; Realizes the chained file system on the FLASH medium, the Sector size choice is a key, because FLASH writes the operation, scratches the operation is take Page, Block as the unit, supposed slightly has caused the bulk structure FLASH to write the operation to be complex, supposes many have wasted the space, therefore the best choice was the Sector size supposes to scratch the operation smallest unit 16K.
        In the entire logical district, in the INDEX, FAT, FRT table’s content is important, because once exceptionally makes the mistake, possibly will affect all documents; Therefore, these three documents have made backup processing, backup depositing in different Block. At the same time, when processes to them, rewrites in the table the renewal condition. 0xff indicates starts to renew, 0×00 expressed that the renewal ended. When filing system initialization, reads their renewal condition, if in the table renewal condition is 0xff, explains this table existence abnormal operation, available backup table correction.
    4.2 level connections
          The entire memory system divides into three, as shown in Figure 2.
    Figure 2 - hierarchical structure


    1.     Operating system level
        In the entire memory system, what operating system acting is user’s role. When needs the data, it connection function gain data which provides through the transfer filing system level, it does not care about the data the origin and the accuracy.
    2.     Filing system level
         The filing system level’s duty is realizes it and the operating system level function connection. In realizes in the way, the linear filing system and the chained file system have distinguish greatly. For instance the document reads mfread, the linear filing system direct read wants byte, but the chained file system is each time first reads the corresponding entire page the document buffer, then needs the data copy to read again assigns the memory. File delete mfdelete, the linear filing system needs to reorganize, otherwise because of the massive data empty (, because space will be too small, will be unable to put in new document scrap region) to enable the system not to have the usable space very quickly. The chained file system only need amendment file system’s FAT and FRT, but does not need to make other any processing, when the next time write operation uses this, completes the cleaning automatically.
    3.     Actuation level
         The actuation level’s duty is completes with FLASH between the communication protocol, realizes it and the filing system level function connection. The connection function reads mPageRead including the page, the page writes mPageWrite, the block cleans mBlockErase, reads mRnRead stochastically, reads in mRnWrite stochastically. mPageRead, mPageWrite, mBlockErase carries on the operation to the full page or the block, transfers in the chained file system; mRnRead, mRnWrite carries on the operation to the byte unit, transfers in the linear filing system. And mRnWrite is quite troublesome, take writes Byte as the example, its operation divides three steps, first reads goal block’s in all data in memory Buffer, is going to read in data updating Buffer, the cleaning goal block, will renew finally Buffer writes returns to the goal block, here Buffer size is Block. Are quite tight as a result of embedded system’s memory resources, the system used the block exchange technology to reduce the cost, the method is searches an idle block in FLASH, acted as Buffer with it the role.
    5 conclusions
        Through the above design, the memory system which realizes has the following characteristic:
    1.  Uses the general pattern design, strengthened the system to the FLASH equipment’s compatibility;
    2.  The use double model type file organization design, enables the different type the data processing efficiency simultaneously to achieve superiorly;
    3.  The use address reflects the firing table, has shielded the hidden danger which the bad block brings, strengthened system’s toughness;
    4.  Uses the backup protection to the important data, guarantees cannot, because the power failure and so on exceptionally causes system’s collapse, strengthened the system stability;
    5.  Uses the block exchange technology, saves the system cost;
    6.  Carries on the graduation mistake verification, enhanced the system to carry out the efficiency;
    Therefore, this article designs FLASH memory system, very suitably in embedded system’s application.
    Reference
    [1]     Mike Ficco. “How To establish Multimedia Filing systems in Embedded Electronic installation”. Electronic engineering special edition, 2004.02
    [2]     Dong is bright, Liu Canada, Liu Runsheng. “Is suitable in Embedded Multimedia Application Flash Filing system” .21IC,2003.3
    [3]     Jia Dong Yao. “Under uClinux Nor Flash JFFS2 Filing system Construction” .21IC,2004.12
    [4]     Wu Yujun. “In Embedded system’s Linear Flash Filing system Design” .21IC,2004.12

    Share/Save/Bookmark

No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

TOP
Copyright © 2008 51 Research and Design, Electronic Engineers website - Embedded Systems, MCU, DSP, EDA, Test and Measurement, Components, Communications, Power, Microelectronics, Semiconductors
Powered by WordPress | Theme by mg12 | Valid XHTML 1.1 and CSS 3