Moscow State University

The Department of Computational Mathematics and Cybernetics

Secure Digital Cards(SD)

Timofeev Kirill
Groupe 205

Moscow 2010
Introduction

Secure Digital (SD) is a non-volatile memory card format developed by Panasonic, SanDisk, and Toshiba for use in portable devices. It is widely used in digital cameras, digital camcorders, handheld computers, netbook computers, PDAs, media players, mobile phones, GPS receivers, and video game consoles. Standard SD cards have an official maximum capacity of 2 GB, though technically they can store up to 4 GB. SDHC (High-capacity) cards have a maximum capacity of 32 GB. SDXC (eXtended Capacity), a specification announced at the 2009 Consumer Electronics Show, allows for up to 2 TB cards.

The format has proven very popular. Changes to the interface of the established format have made some older devices designed for standard SD cards (≤4 GB) unable to handle newer formats such as SDHC (≥4 GB). All SD cards have the same physical shape, which causes confusion for many consumers.

Secure Digital

History

In August 1999, SanDisk, Matsushita and Toshiba first agreed to develop and market the SD (Secure Digital) Memory Card, which was a development of the MMC. With a physical profile of 24 × 32 × 2.1 mm, the new card provided both DRM up to the SDMI standard, and a high memory density for the time.

At the 2000 CES trade show Matsushita, SanDisk, and Toshiba Corporation announced the creation of the SD Card Association to promote SD cards. It is headquartered in California and its executive membership includes some 30 world-leading high-tech companies and major content companies. Early samples of the SD Card were available in the first quarter of 2000, with production quantities of 32 and 64 megabytes available 3 months later.

In April 2006, the SDA released a detailed specification for the non-security related parts of the SD Memory Card standard. The organization also released specifications for the SDIO (Secure Digital Input Output) cards and the standard SD host controller. During the same year, specifications were finalized for the small-form-factor microSD (formerly known as TransFlash) and SDHC, with capacities in excess of 2 GB and a minimum sustained read/write speed of 17.6 Mbit/s.

Design and implementation

SD cards are based on the older MultiMediaCard (MMC) format, but have a number of differences:

    * The SD card is asymmetrically shaped in order not to be inserted 	upside down, while an MMC would go in most of the way but not make contact 	if inverted.
    * Most SD cards are physically thicker than MMCs. SD cards generally 	measure 32 × 24 × 2.1 mm, but as with MMCs can be as thin as 1.4 mm if they 	lack a write-protect switch; such cards, called Thin SD, are described in 	the SD specification, but they are non-existent or rare in the market as 	most devices requiring a thinner card use the smaller (and thinner) versions 	of SD: miniSD or microSD.
    * The card's electrical contacts are recessed beneath the surface of 	the card, protecting them from contact with a user's fingers.
    * SD cards typically have transfer rates in the range of 80–160 Mbit/s, 	but this number is subject to change, due to recent improvements to the MMC 	standard.

Devices with SD slots can use the thinner MMCs, but standard SD cards will not fit into the thinner MMC slots. miniSD cards can be used directly in SD slots with a simple passive adapter, since the cards differ in size and shape but not electrical interface. With an active electronic adapter, SD cards can be used in CompactFlash or PC card slots. Some SD cards include a USB connector for compatibility with desktop and laptop computers, and card readers allow SD cards to be accessed via connectivity ports such as USB, FireWire, and the parallel printer port. SD cards can also be accessed via a floppy disk drive with a FlashPath adapter.

	Optional write-protect tab

On the left side may be a write-protection notch. If this is present, the card cannot be written. If the notch is covered by a sliding write protection tab, or absent, then the card is writeable. Because the notch is detected only by the reader, the protection can be overridden if desired (and if supported by the reader). Not all devices support write protection, which is an optional feature of the SD standard.

Some SD cards have no write-protection notch, and it is absent completely in the MicroSD and MiniSD formats.

	File system

