Thursday, July 31, 2008


In August of 1999, Matsushita (better known by its Panasonic brand name), SanDisk, and Toshiba first announced an agreement on a comprehensive collaboration to jointly develop, specify and widely promote a next generation secure memory card called the SD Memory Card. With a physical profile of 24 mm × 32 mm × 2.1 mm, the new card provided both an SDMI-compliant (Secure Digital Music Initiative), high-level of copyright protection and high-density memory capacity for the time. The new memory card format was designed to compete with Sony's Memory Stick format that was released in 1998.
The “Secure” in Secure Digital comes from the card’s origin. To create the SD card, Toshiba added encryption hardware to the already-existent MMC, to calm music industry concerns that MMCs would allow for easy piracy of music. (A similar scheme is the MagicGate standard used in Memory Sticks.) In theory, the encryption would allow some enforcement of Digital rights management[1] schemes on digital music, but the capability is rarely used.
The signature “SD” logo was actually developed for another use entirely: it was originally used for “Super Density Disc”, a prototype format by Toshiba created during the development of DVD. This is why the “D” looks similar to half of an optical disc, possibly reinforced by the SD card's music industry features and consumers' familiarity with music on optical discs.
At the 2000 CES trade show Matsushita, SanDisk and Toshiba Corporation announced that a new industry-wide association would be created to set industry standards for their proprietary SD (Secure Digital) Memory Card and promote its wide acceptance in digital applications. The new organization, named the SDAssociation (SDA), is headquartered in California and its executive membership includes some 30 world-leading high-tech companies and major content companies. Sampling of the SD Memory Card began in the first quarter of 2000, and production shipments commenced in the second quarter of 2000. The card was initially available in 32 and 64 megabyte capacities.
In April 2006, the SDA released a detailed specification for the non-security related portions of the SD Memory Card standard. In addition, they released specifications for the SDIO (Secure Digital Input Output) cards and the standard SD host controller. During the same year, specifications were finalised 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 2.2 MB/s.

[edit] Design and Implementation

An SD card, mini SD card, and micro SD card from top to bottom.
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 mm × 24 mm × 2.1 mm, but can be as thin as 1.4 mm, just like MMCs (see below).
The contacts are recessed beneath the surface of the card, protecting the contacts from contact with the fingers.
SD cards typically have transfer rates in the range of 10-20 MBytes/s, but this is always changing, particularly in light of recent improvements to the MMC standard.[3]
Devices with SD slots can use the thinner MMCs, but the standard SD cards will not fit into the thinner MMC slots. miniSD and microSD cards can be used directly in SD slots with a simple passive adapter, since they 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.

[edit] Optional write-protect tab
When looking at the card from the top (see pictures) there is one required notch on the right side (the side with the diagonal notched corner).
On the left side there is usually a slidable tab. This is the write-protect tab. The MMC has neither notch. It is easy to mistake this tab as an electronic on/off switch built inside the card, but it is used simply as a tab/notch switch. The tab/notch works the same way as the notches on compact audio cassettes and videotape cassette tapes or floppy disks, where the device senses the tab/notch and determines if the card is write-protected or not.
When this write-protect tab is in the down position (away from the end that is inserted) then it is write protected and read-only. When the tab is in the up position it is write enabled. Since the tab is optional, the card can have no switch and no notch, which makes the card always writable, or it can have an empty notch and be a ROM card, which makes the card always write-protected and read-only. If the tab becomes broken or falls off then the card will become a write-protected ROM card and no longer be writable. A possible troubleshooting solution would be to apply tape over the notched area (avoiding the connectors and the other notch) to configure the card in a permanent writable state.
If the sensor inside the device is faulty and unable to detect the tab/notch, all SD cards will seem to be either write-protected or write-enabled, depending on the failure mode.
The write protect tab feature is optional within the Secure Digital Association guidelines. Some manufacturers claim that the write switch is easily broken, and do not include it on all their card models.[4] For writable cards, this is simply a matter of changing the molding of the outer shell so that the notch doesn't exist.
Some music and film media companies (e.g. Disney) have released limited catalogs of records and/or videos on SD. These usually contain DRM-encoded Windows Media files, making use of the SD format's DRM capabilities. Such media is usually permanently marked read-only, by adding the notch with no tab. These cards could be further protected (and possibly produced more cheaply) by manufacturing the card with true ROM rather than flash memory; it is not clear if any vendors have taken this approach.

