2
\$\begingroup\$

When enabling the write lock on the side of an SD card, is the write protection a physical limit on the SD card, or a flag sent to the reader or OS telling it to please not write?

\$\endgroup\$
  • \$\begingroup\$ I had a card reader that simply ignored the presence of that lock. I learned that the hard way, since I inadvertently formatted an SD card that I was sure was protected. Fortunately I had backed the whole stuff up, so no big damage, but "scaring" nonetheless :-) So I suppose it is just up to the reader whether to respect that lock or not. \$\endgroup\$ – Lorenzo Donati supports Monica Jul 2 '14 at 20:47
2
\$\begingroup\$

Citing from Wikipedia (emphasis mine):

Write-protect notch

The user can designate most full-size SD cards as read-only by use of a sliding tab that covers a notch in the card. (The miniSD and microSD formats do not support a write protection notch.)

[...]

The presence of a notch, and the presence and position of a tab, have no effect on the SD card's operation. A host device that supports write protection should refuse to write to an SD card that is designated read-only in this way. Some host devices do not support write protection, which is an optional feature of the SD specification. Drivers and devices that do obey a read-only indication may give the user a way to override it.

Cards sold with content which must not be altered are permanently marked read-only by having a notch and no sliding tab.

Moreover, the SD card simplified specifications (physical layer) read:

4.3.6 Write Protect Management

Three write protect methods are supported in the SD Memory Card as follows:

  • Mechanical write protect switch (Host responsibility only)
  • Card internal write protect (Card's responsibility)
  • Password protection card lock operation.

• Mechanical Write Protect Switch

A mechanical sliding tablet on the side of the card (refer to the Part 1 Standard Size SD Card Mechanical Addendum) will be used by the user to indicate that a given card is write protected or not. If the sliding tablet is positioned in such a way that the window is open it means that the card is write protected. If the window is close the card is not write-protected. A proper, matched, switch on the socket side will indicate to the host that the card is write-protected or not. It is the responsibility of the host to protect the card. The position of the write protect switch is unknown to the internal circuitry of the card.

\$\endgroup\$
  • \$\begingroup\$ Just like it used to be with floppies. Cover the hole - write is allowed. Open the hole (remove the tape from floppies back when they used to be floppy) and you can't write. Same with VHS casettes, audio tapes - back to the dawn of time itself. Open hole = write protect, closed hole = write allowed. And always the responsibility of the host hardware (floppy drive, VHS recorder, etc) to honour that. \$\endgroup\$ – Majenko Jul 2 '14 at 22:30
  • \$\begingroup\$ @Majenko Yep! With the added problem that apparently the host is not required to honor that. Save from hardware failures or modified hardware, I've never seen floppy drives, VHS recorders or the like not honoring the write protection indication. \$\endgroup\$ – Lorenzo Donati supports Monica Jul 3 '14 at 9:55
1
\$\begingroup\$

The sliding plastic part activates a switch in the SD card socket when the card is inserted. The OS will read the switch's state.

It would be possible to create a card without the dent so it is always writeable, or without the sliding part so the card is always read only; similarly cut or bridge the switch's output to force all cards inserted into the socket to be either writeable or read-only.

\$\endgroup\$
1
\$\begingroup\$

It's a switch in the slot that is no longer depressed, whose status can be detected from the WP pin that not all breakout boards provide access to. It is up to the card controller to detect it and signal up the chain appropriately.

\$\endgroup\$

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.