0
\$\begingroup\$

I am familiar enough with eMMC features as there is a great deal of documentation about them. I understand that SD cards have permanent write protection, temporary write protection, and even password-based protection, but these seem to require special equipment to use (strikes me as somewhat stupid for OEMs not to implement this since they use the same exact contacts). eMMCs—and MMCs, as far as I know—support the ability to make certain regions write-protected, so something like a bootloader can be safe against accidental corruption. Do SD cards have this same or similar functionality? If they do, does this include power-on write protection, wherein a lock, when set, will last for as long as power is provided to the card?

\$\endgroup\$
  • 1
    \$\begingroup\$ I understand SD cards have soft write protection, by requesting your operating system to honor the write protection. There are USB sticks with a hardware write protection switch, allowing data to be safe when locked. I have one for a live operating system to maximum safety on the web. \$\endgroup\$ – Optionparty Dec 21 '16 at 4:00
3
\$\begingroup\$

SD cards have co-operative hardware write protection, which is a switch on the side of the card sensed by the OS driver.

The SD cards also support:

  1. Permanent write protection, PERM_WRITE_PROTECT
  2. Temporary write protection, TMP_WRITE_PROTECT first
  3. Write protect group size, WP_GRP_SIZE (set aside strings of sectors/blocks that are write protected)

All of these settings are in the CSD register which is read by the OS driver using CMD's when your media is first mounted.

You can read all about the registers here. The specification applies to all media up to, but not including UHS cards.

The driver supports a serial CMD structure for the SD cards, and the password protection is included here. You have to read the physical layer specification to understand how to read and write to the card.

\$\endgroup\$
  • \$\begingroup\$ The specification says it is ignored for the HC variety, but it says nothing of the XC kind. Why is group-sized write protection not used in the HC cards? Does it include power-on write protection? \$\endgroup\$ – Melab Dec 23 '16 at 22:59
  • \$\begingroup\$ @Melab SDXC is generally very similar to SDHC, and I see no reason write protection would have been added back for XC. It was likely removed from the standard because it isn't useful for most users, and is likely to be confusing \$\endgroup\$ – duskwuff Dec 26 '16 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.