Page 1 of 1

Error in f_format(): F_ERR_ONDRIVE

Posted: Thu Mar 15, 2012 9:50 am
by seulater
I just tried the EFFS-HTTP-VAR example on my Mod-Dev-70 kit Rev1.4, using a MOD5270 module.

I had to comment out the Write protect as it kept telling me "SD/MMC Card is write-protected..."
which its not, verified with 3 other cards.

Now, it does work fine for the most part, serves up the web page from SD card just fine.
however when i press "F" for format the card in the menu it then asks me am i sure press "Y" when i do that i get this response back.

Proceed with format? ('Y' to execute)y
Formatting SD/MMC card

*** Error in f_format(): F_ERR_ONDRIVE
Format complete


Now the code section for that is this:

Code: Select all

/*-------------------------------------------------------------------
BYTE FormatSD()
 -------------------------------------------------------------------*/
BYTE FormatExtFlash( long FATtype )
{
   int rv;
   iprintf( "Formatting %s card\r\n\r\n", driveType );
   rv = f_format( EXT_FLASH_DRV_NUM, FATtype );
   if ( rv != F_NO_ERROR )
   {
      iprintf( "*** Error in f_format(): " );
      DisplayEffsErrorCode( rv );
   }
   return rv;
}

Anyone know what the deal is here with this error ?

It says error, and then it says Format Complete, yet the card is not formatted.

Re: Error in f_format(): F_ERR_ONDRIVE

Posted: Thu Mar 15, 2012 11:06 am
by rnixon
Looks pretty easy - example app is not checking return code after calling FormatExtFlash()

case 'F':
{
iprintf("Proceed with format? ('Y' to execute)");
char c = getchar();
if ( (c == 'y') || (c == 'Y') )
{
iprintf("\r\n");
FormatExtFlash();
iprintf("Format complete\r\n");
}

To fix this you prob. need to do at least few things: Check the return code in the calling function and don't execute iprintf for complete if return code != F_NO_ERROR. The error descriptions are in the effs fat manual, this one looks like its a non-recoverable one, whatever that means.

Re: Error in f_format(): F_ERR_ONDRIVE

Posted: Thu Mar 15, 2012 11:09 am
by seulater
Thanks, i have already done that, its code 17.
But i was more looking for why don't the example run as is.