Solution for a Broken Raspberry Pi SD Card Reader


My Raspberry Pi 3 was installed in a case and an SD card was installed in the card reader slot. I attempted to remove the Raspberry Pi from the case, but I forgot to remove the card first. The pressure against the card was enough to pry the reader away from the board.

I tried soldering the reader back into place, but there was still a flakey connection somewhere. I was able to boot the system if I used a clothespin to squeeze the card reader and apply additional pressure, but that was an ugly solution.

Raspberry Pi with clothespin

Enabling external boot

An experimental feature on newer Raspberry Pi boards (documented here) allows for booting from USB devices. Only some USB devices work. A Raspbian version as of 2017-04-10 or later is required.

This is where the clothespin hack saved me, since you have to set up the USB boot mode before you can actually use it. Otherwise, you would need the foresight to do this in advance of breaking your card reader...

Enable boot mode by adding a line at the end of /boot/config.txt, then reboot.

echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt
sudo reboot

Verify that the mode has been set, by typing:

vcgencmd otp_dump | grep 17:

You should see this.

$ vcgencmd otp_dump | grep 17:

If so, the firmware has been modified successfully. Note this only needs to be done once. After the firmware has been modified, the line can be removed from /boot/config.txt.

Hardware results

Booting was successful from this aged card reader:

Lexar card reader

Booting was not successful from this no-name $1 USB micro SD card reader ordered from China via eBay:

Non-working card reader

Booting was successful from this $3.70 USB micro SD card reader, also ordered from China via eBay:

Working card reader

It makes for a relatively unobtrusive package when installed.

Installed card reader