Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
SD card
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Interface=== [[File:Sd insides.png|thumb|Inside a 512 MB SD card: [[NAND flash]] chip that holds the data (bottom) and [[SD controller]] (top)]] [[File:SD-extreMEmory 2GB alt innen.jpg|thumb|upright|Inside a 2 GB SD card: two [[NAND flash]] chips (top and middle), SD controller chip (bottom)]] [[File:Pretec 16GB SDHC without cover 20090420.jpg|thumb|upright|Inside a 16 GB SDHC card]] ====Command interface==== SD cards and host devices initially communicate through a [[synchronous]] one-bit interface, where the host device provides a clock signal that strobes single bits in and out of the SD card. The host device thereby sends 48-bit commands and receives responses. The card can signal that a response will be delayed, but the host device can abort the dialogue.<ref name="SDHCspec"/> Through issuing various commands, the host device can:<ref name="SDHCspec"/> * Determine the type, memory capacity and capabilities of the SD card * Command the card to use a different voltage, different clock speed, or advanced electrical interface * Prepare the card to receive a block to write to the flash memory, or read and reply with the contents of a specified block. The command interface is an extension of the [[MultiMediaCard]] (MMC) interface. SD cards dropped support for some of the commands in the MMC protocol, but added commands related to copy protection. By using only commands supported by both standards until determining the type of card inserted, a host device can accommodate both SD and MMC cards. ====Electrical interface==== All SD card families initially use a 3.3 [[volt]] electrical interface. On command, SDHC and SDXC cards can switch to 1.8 V operation.<ref name="SDHCspec"/> At power-up or card insertion, the voltage on pin 1 selects either the Serial Peripheral Interface (SPI) bus or the SD bus. The SD bus starts in one-bit mode, but the host device may issue a command to switch to the four-bit mode, if the SD card supports it. For various card types, support for the four-bit SD bus is either optional or mandatory.<ref name="SDHCspec"/> After determining that the SD card supports it, the host device can also command the SD card to switch to a [[#Speed|higher transfer speed]]. Until determining the card's capabilities, the host device should not use a clock speed faster than 400 kHz. SD cards other than SDIO (see below) have a "Default Speed" clock rate of 25 MHz. The host device is not required to use the maximum clock speed that the card supports. It may operate at less than the maximum clock speed to conserve power.<ref name="SDHCspec"/> Between commands, the host device can stop the clock entirely. ====MBR and FAT==== {{More citations needed|section|date=September 2023}} Most SD cards ship preformatted with one or more [[Master boot record|MBR partitions]], where the first or only partition contains a [[file system]]. This lets them operate like the [[hard disk]] of a [[personal computer]]. Per the SD card specification, an SD card is formatted with MBR and the following file system: * For SDSC cards: ** Capacity of less than 32,680 logical sectors<!-- This is the exact condition as per the SD card spec. For operating systems to properly recognize this as FAT12, the cluster values used on the resulting volume must not be outside the range 002h..FF5h, a condition normally (but not necessarily) met implicitly when applying standard logical geometries on a FAT filesystem with less than 32680 logical sectors. We mention the logical sector count rather than the allowed cluster range here as this article is about SD cards specifically. --> (smaller than 16 MB{{efn|name="here, MB = 1024"|reference=here, MB = 1024<sup>2</sup> B}}): [[FAT12]] with partition type [[Partition type#PID 01h|01h]] and [[BPB 3.0]] or [[EBPB 4.1]]<ref name="SDG_2000_SD-P2-V1.0">{{cite book |title=SD Memory Card Specifications β PART 2 FILE SYSTEM SPECIFICATION β Version 1.0 |author=<!-- Staff writer(s); no by-line --> |publisher=SD Group, Matsushita Electric Industrial Co., Ltd. (MEI), SanDisk Corporation, Toshiba Corporation |date=February 2000 |version=1.0}}</ref> ** Capacity of 32,680 to 65,535 logical sectors (between 16 MB and 32 MB):{{efn|name="here, MB = 1024"}} [[FAT16]] with partition type [[Partition type#PID 04h|04h]] and [[BPB 3.0]] or [[EBPB 4.1]]<ref name="SDG_2000_SD-P2-V1.0"/> ** Capacity of at least 65,536 logical sectors (larger than 32 MB):{{efn|name="here, MB = 1024"}} [[FAT16B]] with partition type [[Partition type#PID 06h|06h]] and [[EBPB 4.1]]<ref name="SDG_2000_SD-P2-V1.0"/> * For SDHC cards: ** Capacity of less than 16,450,560<!-- CHS: 0..1023 / 0..254 (but not 255!) / 1 (but not 0!)..63 -> limit: 1024x255x63 = 16450560 --> logical sectors (smaller than 7.8 GB): [[FAT32]] with partition type [[Partition type#PID 0Bh|0Bh]] and [[EBPB 7.1]] ** Capacity of at least 16,450,560 logical sectors (larger than 7.8 GB): [[FAT32]] with partition type [[Partition type#PID 0Ch|0Ch]] and [[EBPB 7.1]] * For SDXC cards: [[exFAT]] with partition type [[Partition type#PID 07h|07h]] Most consumer products that take an SD card expect that it is partitioned and formatted in this way. Universal support for FAT12, FAT16, FAT16B and FAT32 allows the use of SDSC and SDHC cards on most host computers with a compatible SD reader, to present the user with the familiar method of named files in a hierarchical directory tree.{{citation needed|date=September 2023}} On such SD cards, standard utility programs such as Mac OS X's "{{Nowrap|[[Disk Utility]]}}" or Windows' [[SCANDISK]] can be used to repair a corrupted filing system and sometimes recover deleted files. [[Defragmentation]] tools for FAT file systems may be used on such cards. The resulting consolidation of files may provide a marginal improvement in the time required to read or write the file,<ref name="Fragmentation_and_Speed">{{Citation | url = https://www.sdcard.org/developers/overview/speed_class/ | title = Fragmentation and Speed | date = 11 December 2020 | publisher = SD Card | access-date = 21 November 2011 | archive-date = 3 June 2018 | archive-url = https://web.archive.org/web/20180603051813/https://www.sdcard.org/developers/overview/speed_class/ | url-status = live }}</ref> but not an improvement comparable to defragmentation of hard drives, where storing a file in multiple fragments requires additional physical and relatively slow, movement of a drive head.{{citation needed|date=September 2023}} Moreover, defragmentation performs writes to the SD card that count against the card's rated lifespan. The write endurance of the physical memory is discussed in the article on [[Flash memory degradation|flash memory]]; newer technology to increase the storage capacity of a card provides worse write endurance.{{citation needed|date=September 2023}} When reformatting an SD card with a capacity of at least 32 MB{{efn|name="here, MB = 1024"}} (65,536 logical sectors or more), but not more than 2 GB,{{efn|name="GiB"}} [[FAT16B]] with partition type [[Partition type#PID 06h|06h]] and [[EBPB 4.1]]<ref name="SDG_2000_SD-P2-V1.0"/> is recommended if the card is for a consumer device. (FAT16B is also an option for 4 GB cards, but it requires the use of 64 KB [[cluster (file system)|clusters]], which are not widely supported.) FAT16B does not support cards above 4 GB{{efn|name="GiB"}} at all. The SDXC specification mandates the use of [[Microsoft]]'s [[proprietary format|proprietary]] [[exFAT]] file system,<ref name="engadget_sdxc_2t_300m">{{cite web | url = https://www.engadget.com/2009/01/07/sdxc-memory-cards-promise-2tb-of-storage-300mbps-transfer/ | title = SDXC memory cards promise 2 TB of storage, 300 MBps transfer | publisher = Engadget | date = 2009-01-07 | access-date = 2010-08-22 | archive-date = 2010-02-11 | archive-url = https://web.archive.org/web/20100211152502/http://www.engadget.com/2009/01/07/sdxc-memory-cards-promise-2tb-of-storage-300mbps-transfer | url-status = live }}</ref> which sometimes requires appropriate drivers (e.g. <code>exfat-utils</code>/<code>exfat-fuse</code> on Linux). ====Risks of reformatting==== Reformatting an SD card with a different file system, or even with the same one, may make the card slower, or shorten its lifespan. Some cards use [[wear leveling]], in which frequently modified blocks are mapped to different portions of memory at different times, and some wear-leveling algorithms are designed for the access patterns typical of FAT12, FAT16 or FAT32.<ref>{{cite web |url=https://lwn.net/Articles/428584/ |title=Optimizing Linux with cheap flash drives |publisher=Linux Weekly News |access-date=2011-04-11 |archive-date=2013-10-07 |archive-url=https://web.archive.org/web/20131007144837/http://lwn.net/Articles/428584/ |url-status=live }}</ref> In addition, the preformatted file system may use a cluster size that matches the erase region of the physical memory on the card; reformatting may change the cluster size and make writes less efficient. The SD Association provides freely downloadable SD Formatter software to overcome these problems for Windows and Mac OS X.<ref name=sdfmt>[https://www.sdcard.org/downloads/formatter/ SD Formatter 3.1 for SD/SDHC/SDXC] {{Webarchive|url=https://web.archive.org/web/20210207122439/https://www.sdcard.org/downloads/formatter/ |date=2021-02-07 }}, SD Association</ref> SD/SDHC/SDXC memory cards have a "Protected Area" on the card for the SD standard's security function. Neither standard formatters nor the SD Association formatter will erase it. The SD Association suggests that devices or software which use the SD security function may format it.<ref name=sdfmt/>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)