Home  >  Support  >  Support Forum  >  Anyone experience frequent SD card failures with RCM4300?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Anyone experience frequent SD card failures with RCM4300?

0 votes
I have a program that is writing a data file every 10 minutes to an SDCard on the RCM4300. The data file is about 200kBytes in size and all read/writes are through FAT16 (i.e. FAT16.lib). These files are also connected to a http and ftp server (i.e. http.lib and ftp_server.lib). The code works great for about 18-24 hours before failing. When it fails I can no longer access the SD card, even with a system reboot. Only option I have it to reformat the whole card.

I've exhausted my troubleshooting and still can't understand or correct the issue. Here is a snippet of the writing code that is . Right before this code, I mount the SD Card. Right after this code, I un-mount it.


// Open (and maybe create) it...
rc = fat_Open(
first_part,
filename_plus,
FAT_FILE,
FAT_CREATE,
&my_file,
&prealloc
);

if (rc < 0) {
error_code = 20;
printf("Error writing Raw Data");
goto unmount_exit;
}

//Configure header details
strcpy(header,"Blah,Blah,Blah\r\n");

len = strlen(header);
bytes = len;
rc = 0;
writ = 0;

// Keep writing header string to file until 'bytes'
// characters have been written
while (writ < bytes) {
if (len < (bytes-writ))
ltw = (int)len;
else {
ltw = (int)(bytes-writ);
header[ltw-1] = '\n';
}
rc = fat_Write(&my_file, header, ltw);
if (rc > 0)
writ += rc;
if (rc < ltw)
break;
}


if (rc < 0)
printf("Error");

//Write 32000 comma delimited data points to file
for(t=0;t<32000;t++){

sprintf(obuf,"%06d\r\n",(int)processed_datay[t]);

len = strlen(obuf);
bytes = len;
rc = 0;
writ = 0;
// Keep writing string to file until 'bytes'
// characters have been written
while (writ < bytes) {
if (len < (bytes-writ))
ltw = (int)len;
else {
ltw = (int)(bytes-writ);
obuf[ltw-1] = '\n';
}
rc = fat_Write(&my_file, obuf, ltw);
if (rc > 0)
writ += rc;
if (rc < ltw)
break;
}

if (rc < 0)
printf("Error");

}

if (rc < 0) {
error_code = 20;
rc = fat_Close(&my_file);
unmount_exit;
}

// Done writing; close it.
rc = fat_Close(&my_file);

asked Aug 4 in Rabbit by dduncanearl New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
Is it possible you reached the max of the memory card? I haven't heard of this issue with other customers
answered Aug 8 by MargaretK Veteran of the Digi Community (487 points)
Contact a Digi expert and get started today! CONTACT US
...