Initialization Algorithm; File System Support - SanDisk SDSDB-32-201-80 - Industrial Grade Flash Memory Card Product Manual

Secure digital card
Table of Contents

Advertisement

Ordering Information and Technical Support

Initialization Algorithm

The initialization algorithm needs to be considered for products designed to support the MultiMediaCard and SD
Card or SD Card only. An SD socket is physically thicker which allows both types of cards to be inserted.
Therefore, the host needs to be able to detect which card is inserted into the socket.
When the SD initialization command is used first, it causes the MultiMediaCard to return an error that provides the
host with an identification of the card type. If the host is supporting both the MultiMediaCard and SD Card, it can
continue the initialization using the MMC commands. If the host does not support both cards, it issues an error
message instructing the user to insert an SD Card.
If the design uses a MultiMediaCard socket, the host can start the initialization with the MMC command. The host
does not need to detect which type of card is inserted because the SD Card will not physically fit into an MMC
socket.

File System Support

If a design needs to support a file system, such as SanDisk's Host Developers Tool Kit (HDTK), additional
considerations are necessary.
Reading and writing to an SD Card and MultiMediaCard is generally done in 512 byte blocks, however, erasing
often occurs in much larger blocks. The NAND architecture used by SanDisk and other card vendors currently has
Erase Block sizes of (32) or (64) 512 byte blocks, depending on card capacity. In order to re-write a single 512 byte
block, all other blocks belonging to the same Erase Block will be simultaneously erased and need to be rewritten.
For example—writing a file to a design using a FAT file system takes three writes/updates of the system area of
FAT and one write/update of the data area to complete the file write. First, the directory has to be updated with the
new file name. Second, the actual file is written to the data area. Third, the FAT table is updated with the file data
location. Finally, the directory is updated with the start location, length, date and time the file was modified.
Therefore, when selecting the file size to write into a design, the size should be as large as possible and a multiple of
the Erase Block size. This takes advantage of the architecture.
Some designs update the FAT table for every cluster of the data file written. This can slow the write performance,
because the FAT table is constantly being erased and re-written. The best approach is to write all the file clusters
then update the FAT table once to avoid the performance hit of erasing and re-writing all the blocks within the
Erase Block multiple times.
SanDisk Secure Digital (SD) Card Product Manual, Rev. 1.9 © 2003 SANDISK CORPORATION
A-5

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents