Corporate Headquarters • 140 Caspian Court • Sunnyvale, CA 94089
SanDisk Corporation
Phone (408) 542-0500 • Fax (408) 542-0503
www.sandisk.com
SanDisk® Corporation general policy does not recommend the use of its products in life support applications where in a failure
or malfunction of the product may directly threaten life or injury. Per SanDisk Terms and Conditions of Sale, the user of SanDisk
products in life support applications assumes all risk of such use and indemnifies SanDisk against all damages. See “Limited
Warranty and Disclaimer of Liability.”
This document is for information use only and is subject to change without prior notice. SanDisk Corporation assumes no
responsibility for any errors that may appear in this document, nor for incidental or consequential damages resulting from the
furnishing, performance or use of this material. No part of this document may be reproduced, transmitted, transcribed, stored in
a retrievable manner or translated into any language or computer language, in any form or by any means, electronic,
mechanical, magnetic, optical, chemical, manual or otherwise, without the prior written consent of an officer of SanDisk
Corporation.
SanDisk and the SanDisk logo are registered trademarks of SanDisk Corporation.
Product names mentioned herein are for identification purposes only and may be trademarks and/or registered trademarks of
their respective companies.
SanDisk products are covered or licensed under one or more of the following U.S. Patent Nos. 5,070,032; 5,095,344; 5,168,465;
5,172,338; 5,198,380; 5,200,959; 5,268,318; 5,268,870; 5,272,669; 5,418,752; 5,602,987. Other U.S. and foreign patents
awarded and pending.
Lit. No. 80-13-00169 Rev. 1.9 12/2003 Printed in U.S.A.
1. Introduction to the SD Card ............................................................................................................................... 1-1
1.3. System Features................................................................................................................................. 1-2
3.5.8. SD Card Registers in SPI Mode.............................................................................................. 3-24
3.6. Data Interchange Format and Card Sizes.......................................................................................... 3-24
4. Secure Digital (SD) Card Protocol Description.................................................................................................. 4-1
4.1. SD Bus Protocol................................................................................................................................ 4-1
4.4.5. Application Specific Commands............................................................................................. 4-13
4.5. Clock Control .................................................................................................................................... 4-14
5.6. SPI Bus Operating Conditions .......................................................................................................... 5-19
5.7. Bus Timing........................................................................................................................................ 5-19
Appendix A. Application Note............................................................................................................................... A-1
Host Design Considerations: NAND MMC and SD-based Products
File System Support ................................................................................................................................. A-5
Appendix B. Ordering Information ........................................................................................................................ B-1
Appendix C. SanDisk Worldwide Sales Offices .................................................................................................... C-1
Appendix D. Limited Warranty.............................................................................................................................. D-1
Appendix E. Disclaimer of Liability ...................................................................................................................... E-1
The Secure Digital Card is a flash-based memory card that is specifically designed to meet the security, capacity,
performance and environmental requirements inherent in newly emerging audio and video consumer electronic
devices. The SD Card includes a copyright protection mechanism that complies with the security of the SDMI
standard, and is faster and capable of higher Memory capacity. The SD Card security system uses mutual
authentication and a “new cipher algorithm” to protect from illegal usage of the card content. A non-secured access
to the user‘s own content is also available. The physical form factor, pin assignment and data transfer protocol are
forward compatible with the SD Card, with some additions.
The SD Card communication is based on an advanced nine-pin interface (Clock, Command, 4xData and 3xPower
lines) designed to operate in a low voltage range. The communication protocol is defined as part of this
specification. The SD Card host interface supports regular MultiMediaCard operation as well. In other words,
MultiMediaCard forward compatibility was kept. Actually the main difference between SD Card and
MultiMediaCard is the initialization process. The SD Card specifications were originally defined by MEI
(Matsushita Electric Company), Toshiba Corporation and SanDisk Corporation. Currently, the specifications are
controlled by the Secure Digital Association (SDA). The SanDisk SD Card was designed to be compatible with the
SD Card Physical Specification.
The SD Card interface allows for easy integration into any design, regardless of microprocessor used. For
compatibility with existing controllers, the SanDisk SD Card offers, in addition to the SD Card interface, an
alternate communication protocol, which is based on the SPI standard.
The current SD Card provides up to 1024 million bytes of memory using flash memory chips, which were designed
especially for use in mass storage applications. In addition to the mass storage specific flash memory chip, the SD
Card includes an on-card intelligent controller which manages interface protocols, security algorithms for copyright
protection, data storage and retrieval, as well as Error Correction Code (ECC) algorithms, defect handling and
diagnostics, power management and clock control.
This document describes the key features and specifications of the SD Card, as well as the information required to
interface this product to a host system.
1.2. Product Models
The SD Card is available in the capacities shown in Table 1-1.
The performance of the communication channel is described in Table 1-2.
Table 1-2. SD Bus/SPI Bus Comparison
SD Card Using SD Bus SD Card Using SPI Bus
Six-wire communication channel (clock, command, 4
data lines).
Error-protected data transfer. Optional non-protected data transfer mode available.
Single or multiple block oriented data transfer. Single or multiple block oriented data transfer.
Three-wire serial data bus (Clock, dataIn, dataOut) + card
specific CS signal (hardwired card selection).
1.4. SD Card Standard
SanDisk SD Cards are fully compatible with the following SD Card Physical Layer Specification standard:
The SD Card Physical Layer System Specification, Version 1.01
This specification may be obtained from:
SD Card Association
53 Muckelemi St.
P.O. Box 189
San Juan Bautista, CA 95045-0189
USA
Phone: 831-623-2107
Fax: 831-623-2248
Email: rcreech@sdcard.org
http://www.sdcard.org
1.5. Functional Description
SanDisk SD Cards contain a high level, intelligent subsystem as shown in Figure 1-1. This intelligent
(microprocessor) subsystem provides many capabilities not found in other types of memory cards. These
capabilities include:
• Host independence from details of erasing and programming flash memory.
• Sophisticated system for managing defects (analogous to systems found in magnetic disk drives).
• Sophisticated system for error recovery including a powerful error correction code (ECC).
The 512-byte sector size of the SD Card is the same as that in an IDE magnetic disk drive. To write or read a sector
(or multiple sectors), the host computer software simply issues a Read or Write command to the SD Card. This
command contains the address. The host software then waits for the command to complete. The host software does
not get involved in the details of how the flash memory is erased, programmed or read. This is extremely important
as flash devices are expected to get more and more complex in the future. Because the SD Card uses an intelligent
on-board controller, the host system software will not require changing as new flash memory evolves. In other
words, systems that support the SD Card today will be able to access future SanDisk SD Cards built with new flash
technology without having to update or change host software.
1.5.2. Defect and Error Management
SD Cards contain a sophisticated defect and error management system. This system is analogous to the systems
found in magnetic disk drives and in many cases offers enhancements. For instance, disk drives do not typically
perform a read after write to confirm the data is written correctly because of the performance penalty that would be
incurred. SD Cards do a read after write under margin conditions to verify that the data is written correctly. In the
rare case that a bit is found to be defective, SD Cards replace this bad bit with a spare bit within the sector header. If
necessary, SD Cards will even replace the entire sector with a spare sector. This is completely transparent to the
host and does not consume any user data space.
The SD Card’s soft error rate specification is much better than the magnetic disk drive specification. In the
extremely rare case a read error does occur, SD Cards have innovative algorithms to recover the data. This is similar
to using retries on a disk drive but is much more sophisticated. The last line of defense is to employ a powerful ECC
to correct the data. If ECC is used to recover data, defective bits are replaced with spare bits to ensure they do not
cause any future problems. These defect and error management systems coupled with the solid-state construction
give SD Cards unparalleled reliability.
1.5.3. Copyright Protection
A detailed description of the Copyright Protection mechanism and related security SD Card commands can be found
in the SD Card Security Specification document from the SD Card Association. All SD Card security related
commands operate in the data transfer mode.
As defined in the SDMI specification, the data content that is saved in the card is saved already encrypted and it
passes transparently to and from the card. No operation is done on the data and there is no restriction to read the
data at any time. Associated with every data packet (song, for example) that is saved in the unprotected memory
there is a special data that is saved in a protected memory area. For any access (any Read, Write or Erase command)
from/to the data in the protected area. For an authentication procedure is done between the card and the connected
device, either the LCM (PC for example) or the PD (portable device, such as SD player). After the authentication
process passes, the card is ready to accept or give data from/to the connected device. While the card is in the
secured mode of operation (after the authentication succeeded) the argument and the associated data that is sent to
the card or read from the card are encrypted. At the end of the Read, Write or Erase operation, the card gets out
automatically of its secured mode.
SanDisk SD Cards have an endurance specification for each sector of 100,000 writes typical (reading a logical
sector is unlimited). This far exceeds what is typically required in nearly all applications of SD Cards. For example,
even very heavy use of the SD Card in cellular phones, personal communicators, pagers and voice recorders will
use only a fraction of the total endurance over the typical device’s lifetime. For instance, it would take over 10 years
to wear out an area on the SD Card on which a file of any size (from 512 bytes to maximum capacity) was rewritten
3 times per hour, 8 hours a day, 365 days per year.
With typical applications, the endurance limit is not of any practical concern to the vast majority of users.
1.5.5. Wear Leveling
Wear-leveling is an intrinsic part of the Erase Pooling functionality of SD using NAND memory. The SD Card’s
Wear Level command is supported as a NOP operation to maintain backward compatibility with existing software
utilities.
1.5.6. Using the Erase Command
The Erase (sector or group) command provides the capability to substantially increase the write performance of the
SD Card. Once a sector has been erased using the Erase command, a write to that sector will be much faster. This is
because a normal write operation includes a separate sector erase prior to write.
1.5.7. Automatic Sleep Mode
A unique feature of the SanDisk SD Card (and other SanDisk products) is automatic entrance and exit from sleep
mode. Upon completion of an operation, the SD Card will enter the sleep mode to conserve power if no further
commands are received within 5msec. The host does not have to take any action for this to occur. In most systems,
the SD Card is in sleep mode except when the host is accessing it, thus conserving power.
When the host is ready to access the SD Card and it is in sleep mode, any command issued to the SD Card will
cause it to exit sleep and respond.
1.5.8. Hot Insertion
Support for hot insertion will be required on the host but will be supported through the connector. Connector
manufacturers will provide connectors that have power pins long enough to be powered before contact is made with
the other pins. Please see connector data sheets for more details. This approach is similar to that used in PCMCIA
and MMCA devices to allow for hot insertion.
The following sections provide valuable information on the SC Card in SD Bus mode.
1.5.9.1. SD Card Standard Compliance
The SD Card is fully compliant with SD Card Physical Layer Standard Specification V1.01. The structure of the
Card Specific Data (CSD) register is compliant with CSD Structure 1.0.
1.5.9.2. Negotiating Operation Conditions
The SD Card supports the operation condition verification sequence defined in the SD Card standard specifications.
Should the SD Card host define an operating voltage range, which is not supported by the SD Card it will put itself
in an inactive state and ignore any bus communication. The only way to get the card out of the inactive state is by
powering it down and up again.
In Addition the host can explicitly send the card to the inactive state by using the GO_INACTIVE_STATE
command.
1.5.9.3. Card Acquisition and Identification
The SD Card bus is a single master (SD Card host application) and multi-slaves (cards) bus. The Clock and Power
lines are common to all cards on the bus. During the identification process, the host accesses each card separately
through its own command lines. The SD Card’s CID register is pre-programmed with a unique card identification
number, which is used during the identification procedure.
In addition, the SD Card host can read the card’s CID register using the READ_CID SD Card command. The CID
register is programmed during the SD Card testing and formatting procedure, on the manufacturing floor. The SD
Card host can only read this register and not write to it.
An internal pull-up resistor on the DAT3 line may be used for card detection (insertion/removal). The resistor can
be disconnected during data transfer (using ACMD42). Additional practical card detection methods can be found in
SD Physical Specification’s Application Notes given by the SDA.
1.5.9.4. Card Status
The card status is separated into the following two fields:
• Card Status is stored in a 32-bit status register that is sent as the data field in the card respond to host
commands. Status register provides information about the card’s current state and completion codes
for the last host command. The card status can be explicitly read (polled) with the SEND_STATUS
command.
• SD_Status is stored in 512 bits that are sent as a single data block after it was requested by the host
using the SD_STATUS (ACMD13) command. SD_STATUS contains extended status bits that relate
to BUS_WIDTH, security related bits and future specific applications.
The basic unit of data transfer to/from the SD Card is one byte. All data transfer operations which require a block
size always define block lengths as integer multiples of bytes. Some special functions need other partition
granularity. Figure 1-2 shows the Memory Array Partitioning.
For block-oriented commands, the following definition is used:
• Block—The unit that is related to the block-oriented read and write commands. Its size is the number
of bytes that are transferred when one block command is sent by the host. The size of a block is either
programmable or fixed. The information about allowed block sizes and the programmability is stored
in the CSD.
The granularity of the erasable units is in general not the same as for the block-oriented commands:
• Sector—The unit that is related to the erase commands. Its size is the number of blocks that are erased
in one portion. The size of a sector is fixed for each device. The information about the sector size (in
blocks) is stored in the CSD.
For devices that include write protection, the following definition is used:
• WP Group—The minimal unit that may which may have individual write protection. Its size is the
number of groups which will be write protected by one bit. The size of a WP-group is fixed for each
device. The information about the size is stored in the CSD.
The SD Card supports two read/write modes as shown in Figure 1-3.
Multiple Block Mode
Memory
Sectors
Memory
Sectors
Memory
Sectors
Start
Address
Single Block Mode
Memory
Sectors
Start
Address
(Read)
Memory
Sectors
Memory
Sectors
Memory
Sectors
WriteRead
Memory
Sectors
Start
Address
(Write)
Stop
Memory
Sectors
Start
Memory
Sectors
Memory
Sectors
Misalignment Error
Memory
Sectors
Start
Address
(Read/Write)
Memory
Sectors
Stop
Memory
Sectors
Figure 1-3. Data Transfer Formats
Single Block Mode
In this mode the host reads or writes one data block in a pre-specified length. The data block transmission is
protected with 16-bit CRC that is generated by the sending unit and checked by the receiving unit.
The block length for read operations is limited by the device sector size (512 bytes) but can be as small as a single
byte. Misalignment is not allowed. Every data block must be contained in a single physical sector. The block length
for write operations must be identical to the sector size and the start address aligned to a sector boundary.
Multiple Block Mode
This mode is similar to the single block mode, but the host can read/write multiple data blocks (all have the same
length) which will be stored or retrieved from contiguous memory addresses starting at the address specified in the
command. The operation is terminated with a stop transmission command.
Misalignment and block length restrictions apply to multiple blocks as well and are identical to the single block
read/write operations.
1.5.9.7. Data Transfer Rate
The SD Card can be operated using either a single data line (DAT0) or four data lines (DAT0-DAT3) for data
transfer. The maximum data transfer rate for a single data line is 25 Mbit per second and for four data lines it is 100
Mbit (12 MB) per second.
Every sector is protected with an Error Correction Code (ECC). The ECC is generated (in the memory card) when
the sectors are written and validated when the data is read. If defects are found, the data is corrected prior to
transmission to the host.
1.5.9.9. Erase
The smallest erasable unit in the SD Card is a sector. In order to speed up the erase procedure, multiple sectors can
be erased at the same time. To facilitate selection, a first command with the starting address is followed by a second
command with the final address, and all sectors within this range will be selected for erase.
1.5.9.10. Write Protection
Two-card level write protection options are available: permanent and temporary. Both can be set using the
PROGRAM_CSD command (see below). The permanent write protect bit, once set, cannot be cleared. This feature
is implemented in the SD Card controller firmware and not with a physical OTP cell.
NOTE: Use the Write Protect (WP) Switch located on the card’s side edge to prevent the host from writing to or
erasing data on the card. The WP switch does not have any influence on the internal Permanent or
Temporary WP bits in the CSD.
1.5.9.11. Copy Bit
The content of a SD Card can be marked as an original or a copy using the copy bit in the CSD register. Once the
Copy bit is set (marked as a copy) it cannot be cleared. The Copy bit of the SD Card is programmed (during test and
formatting on the manufacturing floor) as a copy. The SD Card can be purchased with the copy bit set (copy) or
cleared, indicating the card is a master. This feature is implemented in the SD Card controller firmware and not with
a physical OTP cell.
1.5.9.12. The CSD Register
All the configuration information of the SD Card is stored in the CSD register. The MSB bytes of the register
contain manufacturer data and the two least significant bytes contain the host-controlled data, the card Copy, write
protection and the user file format indication.
The host can read the CSD register and alter the host controlled data bytes using the SEND_CSD and
PROGRAM_CSD commands.
1.5.10. SD Card—SPI Mode
The SPI mode is a secondary communication protocol for SD Cards. This mode is a subset of the SD Card protocol,
designed to communicate with an SPI channel, commonly found in Motorola’s (and lately a few other vendors’)
microcontrollers.
The operating condition negotiation function of the SD Card bus is supported differently in SPI mode by using the
READ_OCR (CMD58) command. The host shall work within the valid voltage range (2.7 to 3.6 volts) of the card
or put the card in inactive state by sending a GO_INACTIVE command to the card.
1.5.10.2. Card Acquisition and Identification
The host must know the number of cards currently connected on the bus. Specific card selection is done via the CS
signal (CD/DAT3). The internal pullup resistor on the CD/DAT3 line may be used for card detection
(insertion/removal). Additional practical card detection methods can be found in SD Physical Specification’s
Application Notes given by the SDA.
1.5.10.3. Card Status
In SPI mode, only 16 bits (containing the errors relevant to SPI mode) can be read out of the 32-bit SD Card status
register. The SD_STATUS can be read using ACMD13, the same as in SD Bus mode.
1.5.10.4. Memory Array Partitioning
Memory partitioning in SPI mode is equivalent to SD Bus mode. All read and write commands are byte addressable
with the limitations given in Section 1.5.9.5.
1.5.10.5. Read and Write Operations
In SPI mode, both single and multiple block data transfer modes are supported.
1.5.10.6. Data Transfer Rate
In the SPI mode, only one data line is used for each direction. The SPI mode data transfer rate is the same as the SD
Bus mode data transfer rate when using one data line only (up to 25 Kbits per second).
The SD Card has nine exposed contacts on one side (see Figure 3-1). The host is connected to the SD Card using a
dedicated 9-pin connector.
3.1.1. Pin Assignments in SD Card Mode
Table 3-1 lists the pin assignments and definitions in SD Card Mode.
Table 3-1. SD Bus Mode Pad Definition
Pin # Name Type1 SDDescription
1 CD/DAT32 I/O3 Card Detect/Data Line [Bit 3]
2 CMD I/O Command/Response
3 V
4 VDD S Supply voltage
5 CLK I Clock
6 V
7 DAT0 I/O Data Line [Bit 0]
8 DAT1 I/O Data Line [Bit 1]
9 DAT2 I/O Data Line [Bit 2]
NOTES: 1) S=power supply; I=input; O=output using push-pull drivers.
2) The extended DAT lines (DAT1-DAT3) are input on power up. They start to operate as DAT lines after the
SET_BUS_WIDTH command. It is the responsibility of the host designer to connect external pullup resistors to all
data lines even if only DAT0 is to be used. Otherwise, non-expected high current consumption may occur due to the
floating inputs of DAT1 & DAT2 (in case they are not used).
3) After power up, this line is input with 50Kohm(+/-20Kohm) pull-up (can be used for card detection or SPI mode
selection). The pull-up may be disconnected by the user, during regular data transfer, with
SET_CLR_CARD_DETECT (ACMD42) command.
Table 3-2 lists the pin assignments and definitions in SPI Mode.
Table 3-2. SPI Bus Mode Pad Definition
Pin # Name Type1 SPI Description
1 CS I Chip Select (Active low)
2 DataIn I Host to Card Commands and Data
3 VSS1 S Supply Voltage Ground
4 VDD S Supply Voltage
5 CLK I Clock
6 VSS2 S Supply Voltage Ground
7 DataOut O Card to Host Data and Status
8 RSV(2) I Reserved
9 RSV(2) I Reserved
NOTES: 1) S=power supply; I=input; O=output.
2) The ‘RSV’ pins are floating inputs. It is the responsibility of the host designer to connect external pullup resistors to
those lines. Otherwise non-expected high current consumption may occur due to the floating inputs.
Each card has a set of information registers (refer to Table 3-3). Detailed descriptions are provided in Section 3.5.
Table 3-3. SD Card Registers
Name Width Description
CID 128 Card identification number: individual card number for identification.
RCA1 16 Relative card address: local system address of a card, dynamically
suggested by the card and approved by the host during initialization.
CSD 128 Card specific data: information about the card operation conditions.
SCR 64 SD Configuration Register: information about the SD Card’s special
features capabilities.
OCR 32 Operation Condition Register
NOTE: 1) The RCA register is not available in SPI Mode.
The host may reset the cards by switching the power supply off and on again. The card has its own power-on
detection circuitry which puts the card into an idle state after the power-on. The card can also be reset by sending
the GO_IDLE (CMD0) command.
Figure 3-2 shows the bus topology of several cards with one host in SD Bus mode.
HOST
CLK
Vdd
Vss
D0-3(A),
CMD(A)
D0-3(B),
CMD(B)
D0-D3, CMD
D0-D3, CMD
CLK
Vdd
Vss
CLK
Vdd
Vss
CLK
SD Memory
Card (A)
SD Memory
Card (B)
Vdd
Vss
MultiMediaCard
(C)
D0-3(C)
CMD(C)
D0, CS, CMD
D1&D2 Not
Connected
Figure 3-2. SD Card System Bus Topology
During the initialization process, commands are sent to each card individually, allowing the application to detect the
cards and assign logical addresses to the physical slots. Data is always sent to each card individually. However, to
simplify the handling of the card stack, after initialization, all commands may be sent concurrently to all cards.
Addressing information is provided in the command packet.
The SD Bus allows dynamic configuration of the number of data lines. After power-up, by default, the SD Card will
use only DAT0 for data transfer. After initialization, the host can change the bus width (number of active data
lines). This feature allows and easy trade off between hardware cost and system performance.
are pull-up resistors protecting the CMD and the DAT line against bus floating when no card is
CMD
inserted or when all card drivers are in a hi-impedance mode. RWP is used for the Write Protect Switch. See
Section 5.4.2 for the component values and conditions.
R
CMD
C1C
DAT0-3
2
R
WP
Write Protect
CMD
C
3
9
Vss
1 2 3 4 5 6 7 8
SD Memory
Card
CLK
Hot Insertion/Removal
Hot insertion and removal are allowed. The SanDisk SD Card will not be damaged by inserting or removing it into
the SD bus even when the power is up:
• The inserted card will be properly reset also when CLK carries a clock frequency f
• Data transfer failures induced by removal/insertion should be detected by the bus master using the
.
PP
CRC codes that suffix every bus transaction.
3.2.1. Power Protection
Cards can be inserted into or removed from the bus without damage. If one of the supply pins (V
connected properly, then the current is drawn through a data line to supply the card.
DD or VSS)
is not
Data transfer operations are protected by CRC codes; therefore, any bit changes induced by card insertion and
removal can be detected by the SD bus master. The inserted card must be properly reset also when CLK carries a
clock frequency f
between V
DD
If the hot insertion feature is implemented in the host, than the host has to withstand a shortcut
pp.
and V
without damage.
SS
3.3. SPI Bus Topology
The SD Card SPI interface is compatible with SPI hosts available on the market. As any other SPI device the SD
Card SPI channel consists of the following four signals: