Author Topic: Flaky CF card  (Read 6862 times)

0 Members and 1 Guest are viewing this topic.

Offline kfitch42

  • Frequent Contributor
  • **
  • Posts: 300
  • Country: us
Flaky CF card
« on: April 03, 2015, 04:08:31 am »
In many ways this is a bit off-topic, but hopefully not too much...

I recently took my Kiddos to Disney. We brought along our old DSLR, which uses CF cards. I bought a new 16GB card for the trip so I wouldn't have to empty the camera each night. Anyway, halfway through epcot the camera stops working and reports "ERR CF". After we got home I tried other CF cards in the camera, and they work just fine. i.e. I think the camera is working.

When I plug the card into a USB CF card reader it doesn't get detected properly. If I use my linux box I see that it normally reports (along with tons of error messages) "[sdd] 2177891984 512-byte logical blocks: (1.11 TB/1.01 TiB)".  With enough reinserting, pluging, unplugging, replugging... I will occasionally see it detected as 16GB (with 30408336 512 byte sectors). When this happens I can't mount the filesystem, but I can dump (via dd) the raw device. I have gotten 3 of these dumps so far. The fun part is that they are each different from each other. After a bit of python-foo I discovered that they only differences are in the high bit of odd numbered bytes. Looking at the CF card spec I see that among the 50 pins it has D0-D15. So I suspect that D15 is flaky.

I cracked open my cf card and cf card reader and buzzed all 50 pins, and to my limited abilities they all seem fine. Of course if it is a bad solder joint, then the pressure of the multimeter probe might be enough to make the connection.

Note that the number of sectors in 'bad' mode is 2177891984=0x81cffe90 and when it sort-of works we have 30408336=0x1cffe90. Again it looks like a high bit got set (possibly D15 ?)

The odd part is that we almost always get the bad bit in the size, but the bad bits in the data are much more rare. we seem to get a bunch then none for a few megs, then a bunch more....

Also, if I open the dumps in a hex editor I can find things that look like JPG images, including things like the camera model name in the EXIF data (occasionally with every other character garbled).

QUESTIONS/THOUGHTS:

1) The CF spec says that the cards can operate in an 8-bit mode, where D8-D15 are unused. That sounds like it might work (albeit slowly), but how can I do that? Are there magic Linux commands to do this? Is there a particularly flexible card reader out-there that can do this? I guess I could use an Arduino (or other dev-kit) to do it by hand... but that sound EXCRUCIATINGLY slow... puling 16GB via an Arduino might take a lifetime or three :)

2) The CF card has what appears to be a BGA controller chip ( PHISON PS3016-P9-R ). Should I try to borrow a hot-air station and try to reflow it, and the connector?

3) There are four flash chips on the CF card. I guess the extreme solution would be to desolder them and get a flash chip reader. Of course reassembling the filesystem from what is on the four chips might not be trivial, depending on how fancy that controller is.
« Last Edit: April 03, 2015, 04:29:17 am by kfitch42 »
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 6698
Re: Flaky CF card
« Reply #1 on: April 03, 2015, 04:42:30 am »
I wouldn't try to reflow the controller but perhaps gentle pressure could help. Make sure the connector's pin is making contact, of course.
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 2472
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline kfitch42

  • Frequent Contributor
  • **
  • Posts: 300
  • Country: us
Re: Flaky CF card
« Reply #3 on: April 03, 2015, 01:35:24 pm »
I wouldn't try to reflow the controller but perhaps gentle pressure could help. Make sure the connector's pin is making contact, of course.

To the best of my abilities putting pressure on the controller chip doesn't seem to help. AFAICT the pins are making contact. I am pondering taking a dremel to the plastic shroud to get access to the actual connection so I can try to make it (at least pin 31, aka D15) a little tighter.
 

Offline kfitch42

  • Frequent Contributor
  • **
  • Posts: 300
  • Country: us
Re: Flaky CF card
« Reply #4 on: April 03, 2015, 01:58:09 pm »
sleemanj,

Oh, great, now I just need to find an IBM XT. :)

I might try to build up one of those adapters and try to drive it from my raspberry pi. I was just hoping I could find a shortcut around having to write code to drive the 8-bit interface.  Although I might be able to shortcut some of the work (in particular getting/soldering the SMT CF connector) with something like this:

http://www.monoprice.com/Category?c_id=104&cp_id=10407&cs_id=1040705
 

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 361
  • Country: ru
Re: Flaky CF card
« Reply #5 on: April 04, 2015, 08:32:35 am »
You can try cracking your cardreader's case too and soldering a wire bridge directly from CF's PCB to reader's PCB on D15.

Reading the chips will be almost useless - the data is scrambled (neighbour cells disturb prevention pattern). But moving the chips into same model working CF should work.
 

Offline Orange

  • Frequent Contributor
  • **
  • Posts: 292
  • Country: nl
Re: Flaky CF card
« Reply #6 on: April 04, 2015, 11:13:59 am »
Is the CF card a Kingston, as in the picture below ?

http://chyvack.livejournal.com/32439.html

Just curious which brand to avoid
 

Offline McBryce

  • Super Contributor
  • ***
  • Posts: 1544
  • Country: de
Re: Flaky CF card
« Reply #7 on: April 09, 2015, 01:50:11 pm »
I'd try reading it with ZAR (Zero Assumption Recovery) first. It may be just corrupted data. The Freeware version should be enough to get the files back off it.

McBryce.
 

Offline Grapsus

  • Regular Contributor
  • *
  • Posts: 240
  • Country: fr
