sdlocker goes ATtiny85



Karl Lunt’s original sdlocker was built around Atmel’s ATmega328 microcontroller (MCU). Recently, a new variant (or fork) of the project was launched by Nephiel, who decided to power the latest iteration of the locker with Atmel’s ATtiny85 MCU.

“I routinely use USB drives loaded with software tools and benchmarks to diagnose and fix computers. I wanted a way to protect those drives from viruses, malware, filesystem corruption and accidental erase,” Nephiel wrote in a blog post describing the project.

“USB drives with a write-protect switch do exist, but are hard to find and expensive. Full-sized SD cards have a slider tab to write-protect them, but it actually does nothing – it’s up to the card reader to report it to the OS and it’s up to the OS to decide whether to comply and mount the card read-only or not. Most of them simply ignore it, so SD cards may be overwritten regardless of the write-protect tab.”

However, sdlocker allows users to truly write-protect any SD card by toggling the TMP_WRITE_PROTECT bit on the flash memory controller of the card itself.

“Together with a USB card reader, this write-protected card can then be used as a read-only USB drive,” Nephiel continued. “This is my own fork of the original sdlocker, tailored to suit my needs – smaller, simpler and USB-powered.”

Aside from swapping the ATmega328 for the ATtiny85, Nephiel removed all the UART code and unused functions, while rewriting the user interface (1 button, 1 LED). 

The write protection of an inserted card is toggled by holding the button down over half a second. Meanwhile, the LED is tasked with displaying the state of the inserted card at all times, including steady off (card is unlocked, writable), steady on (card is locked, write protected), blinking fast (device is reading the card) and blinking slow (card is faulty, or not inserted properly).

Interested in learning more about Nephiel’s ATtiny85-powered sdlocker? You can check out the project’s official page here.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s