Like other flash card technologies, most SD cards ship preformatted with the FAT or FAT 32 file system on top of an MBR  partition scheme. The ubiquity of this file system allows the card to be accessed on virtually any host device with an SD reader. Also, standard FAT maintenance utilities (e.g., SCANDISK) can be used to repair or retrieve corrupted data. The card can be reformatted to any file system supported by the operating system. Conversely, an SD card can contain an embedded operating system (such as a Live USB) to recover a corrupted host computer by natively booting from the flash media reader.

SD cards with 4 GB and smaller capacities can be used with many systems by being formatted with FAT16 or FAT32 file system (common for file systems 4 GB and larger). Cards 4 GB and larger can only be formatted with a file system that can handle these larger storage sizes, such as FAT32.

Fragmentation may slow down the effective write speed: Defragmentation tools may be used. However, it is unnecessary to use any disk optimization tool because on an SD card the time required to access any block is the same. Defragmenting an SD card will wear the card out slightly, as the number of writes, before failure occurs, is limited (usually 100,000 times).

		Compared to other flash memory formats

Overall, SD is less open than CompactFlash or USB flash memory drives; these are open standards which can be implemented free of payment for licensing, royalties, or documentation. (CompactFlash and USB flash drives may, however, require licensing fees for the use of associated logos and trademarks.)

However, SD is much more open than Memory Stick, for which no public documentation nor any documented legacy implementation is available. All SD cards (other than microSD) can, at least, be accessed freely using the well-documented SPI/MMC mode.

Speeds

There are different speeds of SD card available. The official unit of measurement is the Speed Class Rating; an older unit of measurement is the × rating.

	Speed Class Rating

The Speed Class Rating is the official unit of speed measurement for SD Cards, defined by the SD Association. It is equal to 1 MB/s (8 Mbit/s), and it measures the minimum sustained write speeds for a fragmented state

The following are the ratings of some currently available cards:

    * Class  2:  2 MB/s - 13x
    * Class  4:  4 MB/s - 26x
    * Class  6:  6 MB/s - 40x
    * Class 10: 10 MB/s - 66x

Important differences between the Speed Class and the traditional CD-ROM drive speed measurement ("x" speed ratings) are that speed class:

   1. may be queried by the host device
   2. defines the minimum transfer speed.

Since the class rating is readable by devices, they can issue a warning to the user if the inserted card's reported rating falls below the application's minimum requirement.

On 21 May 2009, Panasonic announced new class 10 SDHC cards, claiming that this new class is "part of SD Card Specification Ver.3.0". Toshiba also announced cards based on the new 3.0 spec

On 01 Jun 2010, Pretec announced the new Class 16 HD video grade SDXC 64GB card at Computex Taipei 2010.

	X-rating

The x rating is a unit of measurement equal to 1.2 Mbit/s. It is derived from the standard CD-ROM drive speed of 1.2 Mbit/s. Basic cards transfer data up to six times (6x) the data rate of the standard CD-ROM speed (7.2 Mbit/s vs 1.2 Mbit/s). The 2.0 specification defines speeds up to 200x, but unlike the class rating system, does not mandate that x-ratings measure the card's minimum sustained write-speed. So, typically, manufacturers provide x-ratings based on maximum read/write speeds. Furthermore, for most cards, the maximum read speed is typically faster than its maximum write speed, leading some manufacturers to use read-speed as the x-rating measurement. Other vendors, such as Kingston, use write-speed.

This table lists common ratings and minimum transfer rates.
Rating 	   Write Speed		SDHC class
		(Mbit/s)	(MB/s)
   6x 	   7.2 	   0.9		-
  10x 	  12.0 	   1.5		-
  13x 	  16.0 	   2.0		2
  26x 	  32.0 	   4.0		4
  32x 	  38.4 	   4.8		5
  40x 	  48.0 	   6.0		6
  66x 	  80.0 	  10.0		10
 100x 	 120.0 	  15.0		15
 133x 	 160.0 	  20.0		20
 150x 	 180.0 	  22.0		22
 200x 	 240.0 	  30.0		30
 266x 	 320.0 	  40.0		40
 300x 	 360.0 	  45.0		45

