Sunday, June 25th 2017, 9:08am UTC+2

You are not logged in.

  • Login
  • Register

leonarff

Beginner

Date of registration: Oct 2nd 2013

Posts: 6

1

Thursday, July 2nd 2015, 9:22pm

emFile and NOR Flash problem

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

Date of registration: Apr 8th 2015

Posts: 8

Location: Darmstadt, Germany

Occupation: Software Developer

2

Friday, July 3rd 2015, 2:16pm

Hi Leonardo,

Are you using emFile v 4.00?
In this case, you should read chapter "15.1 Differences from version 3.x to 4.x" in UM02001_emFile.pdf.

... or (what it boils down to) try adding

Source code

1
	FS_NOR_SPI_SetHWType(0, &FS_NOR_HW_ST_M25_Default);

just after FS_NOR_SetPhyType(0, &FS_NOR_PHY_CFI_1x16);

just a guess
Stefan

leonarff

Beginner

Date of registration: Oct 2nd 2013

Posts: 6

3

Tuesday, July 7th 2015, 3:23pm

Stefan,

Thank you for your help.
Since I am evaluating emFile I think that there is no v4.0 compilation for Keil and LPC1788.
I used FS_NOR_PHY_CFI_1x16 physical layer because my NOR is parallel and no SPI.
I solved the problem by re-writing the physical layer.
Thank you again for your help.
Best regards.


Leonardo.

Similar threads