This N°9 Posted December 23, 2008 Report Posted December 23, 2008 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 rangeat 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 applicationmaybe 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#msg97787Of 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). Quote
stryd_one Posted December 23, 2008 Report Posted December 23, 2008 Sweet, thanks man! These test apps come in real handy ;) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.