[edit] File system
Like other flash card technologies, most SD cards ship preformatted with the FAT or FAT 32 file system. 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. However, because the card appears as a removable hard drive to the host system, the card can be reformatted to any file system supported by the operating system.
It is worth noting that while defragmentation utilities can be run against an SD card, there is no performance advantage in doing so (but see below on data recovery). Defragmentation is a process intended to optimize access to data on a drive with spinning platters and moving heads; however, since flash memory is truly random-access (a read to an adjacent cell is no faster than a read from any other cell), there is no performance gain. Further, the flash controller abstracts the physical memory location used for a given "sector", so that the host machine doesn't really know the layout of the data. Finally, as the defragmentation process moves data around, attempting to optimize it, a small portion of the flash memory's wear life is consumed.
However, note that any file recovery tool will struggle to recover files from highly fragmented data if the File Allocation Table becomes highly corrupted.

[edit] Speeds
There are different speed grades available which are measured with the same system as CD-ROMs, in multiples of 150 kB/s (1x = 150 kB/s). Basic cards transfer data up to six times (6x) the data rate of the standard CD-ROM speed (900 kB/s vs. 150 kB/s). High-speed cards are made with higher data transfer rates like 66x (10 MB/s), and high-end cards have speeds of 150x or higher. Note that maximum read speed and maximum write speed may be different, with maximum write speed typically lower than maximum read speed. Some digital cameras require high-speed cards (write speed) to record video smoothly or capture multiple still photographs in rapid succession. The SD card specification 1.01 allows for a maximum speed of 66x. Higher speeds of up to 150x are defined by specification 1.1.
The following table lists some common ratings and their respective maximum transfer rates.
Rating
Speed (MB/s)
6x
0.9
32x
4.8
40x
6.0
66x
10.0
133x
20.0
150x
22.5

[edit] Openness of standards

The insides of a Samsung 512 MB SD Card. The top chip is the SD controller and the bottom one is the NAND flash chip that actually stores the data.

The internal components of a SanDisk 128 MB SD Card.
Like most memory card formats, SD is covered by numerous patents (e.g. US patent 5602987) and trademarks.
There are three versions of the SD specification: 1.0, 1.1 and 2.0. These were originally only available after agreeing to a non-disclosure agreement (NDA) which prohibits the development of an open source driver, a fact that generates a fair amount of consternation in the open-source and free software communities. The system was eventually reverse-engineered though, and the non-DRMed sections of the memory cards could be accessed by free software drivers.
These days however, the SD Card Association (SDA) has made access to a simplified version of the specification under a less-restrictive licence.[5] Although most open-source drivers were written before this, it has helped them to solve some compatibility issues.
In 2006, the SD Card Association also released a simplified version of their host controller interface specification (not to be confused with the physical specification, which covers the actual cards and their protocol).[6] Like the physical specification, most of the information had already been discovered before the public release[7] and at least Linux had a fully free driver for it. Still, building a chip conforming to this specification caused the One Laptop Per Child project to claim "the first truly Open Source SD implementation, with no need to obtain an SDI license or sign NDAs to create SD drivers or applications."[8]
For the most part, the lack of complete, open SD specifications mainly affects embedded systems, since desktop users generally read SD cards via USB-based card readers. These card readers present a standard USB mass storage interface to memory cards, thus separating the operating system from the details of the underlying SD interface. However, embedded systems (such as portable music players) usually access SD cards directly, and therefore complete programming information is necessary. Desktop card readers are themselves examples of such embedded systems; the manufacturers of these readers have usually paid the SDCA for complete access to the SD specifications. Many notebook computers now include SD card readers not based on USB; device drivers for these essentially access the SD card directly, as in embedded systems.

