4 ms·
The write-protect switch on SD cards is not a physical break of a write line. It's merely a signal to the host saying not to write. A malicious or badly writt
by joezydeco 9y ago
The write-protect switch on SD cards is not a physical break of a write line. It's merely a signal to the host saying not to write. A malicious or badly written driver can disobey it.
- mschuster91 9y agoNot only this - microSD cards don't even have a WP switch any more, and on full-size SDs the thing is more unreliable than worth the trouble...
- zaroth 9y agoI would have guessed a signal to the local microprocessor to stop any writes as well. Oh well. So would the solution be for the host, or some SD adapter, to provide a super-cap to ensure smooth shutdown of the SD unit as a whole?
- joezydeco 9y agoA supercap is indeed one way go to, but it's useless without a decent brownout detection circuit that doesn't freak out every time you lose an AC halfwave (happens more than you think).
- mschuster91 9y agoHmm. A supercap combined with a diode on 5V and a line to a GPIO from Vcc to provide enough time for the OS to shut down... like this (RPi GPIO) <-----------(resistor to 3v3)-| (RPi microUSB in) <-------------(diode <-)------+---- Vcc | Supercap (RPi GND) ----------------------------------- GND When the supercap is huge enough (or, for what its worth, use a powerbank with passthrough capability!), this should work - when the GPIO goes low, the system can initiate a safe shutdown, and especially it can signal a "shutdown" signal to the microSD.
- duskwuff 9y agoNot only that -- the part on the SD card isn't even a switch. It's a plastic nub that will (hopefully) activate a leaf switch inside the SD card socket.