Page 1 of 1

EFFS-STD fails

Posted: Wed Jun 27, 2018 10:49 am
by SeeCwriter
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;
    }
  }
}

Re: EFFS-STD fails

Posted: Fri Jun 29, 2018 3:11 pm
by TomNB
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.

Re: EFFS-STD fails

Posted: Fri Jun 29, 2018 3:30 pm
by TomNB
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.

Re: EFFS-STD fails

Posted: Fri Jun 29, 2018 3:48 pm
by SeeCwriter
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.

Re: EFFS-STD fails

Posted: Sat Jun 30, 2018 9:32 am
by TomNB
Have you had a chance to copy the StdfFile.a lib file from a previous release?