Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Saving precious data

Status
Not open for further replies.

AtomSoft

Well-Known Member
I have a 8GB MicroSD which my phone and PC cant read anymore for some reason. Its asking me to format. So im taking my SD project to the next level. I have make a IMAGE function which will dump every sector into a file on my PC hopefully creating a full image of the card, then i plan to use some software to pry into that image and remove pictures and videos. would love some wishes of luck ! heh

Here is what i have so far and it seems to go through in a terminal so making a C# app now:

Code:
  if(strncmp("IMAG",RX_CMD,4) == 0)
  {
    UART_STR("ATOMIMAGE\n");
    for(x=0;x<(fs.max_clust-2);x++)
    {
      for(y=0;y<fs.csize;y++)
      {
        memset(IMAGEBUFF,0,512);
        disk_readp(IMAGEBUFF,((x*fs.csize)+y),0,512);
        UART_STR(IMAGEBUFF);
      }    
    }
    UART_STR("ATOMIMAGE\n");
    goto Done;
  }

UART_STR("ATOMIMAGE\n"); is used to signify the start and end of transmission
 
Last edited:
Wow just did some math and 8 gigabytes = 8 388 608 kilobytes. At 115200 im getting like 6KB a second ... maybe slightly more... but doing the math says it would take 16 days to clone this SD from Sector 0 to the END.. every single BYTE heh.. sucks.

8GB / 6KBs = 1398101 seconds
1398101 / 60 for minutes = 23302 minutes
23302 / 60 for hours = 388 hours
388 / 24 for days = 16 DAYS
16 / 7 for weeks = 2.29 Weeks heh

SUCKS! i need more speed
 
Last edited:
i should leave it copying for the whole time heh.. just to see how it ends. I have another ARM i can test it on also.. and more memory cards to test speeds. I guess i should look into USB transfers. But im sending 512 byte chunks using UART i think USB allows less like 64... i have to read into this more.
 
in fact i will make some code with C# to list directories and files from the SD card and simply allow me to select which i want to download and then have it copy the file to my PC... I think it would save me time since most of the stuff on SD is music its a waste for me. I already have it on my PC
 
Try cooling it down or warming it. I had an SD card that would sort of read, but would error and the camera suggested that it should be formatted.

I left the card in the freezer for 20 minutes and it then worked long enough to read all the data.

Then I formatted it.
 
Its from my phone, phone doesnt read it, PC wont read it. But i can read it on my ARM SD Code... so not sure what happening here. I can get directory listing and files and such its crazy... i made a cool app so far in C# but might move it to normal C... C# is giving me parity errors on some bytes and if i use a standalone terminal the data is fine...
 
You should be able to read sectors on your PC. See clicky.

Edit, that link isn't verty helpful actually. But googleing "read sector function SD" gets lots of hits.

Mike.
 
Last edited:
yeah i know about stuff like that but what i mean is it doesnt even ask me to format in windows. Its like its not there at all.

But on Cellular Phone it ask me to format. Im rewriting some code for C++ now on windows. Im new to this C++ thing but its my only hope since C# is acting stupid now...
So far in C++ i created a window and got a count of available com ports with there names. I can also connect to one. Next i need to learn to send data and receive
 
It's probably a simple thing like you trashed the FAT.

There are a ton of SD card freeware programs on the net to fix the SD card FAT and/or diagnose format etc and fix your card up, and even save image to hard disk etc.
 
Yeah, ill have to look into it. I also need to get a new card reader mines just broke heh... dont leave hammers around!!! i had it on my table it fell i went to pick it up , knocked over a hammer and smash!. It was already opened ... like had no case on it :(
 
In terms of electronics, I know the STM32 (an ARM MCU) has inbuilt USB, the maple board (an arduino but with a better mcu) uses it to save cost on the FT232. Perhaps you could upgrade to such a device.

On a more software based theme I had a similar problem with a portable hard drive the once, I managed to fix it using free fat table recovery utils under ubuntu (can't remember which one now but I think it was https://www.cgsecurity.org/wiki/TestDisk ). One thing I did do was use dd to completely image the drive (even with a trashed fat table) - so if the recovery process destroyed my data, I had a broken image to go back to :).
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top