Types of MMC/SD cards

The SD card is not the only flash memory card standard ratified by the Secure Digital Card Association (SDCA). Other SD Card Association formats include miniSD, microSD (formerly known as TransFlash before ratification by the SD Card Association), and SDHC (Secure Digital High Capacity, for capacities above 4 GB–although, there are some card readers that cannot handle over 1 GB that are not SDHC). SDHC is not fully compatible with the format that it extends, in that SD devices that do not specifically support SDHC will not work with the newer cards.

The smaller miniSD and microSD cards are usable in full size MMC/SD/SDIO slots with an adapter (which must route the electrical connections as well as making physical contact). However, it is already difficult to create I/O devices in the SD form factor and this will be even more difficult in the smaller sizes.

As SD slots still support MMCs, the separately-evolved smaller MMC variants are also compatible with SD-supporting devices. Unlike miniSD and microSD (which are sufficiently different from SD to make mechanical adapters necessary), RS-MMC slots maintain backward compatibility with full-sized MMCs, because the RS-MMCs are simply shorter MMCs.

Most, possibly all, current MMC flash memory cards support SPI mode even if not officially required as failure to do so would severely affect compatibility. All cards currently made by SanDisk, Ritek/Ridata, and Kingmax digital appear to support SPI. Some MicroSD cards do not support SPI mode.

	Compatibility issues with 4 GB and larger cards

Devices that use SD cards identify the card by requesting a 128-bit identification string from the card. For standard-capacity SD cards, 12 of the bits are used to identify the number of memory clusters (ranging from 1 to 4,096) and 3 of the bits are used to identify the number of blocks per cluster (which decode to 4, 8, 16, 32, 64, 128, 256, or 512 blocks per cluster).

In older 1.x implementations the standard capacity block was exactly 512 bytes. This gives 4,096 × 512 × 512 = 1 gigabyte of storage memory. A later revision of the 1.x standard allowed a 4-bit field to indicate 1,024 or 2,048 bytes per block instead, yielding up to 4 gigabytes of memory storage.

Devices designed before this change may incorrectly identify such cards, usually by misidentifying a card with lower capacity than is the case by assuming 512 bytes per block rather than 1,024 or 2,048.

For the new SDHC (2.0) implementation, 22 bits of the identification string are used to indicate the memory size in increments of 512 bytes. The SDCA currently allows only 16 of the 22 bits to be used, giving a maximum size of 32 GB. All SD cards with a capacity larger than 4 GB must use the 2.0 implementation at minimum. Two bits that were previously reserved and fixed at 0 are now used for identifying the type of card, 0: standard; 1: SDHC; 2, 3: reserved. Non-SDHC devices are not programmed to read this code and therefore cannot correctly identify SDHC or SDXC cards.

All SDHC readers work with standard SD cards.

Many older devices will not accept the 2 or 4 GB size even though it is in the revised standard. The following statement is from the SD Card Association specification:

    To make 2 GByte card, the Maximum Block Length (READ_BL_LEN=WRITE_BL_LEN) shall be set to 1024 bytes. However, the Block Length, set by CMD16, shall be up to 512 bytes to keep consistency with 512 bytes Maximum Block Length cards (Less than and equal 2 Gbyte cards).

	Standard-SD cards (non-SDHC) with greater than 1 GB capacity

The SD Card Association's current specifications define how a standard SD (non-SDHC) card with more than 1 GB and up to 4 GB capacity should be designed. These cards should be readable in any SD 1.01 devices that take the block length data into account. Any 1 GB or lesser card should always work (so the key question is how one's reader handles block length).

According to the specification, the maximum capacity of a standard SD card is defined by (BLOCKNR × BLOCK_LEN), where BLOCKNR may be (4,096 × 512) and BLOCK_LEN may be up to 2,048. This allows a capacity of 4 GB. The main problem is that some of the card readers support only a block (or, sector) size of 512 bytes, so greater than 1 GB non-SDHC cards may cause compatibility difficulties for users of such devices.

	SDHC cards with greater than 32 GB capacity

