I am trying to use emFile with SST39VF3201B microchip NOR flash.
The code is:
void FS_X_AddDevices(void) {
FS_AssignMemory(&_aMemBlock[0], sizeof(_aMemBlock));
// Add driver
FS_AddDevice(&FS_NOR_Driver);
// Set physical type, single CFI compliant NOR flash chips with 16 bit interface
FS_NOR_SetPhyType(0, &FS_NOR_PHY_CFI_1x16);
// Configure a single NOR flash interface (4 Mbytes)
FS_NOR_Configure(0, NOR_FLASH_BASE, NOR_FLASH_BASE, 0x00400000);
}
void MainTask(void)
{
FS_NOR_DISK_INFO DiskInfo;
NORFLASHInit();
FS_Init();
// Check if low-level format is required
if (FS_IsLLFormatted("") == 0)
{
printf("Volume is not low-level formatted. Low level formatting...\n");
FS_FormatLow("");
}
// Check if volume needs to be high level formatted.
if (FS_IsHLFormatted("") == 0)
{
printf("Volume is not high-level formatted. High level formatting...\n");
FS_Format("", NULL);
}
ShowDiskInfo(&DiskInfo);
while (1)
{
OS_Delay(100);
}
}
void ShowDiskInfo(FS_NOR_DISK_INFO* pDiskInfo)
{
char acBuffer[80];
FS_X_Log("Disk Info: \n");
FS_NOR_GetDiskInfo(0, pDiskInfo);
sprintf(acBuffer," Physical sectors: %d\n"
" Logical sectors : %d\n"
" Used sectors: %d\n", pDiskInfo->NumPhysSectors, pDiskInfo->NumLogSectors, pDiskInfo->NumUsedSectors);
FS_X_Log(acBuffer);
}
But the result is:
FS warning: NOR: Found multiple work sectors of identical size. Low level format invalid.
Volume is not low-level formatted. Low level formatting...
FS warning: NOR: Found multiple work sectors of identical size. Low level format invalid.
FS warning: NOR: Found multiple work sectors of identical size. Low level format invalid.
FS error: FS_LocatePartition: Invalid BytesPerSector value: 0.
FS error: FS_FAT_CheckBPB: Invalid BytesPerSector value: 0.
Volume is not high-level formatted. High level formatting...
FS warning: NOR: Found multiple work sectors of identical size. Low level format invalid.
FS error: FS_LocatePartition: Invalid BytesPerSector value: 0.
Disk Info:
Physical sectors: 1024
Logical sectors : 6442
Used sectors: 0
What is the problem ?
Can anyone help me ?
Best regards.
Leonardo F. Farah
The code is:
void FS_X_AddDevices(void) {
FS_AssignMemory(&_aMemBlock[0], sizeof(_aMemBlock));
// Add driver
FS_AddDevice(&FS_NOR_Driver);
// Set physical type, single CFI compliant NOR flash chips with 16 bit interface
FS_NOR_SetPhyType(0, &FS_NOR_PHY_CFI_1x16);
// Configure a single NOR flash interface (4 Mbytes)
FS_NOR_Configure(0, NOR_FLASH_BASE, NOR_FLASH_BASE, 0x00400000);
}
void MainTask(void)
{
FS_NOR_DISK_INFO DiskInfo;
NORFLASHInit();
FS_Init();
// Check if low-level format is required
if (FS_IsLLFormatted("") == 0)
{
printf("Volume is not low-level formatted. Low level formatting...\n");
FS_FormatLow("");
}
// Check if volume needs to be high level formatted.
if (FS_IsHLFormatted("") == 0)
{
printf("Volume is not high-level formatted. High level formatting...\n");
FS_Format("", NULL);
}
ShowDiskInfo(&DiskInfo);
while (1)
{
OS_Delay(100);
}
}
void ShowDiskInfo(FS_NOR_DISK_INFO* pDiskInfo)
{
char acBuffer[80];
FS_X_Log("Disk Info: \n");
FS_NOR_GetDiskInfo(0, pDiskInfo);
sprintf(acBuffer," Physical sectors: %d\n"
" Logical sectors : %d\n"
" Used sectors: %d\n", pDiskInfo->NumPhysSectors, pDiskInfo->NumLogSectors, pDiskInfo->NumUsedSectors);
FS_X_Log(acBuffer);
}
But the result is:
FS warning: NOR: Found multiple work sectors of identical size. Low level format invalid.
Volume is not low-level formatted. Low level formatting...
FS warning: NOR: Found multiple work sectors of identical size. Low level format invalid.
FS warning: NOR: Found multiple work sectors of identical size. Low level format invalid.
FS error: FS_LocatePartition: Invalid BytesPerSector value: 0.
FS error: FS_FAT_CheckBPB: Invalid BytesPerSector value: 0.
Volume is not high-level formatted. High level formatting...
FS warning: NOR: Found multiple work sectors of identical size. Low level format invalid.
FS error: FS_LocatePartition: Invalid BytesPerSector value: 0.
Disk Info:
Physical sectors: 1024
Logical sectors : 6442
Used sectors: 0
What is the problem ?
Can anyone help me ?
Best regards.
Leonardo F. Farah