Jump to content

Recommended Posts

Posted

hello all,

based on the SD-card module written by TK, I wrote an application that does some tests on the connected sd-card:

1. find the first writeable sector (the cards I tested this is always 0x00)

2. find the last writeable sector. this depends on how much sectors your card uses for internal stuff.

3. deep check the sectors (write/read/compare) inside the R/W range

at the end of the test, you will know:

- if your sd-card works, how much sectors failed the r/w/c test

- which range you can use to store data with your application

maybe this information could be fetched from the card directly, I think there should be some info-record somewhere on the card, that tells you about the type/size of the card. if someone knows about that, please tell me..

I tested the app with a Pretec 256MB card and a SanDisk 1GB. Both works fine.

For the deep check, you can re-define "check_step". To check every sector is possible, but takes a very long time (ca. 2 hours for 256MB card). I set "check-step" by default to 0xF2.

I noticed that sometimes after a read/write error, the card refuses to communicate further on. After every read/write error, I re-init the card (SDCard_Init()).

The application can be found in the repository: "trunk/apps/troubleshooting/sdcc_sdcard_check". More info in the README.txt.

on the hardware-side, I used the schematic introduced here:

http://www.midibox.org/forum/index.php/topic,11484.msg97787.html#msg97787

Of course it's better to use a voltage-regulator instead of two diodes, but as I couldn't buy one so far, I also used the two diodes. I also tried three, but as  the voltage drop is not absolutely constant, it will drop too much when the card is consuming power. Two is just right, I used two fast switching SI types (the small ones in the glass tubes).

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...