Similarly to the above, as of version 2.00 of the specification, the capacity of an SDHC card is limited to 32 GB. However, while not strictly adhering to that standard, it is in principle possible to create SDHC-like cards of up to 2 TB capacity. SDHC cards have a fixed sector size of 512 bytes.

SDHC

SDHC (Secure Digital High Capacity, SD 2.0) is an extension of the SD standard which increases card's storage capacity up to 32 GB. SDHC cards share the same physical and electrical form factor as older (SD 1.x) cards, allowing SDHC-devices to support both newer SDHC cards and older SD-cards. To increase addressable storage, SDHC uses sector addressing instead of byte addressing as in the previous SD standard. Byte addressing supported card capacities up to 4 GB, whereas sector addressing can theoretically support capacities up to 2 TB (2048 GB). The current standard limits the maximum capacity of an SDHC card to 32 GB (it is expected that the SDHC specification will be revised in the future to allow card capacities greater than 32 GB). SDHC cards will not work in devices designed to the older SD 1.x specification. The SDHC trademark is licensed to ensure compatibility.
	
SDXC

The Secure Digital Extended Capacity (SDXC) format was unveiled at CES 2009 (January 7–10, 2009). The maximum capacity defined for SDXC cards is 2 TB  (2048 GB). The older SDHC cards also have a maximum capacity of 2 TB based on the card data structures, but this is artificially limited to 32 GB by the SD 2.0 specification. The first SDXCs being released are governed by an SD 3.0 specification (which also still specifies FAT32  and thus lower capacities), whereas higher capacity and faster SDXCs are expected to follow an SD 4.0 specification, which was due to be released in spring of 2010.

The maximum transfer rate of SDXCs which follow the SD 3.0 specification was announced as 832 Mbit/s (these are called UHS104 speeds), with plans that the SD 4.0 specification shall increase this to 2.4 Gbit/s.

The SDcard association selected Microsoft's proprietary exFAT file system in the official SDXC specification; however, as with SD and SDHC, it is still a plain block device and thus arbitrary partitioning and other file systems can be used, such as FAT32, NTFS, ext2, etc.

SD cards with extra features

Various manufacturers have tried to make their SD cards stand out from the crowd in different ways

	* SD Plus - A type of SD card made by Sandisk that has an integrated 	USB 	connector so it can be plugged directly into a USB port without 	needing any special card reader. This concept has proven successful 	and 	other companies started introducing similar designs branded as duo SD 	or 3 	Way in the case of A-DATA's MicroSDHC to SDHC and USB all-in-one 	product, 	which was available in 2008 only.
    * Capacity Display - In 2006, A-DATA announced an SD card with its own 	digital display that would show how much free space is left on the card.
    * Eye-Fi, Inc. - Produces an SD card with Wi-Fi capability built in for 	802.11g, 802.11b, and backwards-compatible 802.11n wireless networks and 	supporting static WEP 40; 104; and 128, WPA-PSK, and WPA2-PSK security 	standards. The card works with any digital camera with an SD slot and can 	transmit captured images over a wireless network. When not in range of a 	wireless network connection, the card makes use of its 2 GB capacity (EYE-	FI-2 GB model) until the images can be transferred. Some models geotag 	their pictures.
* Gruvi - A rare type of microSD card with extra DRM features

Conclusion

Now SD is one of the most popular memory card format,using in possibly all types of digital devices. These cards are marketed by many famous brends, include Braun, Panasonic, Digma, PNY, SanDisk, Trancend, Kingston and Apacer. The development of these cards is continuing and soon may be we will see 2TB card with 4.x implementation and 300MB/s speed or SD will 'dead' and companies will develop other formats, which are more convenient for market then SD.

References

1. http://en.wikipedia.org/wiki/Secure_Digital
2. http://www.sdcard.org/developers/tech/sdcard/
3. http://www.sdcard.org/developers/tech/speed_class/