Re: Flaky CF card
« Reply #8 on: April 09, 2015, 03:22:59 pm »
Try gently flexing the PCB in different directions or maybe freezing the BGA chip with an air duster upside down. You can make a simple shell script that waits for the device to be recognized with the right size (use blockdev --getsize64) and images the block device (use dd). In that way you could use your both hands to make the CF card work and as soon as it makes contact, the computer would grab the data.
 

Offline McBryce

  • Super Contributor
  • ***
  • Posts: 1544
  • Country: de
Re: Flaky CF card
« Reply #9 on: April 09, 2015, 07:43:16 pm »
There's no reason to believe it's definitely a hardware problem just yet. I'd avoid flexing a PCB with a BGA chip on it until I'm sure that the hardware really is faulty. You might just create a new problem.

McBryce.
 

Online wraper

  • Supporter
  • ****
  • Posts: 11071
  • Country: lv
Re: Flaky CF card
« Reply #10 on: April 09, 2015, 07:52:52 pm »
Do you have any other CF card of such size? It could be that your camera and card reader just do not support it properly. And IMO reflowing wont make any change except destroying it.
 

Online mikerj

  • Super Contributor
  • ***
  • Posts: 2331
  • Country: gb
Re: Flaky CF card
« Reply #11 on: April 09, 2015, 08:49:07 pm »
In the top picture, is the solder bridge between connector pins 15 and 16 (counting from the left) supposed to be there?
 

Offline McBryce

  • Super Contributor
  • ***
  • Posts: 1544
  • Country: de
Re: Flaky CF card
« Reply #12 on: April 09, 2015, 09:12:16 pm »
I don't think that's a solder bridge, it's just a spec of dirt or plastic from the casing.

McBryce.
 

Offline kfitch42

  • Frequent Contributor
  • **
  • Posts: 300
  • Country: us
Re: Flaky CF card
« Reply #13 on: April 11, 2015, 02:01:04 am »
Yes, it was a Kingston card.

The apparent solder bridge was just a speck of dust.

I ordered a couple of CF to IDE adapters, and plugged the card directly into the motherboard. The BIOS would at least partially recognize the card (printing out the model number during boot), but the OS (linux) wouldn't recognize it at all. It didn't/wouldn't create the /dev entry.  A working card in the adapter worked just fine. I wrote a quick/dirty program to read the card using old-school port I/O, just like in the old DOS days (ports 0x1F0-0x1F7 and 0x3F6) . I turned off interrupts and put the card in 8-bit mode. At which point I could read the entire card just fine. It wasn't fast, and it chewed the CPU, but several hours later I had a disk image that I could extract JPGs from (using a program called photorec), I probably could have mounted the disk image, but never tried.

So in the end it all worked out. But, I also built up about half of the adapter to connect the CF card to the GPIO pins on my Raspberry Pi. I have to say I love the movement from parallel buses to serial buses. 40-pin IDE, 50 pin CF... they make my wiring look like a spaghetti dinner :)
 

Offline Grapsus

  • Regular Contributor
  • *
  • Posts: 240
  • Country: fr
Re: Flaky CF card
« Reply #14 on: April 11, 2015, 02:14:10 am »
Wow, you have all my respect ! Congrats on getting your data back. Luckily the bad line was a one that's not required in 8 bit mode.

I'd be interested in the code if you can post it. The linux IDE drivers support various PIO modes, you can set it for a particular drive with "hdparm -p". I wonder if you can read your card in that way.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 6698
Re: Flaky CF card
« Reply #15 on: April 11, 2015, 01:34:49 pm »
I have to say I love the movement from parallel buses to serial buses. 40-pin IDE, 50 pin CF... they make my wiring look like a spaghetti dinner :)
But at least parallel buses are usually lower frequency and easier to interface to (provided you have enough I/O)... you wouldn't be able to connect SATA without a bridge IC. No minimum clock rate for IDE also helps.
 

Offline kfitch42

  • Frequent Contributor
  • **
  • Posts: 300
  • Country: us
Re: Flaky CF card
« Reply #16 on: April 14, 2015, 03:43:12 pm »
Wow, you have all my respect ! Congrats on getting your data back. Luckily the bad line was a one that's not required in 8 bit mode.

I'd be interested in the code if you can post it. The linux IDE drivers support various PIO modes, you can set it for a particular drive with "hdparm -p". I wonder if you can read your card in that way.

Maybe I am not smart enough, but I couldn't find a way to tell hdparm to tell the linux IDE drivers to use 8-bit transfers.

I attached the code. It is seriously quick/dirty/hacky.
 

Offline kfitch42

  • Frequent Contributor
  • **
  • Posts: 300
  • Country: us
Re: Flaky CF card
« Reply #17 on: April 14, 2015, 03:44:38 pm »
But at least parallel buses are usually lower frequency and easier to interface to (provided you have enough I/O)... you wouldn't be able to connect SATA without a bridge IC. No minimum clock rate for IDE also helps.

Yes, you are quite right. I was just ranting/grumbling :)
 

Offline Grapsus

  • Regular Contributor
  • *
  • Posts: 240
  • Country: fr
Re: Flaky CF card
« Reply #18 on: April 15, 2015, 10:26:22 am »
I attached the code. It is seriously quick/dirty/hacky.

Hey,

Thanks for the code, I don't find it dirty, it's straight to the point. What is the output of your program for your card ? In particular the PIO field. I'll try reading a CF card with your program and then with the linux driver after some hdparm tweaking. Just out of interest, since you already got your data back.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf