EFFS-STD fails
Posted: 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;
}
}
}