FAT32/SDHC library for Wave and other shields
Re: FAT32/SDHC library for Wave and other shields
Re: FAT32/SDHC library for Wave and other shields
Re: FAT32/SDHC library for Wave and other shields
Re: FAT32/SDHC library for Wave and other shields
Re: FAT32/SDHC library for Wave and other shields
Re: FAT32/SDHC library for Wave and other shields
SanDisk Ultra II 8GB
init time: 40
OEM name: SD
Product: SD08G
Version: 8.0
Serial Number: 1015562096
Manufacture Date: 12/2008
Size: 15954944
Read 20000 blocks
Read Time mills: 22602
Success
SanDisk Ultra II 4GB
init time: 101
OEM name: SD
Product: SD04G
Version: 8.0
Serial Number: 1908630400
Manufacture Date: 12/2008
Size: 7959552
Read 20000 blocks
Read Time mills: 22582
Success
Transcend class 6 8GB
init time: 164
OEM name: SV
Product: SDC
Version: 1.0
Serial Number: 3372482560
Manufacture Date: 12/2007
Size: 15758336
Read 20000 blocks
Read Time mills: 21475
Success
SanDisk SDHC standard 4GB
init time: 164
OEM name: SD
Product: SD04G
Version: 8.0
Serial Number: 2933412448
Manufacture Date: 12/2008
Size: 7744512
Read 20000 blocks
Read Time mills: 22440
Success
Trancend Class 6 4GB
init time: 141
OEM name: SV
Product: SDC
Version: 1.0
Serial Number: 2377089089
Manufacture Date: 10/2008
Size: 7811072
Read 10293 blocks
Read Time mills: 13560
lbn: 4014270
error: Read Failure
errorCode: 10
errorData: 0
Kingston SD6/4GB
init time: 184
OEM name: 42
Product: SD4GB
Version: 2.0
Serial Number: 3493658715
Manufacture Date: 12/2008
Size: 7839744
Read 9683 blocks
Read Time mills: 11196
lbn: 3786053
error: Read Failure
errorCode: 10
errorData: FC
A Data 4GB calss6
init time: 118
OEM name: AD
Product: SD
Version: 0.0
Serial Number: 3473184768
Manufacture Date: 1/2008
Size: 7897088
Read 10157 blocks
Read Time mills: 16187
lbn: 4001858
error: Read Failure
errorCode: 10
errorData: FF
SanDisk Ultra II 8GB
init time: 116
OEM name: SD
Product: SD08G
Version: 8.0
Serial Number: 1015562096
Manufacture Date: 12/2008
Size: 15954944
Read 20000 blocks
Read Time mills: 22601
Success
SanDisk Ultra II 4GB
init time: 100
OEM name: SD
Product: SD04G
Version: 8.0
Serial Number: 1908630400
Manufacture Date: 12/2008
Size: 7959552
Read 20000 blocks
Read Time mills: 22584
Success
Transcend class 6 8GB
init time: 164
OEM name: SV
Product: SDC
Version: 1.0
Serial Number: 3372482560
Manufacture Date: 12/2007
Size: 15758336
Read 20000 blocks
Read Time mills: 21471
Success
SanDisk SDHC standard 4GB
init time: 164
OEM name: SD
Product: SD04G
Version: 8.0
Serial Number: 2933412448
Manufacture Date: 12/2008
Size: 7744512
Read 20000 blocks
Read Time mills: 22441
Success
Trancend Class 6 4GB
init time: 141
OEM name: SV
Product: SDC
Version: 1.0
Serial Number: 2377089089
Manufacture Date: 10/2008
Size: 7811072
Read 20000 blocks
Read Time mills: 26739
Success
Kingston SD6/4GB
init time: 182
OEM name: 42
Product: SD4GB
Version: 2.0
Serial Number: 3493658715
Manufacture Date: 12/2008
Size: 7839744
Read 20000 blocks
Read Time mills: 23101
Success
A Data 4GB calss6
init time: 117
OEM name: AD
Product: SD
Version: 0.0
Serial Number: 3473184768
Manufacture Date: 1/2008
Size: 7897088
Read 10157 blocks
Read Time mills: 16188
lbn: 4001858
error: Read Failure
errorCode: 10
errorData: FF
Re: FAT32/SDHC library for Wave and other shields
Re: FAT32/SDHC library for Wave and other shields
// this sketch wiil do a read stress test on a SD card.
// set SD_CARD_SIZE_SUPPORT to 1 in SdCard.h
// delete all .o files in the WaveHC library to force a rebuild.
#include <avr/pgmspace.h>
#include "SdCard.h"
#include "WaveUtil.h"
SdCard card;
uint8_t cidDmp(void)
{
cid_t cid;
if (!card.readCID(cid)) {
putstring("readCID failed");
sdError();
return 0;
}
putstring("\nManufacturer ID: ");
Serial.println(cid.mid, HEX);
putstring("OEM ID: ");
Serial.print(cid.oid[0]);
Serial.println(cid.oid[1]);
putstring("Product: ");
for (uint8_t i = 0; i < 5; i++)Serial.print(cid.pnm[i]);
putstring("\nVersion: ");
Serial.print(cid.prv_n, DEC);
Serial.print('.');
Serial.println(cid.prv_m, DEC);
putstring("Serial number: ");
Serial.println(cid.psn);
putstring("Manufacturing date: ");
Serial.print(cid.mdt_month);
Serial.print('/');
Serial.println(2000 + cid.mdt_year_low + (cid.mdt_year_high <<4));
Serial.println();
return 1;
}
void sdError(void)
{
putstring_nl("SD error");
putstring("errorCode: ");Serial.println(card.errorCode(), HEX);
putstring("errorData: ");Serial.println(card.errorData(), HEX);
return;
}
void setup(void)
{
Serial.begin(9600);
}
void loop(void)
{
putstring_nl("\ntype any character to start");
while (!Serial.available());
Serial.flush();
uint32_t t0 = millis();
uint8_t r = card.init(0);
uint32_t d = millis()- t0;
if (!r) {
putstring_nl("\ncard.init failed");
sdError();
return;
}
putstring("\ninit time: ");Serial.println(d);
putstring("\nCard type: ");
switch(card.type()) {
case SD_CARD_TYPE_SD1:
putstring_nl("SD1");
break;
case SD_CARD_TYPE_SD2:
putstring_nl("SD2");
break;
case SD_CARD_TYPE_SDHC:
putstring_nl("SDHC");
break;
default:
putstring_nl("Unknown");
}
if(!cidDmp()) return;
uint32_t size = card.cardSize();
if (size == 0) {
putstring("cardSize failed");
sdError();
return;
}
putstring("card size: ");
Serial.print(size);
putstring(" (512 byte blocks)\n");
uint16_t nTest = 20000;
uint16_t nRead = 0;
uint8_t buf[2];
d = size/nTest;
uint32_t b;
uint32_t m0 = millis();
for (nRead = 0; nRead < nTest; nRead++){
b = nRead*d;
if (!(r = card.readData(b, 510, buf, 2))) break;
if (nRead == 0 && (buf[0] != 0X55 || buf[1] != 0XAA)) {
putstring("Invalid block zero signature: ");
Serial.print(buf[0], HEX);
Serial.print(',');
Serial.println(buf[1], HEX);
}
}
uint32_t m1 = millis();
putstring("\nRead ");
Serial.print(nRead);putstring_nl(" blocks");
putstring("mills: ");Serial.println(m1 - m0);
if(r) {
putstring_nl("\nDone");
}
else {
putstring_nl("\nRead Failure");
putstring("lbn: ");Serial.println(b);
sdError();
}
}
Re: FAT32/SDHC library for Wave and other shields
Re: FAT32/SDHC library for Wave and other shields
Re: FAT32/SDHC library for Wave and other shields
Re: FAT32/SDHC library for Wave and other shields
Re: FAT32/SDHC library for Wave and other shields
Re: FAT32/SDHC library for Wave and other shields