SanDisk SDSDH-1024 Product Manual - Page 123

Initialization Algorithm, File System Support

Page 123 highlights

Host Design Considerations: NAND MMC and SD-based Products Application Note Revision 1.0 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 rewritten. 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. © 2002 SanDisk Corporation 7 9/30/02, Lit# 80-11-00160

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123

Host Design Considerations:
Application Note
NAND MMC and SD-based Products
Revision 1.0
© 2002 SanDisk Corporation
7
9/30/02, Lit# 80-11-00160
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.