AddThis Social Bookmark Button

05 Memory Technology Device (MTD) Management

Overview

Most of the embedded systems are using memory devices rather than HDDs. These memory devices include RAM, ROM, CFI NOR flash, NAND flash, Compact flash, PCMCIA card and many other flash cards. Accordingly, there are many different file systems and technologies available for different memory devices. The developers have to study the combination and feature sets for the whole projects. Sometimes more than one file system must be used in a single system. And the operation of file and partitions are quite different from standard PC. MTD (Memory Technology Device) is available for embedded Linux storage purpose.

Devices supported by MTD

MTD subsystem is developing independently. The developers have to download the latest source from this site to integrate with the kernel.

 

 

 

 

Basic of MTD
The MTD has own device files in mtdN (character device), mtdrN (character device, read only), mtdblockN (block device, read only, JFFS/JFFS2), nftlLN (NFTL), ftlN (FTL).

Configure MTD in the Kernel
The MTD is configured in kernel, please check documentation for detail information. There are many options are dedicated for MTD.

MTD utility software
In order to operate on MTD, its dedicated utility software must be used. The developer should read the user manual very carefully; otherwise an accident will damage your memory devices permanently. These utility software packages include generic commands, file system commands, NFTL commands, FTL commands and NAND commands.

Common Flash Interface (CFI) Flash device
The NOR flash memory usually follows CFI standard. The developer should configure the kernel support for CFI, setup partitions and setup device file for it. Please do not confuse CFI and CF (Compact Flash).

DiskOnChip (DOC)

DOC is widely deployed in x86-based embedded systems. DOC is made up of NAND flash memory and flash controller. DOC device requires more attention because it has built-in BBT (Bad Block Table) to indicate the bad blocks. It is recommended to download the utility software from M-System web site to format DOC device. Then configure the kernel and set device file for it. Or it can be also formatted by NFTL.

 

 

Compact Flash
Compact Flash card can be accessed via IDE (CF/IDE adapter), PCMCIA (CF/PCMCIA adapter) or USB adapter. Since USB driver is considered as a SCSI driver, these different access methods lead to different device file and kernel configuration. Although CF card is emulating IDE/HDD, not any CF card can support swap features. The developer should be very careful not to tear out the CF card by frequently writing.

Other Flash Cards

Most of the specifications of the flash cards are protected by NDAs, includes memory stick, secure digit card, multimedia card and more. There are some open discussions for open source implementation for these flash cards. But so far there is no standard package in kernel to support them.

 

 

 

Swap
Swap technology allows computer to emulate more memory on disk devices, but swap feature is not suitable for most of the embedded systems. This feature will lead to frequently access to flash devices and reduce the lifetime for the devices.