[edit] Technical explanation
SD supports at least three transfer modes:
One-bit SD mode (separate command and data channels and a proprietary transfer format)
Four-bit SD mode (uses extra pins plus some reassigned pins)
SPI mode (basically, a simpler subset of the SD protocol for use with microcontrollers)
All memory cards must support all three modes, except for microSD where SPI is optional. The cards must also support clock frequencies of up to 25 MHz for regular cards, and 50 MHz for high-speed cards.
Royalties for SD/SDIO licenses are imposed for manufacture and sale of memory cards and host adapters (1000 USD per year plus membership at 1500 USD/year) but SDIO cards can be made without royalties and MMC host adapters do not require a royalty. MMCs have a seven-pin interface; SD and SDIO have expanded this to nine pins and MMC Plus expands this even further with thirteen pins.

[edit] DRM features
The digital rights management scheme embedded in the SD cards is defined as the Content Protection for Recordable Media (CPRM) by the 4C Entity and is centered around use of the Cryptomeria cipher (also known as C2). The specification is kept secret and is only accessible to licensees. DVD-Audio uses a very similar scheme known as Content Protection for Prerecorded Media (CPPM). This type of DRM is associated with SDMI, an organisation set up by the RIAA to promote such hardware-based copy protection schemes. Many SD cards are marked on the packaging as being 'SDMI Compliant' for this reason. This DRM has not been seen "in the wild" and few, if any, devices appear to provide support for it.
Super*Talent, a manufacturer of computer memory, has created the "Super Digital" card. They are the same in appearance and function to regular Secure Digital cards, but they lack the CPRM code commonly found in Secure Digital cards. [9]

[edit] Compared to other flash memory formats
Overall, SD is less open than CompactFlash or USB flash memory drives, which can be implemented for free but require licensing fees for the 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 can, at least, be accessed freely using the well-documented SPI/MMC mode.
xD cards are simply 18-pin NAND flash chips in a special package, and support the standard command set for raw NAND flash access. Although the raw hardware interface to xD cards is well-understood, the layout of its memory contents--necessary for interoperability with xD card readers and digital cameras--is totally undocumented. The consortium that licenses xD cards has not released any publicly available technical information.

[edit] Different types of MMC/SD cards
The SD card is not the only flash memory card standard ratified by the Secure Digital Card Association. 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 cards some readers can't 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.
These 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). It should be noted, however, that 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. However, a WiFi card for mini-SDIO is already available from Spectec.[10]
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. More information on these variants can be found in the article about the MultiMediaCard standard.
It is also important to note, that unlike for data storage (which typically works everywhere an SD slot is present), an SDIO device must be supported and equipped with drivers and applications for the host system and usually doesn't work outside of the manufacturer's scope (which means, for example, that an HP SDIO camera usually does not work with PDAs for which it is not listed as an accessory). This behavior is often not expected by end users (who expect that only the SD slot is required) and is similar to compatibility problems among Bluetooth devices.
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. Also, MMCs may be electrically identical to SD cards but in a thinner package and with an electronic fuse blown to disable SD functionality (so no SD royalties need to be paid). Some MicroSD cards do not support SPI mode.
MMC defined the SPI and one-bit MMC/SD protocols. The underlying SPI protocol has existed for years as a standard feature on many microcontrollers. From a societal perspective, the justification for a new incompatible SD/MMC protocol is questionable; the development of a new incompatible and unnecessary protocol may help trade associations collect licensing and membership fees but it raises the cost of hardware and software in many ways. The new protocol used open collector signaling to allow multiple cards on the same bus but this actually causes problems at higher clock rate. While SPI used three shared lines plus a separate chip select to each card, the new protocol allows up to 30 cards to be connected to the same three wires (with no chip select) at the expense of a much more complicated card initialization and the requirement that each card have a unique serial number for plug and play operation; this feature is rarely used and its use is actively discouraged in new standards (which recommend a completely separate channel to each card) because of speed and power consumption issues. The quasi-proprietary one-bit protocol was extended to support four bit wide (SD and MMC) and eight bit (MMC only) transfers for more speed while much of the rest of the computer industry is moving to higher speed narrower channels; standard SPI could simply have been clocked at higher data rates (such as 133 MHz) for higher performance than offered by four-bit SD — embedded CPUs that did not already have higher clock rates available would not have been fast enough to handle the higher data rates anyway. The SD card association dropped support for some of the old one-bit MMC protocol commands and added support for additional commands related to copy protection.