EFFS-STD fails

Discussion to talk about software related topics only.
Post Reply
SeeCwriter
Posts: 311
Joined: Mon May 12, 2008 10:55 am

EFFS-STD fails

Post by SeeCwriter » Wed Jun 27, 2018 10:49 am

I'm using DHM Software's SNMP package with a Nano54415, and v2.8.6 of NNDK. SNMP requires a file system on the Nano's flash memory, so I used code from the EFFS-STD-HTTP example program to create the file system. This has worked for the last year. But now I'm getting errors trying to mount the drive. The initialization code for the file system is below. Function fs_mountdrive returns a 5, which I think means "driver error", and fs_format returns 1, which I think is "Invalid Drive". Since I'm not using fatfile.a, I don't think this is the same issue reported by another poster ("EFFS Not Working"). Not sure where to go with this.

Code: Select all

int InitFlashFileSystem()
{
  fs_init();   /* Initialize the file system */

  {
    long mem_size;
    char *mem_ptr = NULL;
    int rc;

    /*
     * Gets the needed memory for the file system.
     */
    mem_size = fs_getmem_flashdrive( fs_phy_OnChipFlash );

    if ( !mem_size )
    {
       iprintf( " Flash drive error: No Flash Memory! \r\n" );
       return -1;
    }

    mem_ptr = ( char * ) malloc( (size_t) mem_size );

    if ( !mem_ptr )
    {
      puts( " Memory Allocation error.\r\n" );
      return -1;
    }

    /*
     * Mount the file system.
     */
    BYTE retry = 1;
    do
      {
        rc = fs_mountdrive(NOR_DRV_NUM, mem_ptr, mem_size,
                            fs_mount_flashdrive, fs_phy_OnChipFlash );

        if ( rc )
        {
          iprintf( "Formatting (%d)...", rc );
          /*
           * If mount was not successful, then format the drive.
           */
          rc = fs_format( NOR_DRV_NUM );
          if ( rc )
          {
            iprintf( " Format Failed: %d.\r\n", rc );
            free(mem_ptr);
            return -1;
          }
        }
    } while ( rc && retry-- );

    if ( rc )
    {
      iprintf( " Flash drive mount Failed: %d.\r\n", rc );
      free(mem_ptr);
      return -1;
    }
  }
}

User avatar
TomNB
Posts: 217
Joined: Tue May 10, 2016 8:22 am

Re: EFFS-STD fails

Post by TomNB » Fri Jun 29, 2018 3:11 pm

Try copying your FatFile.a from your previous version to 2.8.6 (save the 2.8.6 file first), then rebuild your app and see if there is a difference.

User avatar
TomNB
Posts: 217
Joined: Tue May 10, 2016 8:22 am

Re: EFFS-STD fails

Post by TomNB » Fri Jun 29, 2018 3:30 pm

Sorry, that was bad information. Just saw you are using the standard file system, not the fat file system. The lib your want is StdfFile.a, not FatFile.a.

SeeCwriter
Posts: 311
Joined: Mon May 12, 2008 10:55 am

Re: EFFS-STD fails

Post by SeeCwriter » Fri Jun 29, 2018 3:48 pm

Correct, I'm only using StdfFile.a. An interesting data point, when the mounting fails, even though the program runs fine other than not being able to access the file system, I can no longer use Autoupdate to reprogram the Nano. Autoupdate hangs for a long time then times out. If I cancel the programming and run Autoupdate again the Nano crashes. So I have to use the serial port. As yet, I don't see the connection.

User avatar
TomNB
Posts: 217
Joined: Tue May 10, 2016 8:22 am

Re: EFFS-STD fails

Post by TomNB » Sat Jun 30, 2018 9:32 am

Have you had a chance to copy the StdfFile.a lib file from a previous release?

Post Reply