The previous thread is now marked read only, so I'm posting the workaround here. Add one line to the init driver: /*-----------------------------------------------------------------------------
* Initialize the Flash File System
*----------------------------------------------------------------------------*/
void initFS (void) {
U32 retv;
retv = finit(NULL);
while ((retv = finit (NULL)) != 0) { /* Wait until the FS is ready */
if (retv == 1) {
bugOut ("\nSD/MMC Init Failed");
bugOut ("\nInsert Memory card and press key...\n");
while (getkey () == 0);
}
else {
bugOut ("\nSD/MMC Card is Unformatted");
strcpy (&in_line[0], "AEGIS\r\n");
cmdFormat (&in_line[0]);
now it works 100%
Yes. But the loop would loop until it gets happy even without the preceding call.
So the first line should not be needed, unless the first call sometimes returns zero despite actually failing. So is the first call returning zero (OK) even when failing?
The loop returns that it failed, and then tells the user to put in the SD card and try again. The SD card is already in, and is fine, so it should not have failed and not alerted the customer to a problem that doesn't exist. That's a guaranteed customer service call. The problem is discerning when the finit call is just fubar or when the card really isn't in and the customer does need to be notified. There are other solutions, I just found this one to be the simplest.