GithubHelp home page GithubHelp logo

arduino_sd_recovery's Introduction

SD Card Recovery using an Arduino

One of my SD card "died". More specifically, my laptop wouldn't read it anymore, and neither would any other machines or cameras I tried. It did react (looking at the dmesg output), but would only though errors. So I decided to try and read it using an Arduino.

Background

Attention Dangerous half knowledge ahead

SD cards have two modes in which they can be accessed. One is the SDIO mode, which is used by your average card reader, your camera, etc. It's fast, and somewhat complicated. The other mode is SPI mode. It's much slower, but it's fairly simple. That's what you use if you connect your SD card to a microcontroller such as an arduino.

Hardware

I used a Playduino One Arduino clone, that I had lying around, and a SD card shield I got from ElectroDragon. Just plugged them together, and done is the card reader hardware.

Software

I took 3 steps in the recovery process.

CardInfo

The SD card library in the Arduino IDE contains an example called CardInfo. It connects to the card, and gets information such as size, filesystem type, and a list of files on the card.

That worked, so I kept going.

sd_recovery_files

The sketch sd_recovery_files.ino tries to iterate over the filesystem, and outputs all files in a HEX encoded format over the serial port. If you save the output to a file on your machine, you can then parse the file using the supplied python script parse_files.py.

This surprisingly worked for a number of files, but the openNextFile() doesn't seem to work all that well, so not all files were copied.

sd_recovery_raw

The sketch sd_recovery_raw.ino reads the SD card block by block, and outputs it in a HEX encoded format over the serial port. You can parse the output back into a binary file using the supplied parse_raw.py python script.

This may just take forever, and I have not been successful in using that file, but I have yet to actually copy the entire SD card that way (might take a few days for the 4GB card I have).

arduino_sd_recovery's People

Contributors

hrr avatar tiefpunkt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino_sd_recovery's Issues

sd_recovery_files.ino

The sdrecovery (sd_recovery_files.ino) was not even uploading on arduino IDE 1.8.0, only on 1.8.5 it uploads without errors.

When I upload the sd_recovery_files.ino to arduino, I open terminal and I get one line of text

"done!"

When I use cardinfo example I get all my files and folder listed.
What I'm doing wrong?

"Do I need to change the 10 to 4 here? In cardinfo example:
"(const int chipSelect = 4;)" Such like is missing from sd_recovery_files.ino

void setup()
{
Serial.begin(115200);
pinMode(10, OUTPUT);

SD.begin(10);

root = SD.open("/");
readDirectory(root, "");

Serial.println("done!");
}"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.