Reading a broken flash drive (damaged crystal)

What are you developing?
Post Reply
arpruss
Posts: 83
Joined: Sat Dec 21, 2019 10:06 pm

Reading a broken flash drive (damaged crystal)

Post by arpruss »

A couple of days ago, I came across a broken flash drive PCB in the grass with USB connector still intact (later tentatively identified as a Sandisk Cruzer 8gb). I made it a challenge for myself to see if I make get the flash drive usable.

I put the drive into a cheap Linux laptop (a converted Chromebook) where I was fairly confident that nothing bad would happen if there was malware on the drive. No go: nothing worked. Closer examination and comparison with PCB photos online (and some help from showed that the very helpful person who put up those photos) showed that the crystal was destroyed. The part number (T240) suggested a likely clock rate of 24 MHz. I only had 8 MHz crystals in my parts collection.

So, I ran this little bit of code (modified from a post on these forums) on a black pill (libmaple core) underclocked to 48 MHz, which produced a 24 MHz output (I hesitate to call it a square wave, because at this speed there is a lot of analog smoothing):

Code: Select all

HardwareTimer pwmtimer(3);

// 48mhz
void setup() {
  pinMode(PA6,PWM );
  pwmtimer.pause();
  pwmtimer.setPrescaleFactor(1);
  pwmtimer.setOverflow(2-1); // 48MHZ / 2 = 24MHz
  pwmtimer.setCompare(TIMER_CH1, 1);  // 50% duty cycle
  pwmtimer.refresh();
  pwmtimer.resume();
}
(If I used the default 72MHz on the micro, I could only get 33% or 67% duty cycle.)

I attached a 4.7K resistor to the A6 pin, plugged the black pill into the laptop, and while carefully hand-holding the free resistor lead to one of the flash drive oscillator pins, I pushed the flash drive into USB. I didn't bother with ground connections, counting on the fact that the laptop's USB circuitry connected the grounds of the flash drive and the black pill. (I know that this is probably not something one should do, but I have had good luck in the past when interfacing devices both of which were powered from the same computer and not bothering with ground connections.)

Amazingly, the LED came on, the flash drive was recognized, and eventually I was able to recover all the data from it, and contact the grateful owner.

Notes:

1. When I soldered the resistor to the flash drive oscillator pin, it wouldn't work. Maybe stray capacitance from my hand-holding helped.

2. It didn't matter which of the two oscillator pins I used. Ideally, I should probably have removed the oscillator circuit capacitors, but I didn't bother.
hobbya
Posts: 49
Joined: Thu Dec 19, 2019 3:27 pm
Answers: 1

Re: Reading a broken flash drive (damaged crystal)

Post by hobbya »

Interesting brain exercise. Thanks for sharing.
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: Reading a broken flash drive (damaged crystal)

Post by mrburnette »

I attached a 4.7K resistor to the A6 pin, plugged the black pill into the laptop, and while carefully hand-holding the free resistor lead to one of the flash drive oscillator pins, I pushed the flash drive into USB.
Oh, yeah! The sign on the path along the cliff says "Slippery when wet."
Post Reply

Return to “Projects”