D’oh! Recovering files from an SD card

While developing the SD Card support for OpenPilot, I inadvertently managed to overwrite the first few hundred bytes on one of my 8GB Micro SD cards.

This caused Windows to give the “This disk needs formatting to be used” message, to my horror. This 8GB card was out of my phone and had around 6GB of photos and videos on it.

After a while of searching for ways to recover the files I found a few methods which had no avail. I even tried booting into a live linux distro (Debian of course) to try some linux tools.
Things were looking grim, at least until I found a mention of R-Studio.

After a few minutes of scanning and recovering I had 100% of all my photos and videos back and 90% of everything else. Thanks to R-Studio nothing that I didn’t have a copy of was lost. If you ever find yourself in a similar situation I highly recommend R-Studio for recovery, it works and works well.

Lesson learnt and I now only use blank SD cards for testing, rather than the ones I use on a daily basis for other purposes.

Using OpenOCD on 32bit and 64bit Windows

OpenOCD is an Open Source On-Chip debugger which acts as the software layer to control your JTAG interface.

For the OpenPilot project we needed a way of programming and debugging the STM32 microcontroller. The easiest way to do this was using OpenOCD with the Olimex “ARM-USB-TINY-H” JTAG device.

Without going into the details here, if your interested in using OpenOCD on Windows (either 32bit or 64bit) then check out the guides on the OpenPilot wiki that we have created. They are easy to follow and include pictures to help you through the process.

http://wiki.openpilot.org/OpenOCD_Compile_on_x86
http://wiki.openpilot.org/OpenOCD_Compile_on_x64

It’s quite hard to find this information or find information that is up-to-date, so hopefully this helps someone out.