3 ms·
I'm having trouble making my software ignore it. What command would write to the card when it has the write lock set?
by Aachen 4y ago
I'm having trouble making my software ignore it. What command would write to the card when it has the write lock set?
- smolder 4y agoPerhaps it's not within the capabilities provided by the OS or the driver, because they're "well behaved", but the position of the switch is in essence a boolean sent to the host device and not a barrier to electrical signals that would write data.
- addaon 4y agoIf you're on top of an OS, I can't say (depends on the OS)... but reading the switch is the responsibility of the reader, not the card. The card has no idea if it's write-protected (by the switch mechanism) or not. [1] Just using the same SPI operations you always use for write should work fine. There's not even a lock-status register or anything to check/clear first for the switch mechanism. https://superuser.com/questions/354473/is-the-lock-mechanism-on-an-sd-card-hardware-firmware-or-software-driver-os https://superuser.com/questions/354473/is-the-lock-mechanism...
- prmoustache 4y agoOn linux you can use hdparm to switch the readonly boolean. On other OS I don't know but there is surely a way.
- Aachen 4y agoInteresting, I'll try that next time, thanks!