All Forums
 Hardware
 General Hardware, ADSmartIO, Digital I/O and A/Ds
 FX Flash speed
 Forum Locked
 Printer Friendly
Author Topic  

gokan

20 Posts

Posted - 24 Sep 2004 :  10:01:29  Show Profile
I am using the FX Flash on a bity x to store some parameters for my application. The file is 72 bytes in length. I am using the following code to write it.

CFile myFile(_T("\\FlashFX Disk\\Screen2.per"),CFile::modeCreate | CFile::modeWrite);
// Write a string, without using null-terminator.
myFile.Write(screen2Array, Screen2Parameters * NumberOfCopies * CharsPerLong);

// We can call Close() explicitly, but the destructor would have
// also closed the file for us. Note that there is no need to
// call the CloseHandle() on the handle returned by the API because
// MFC closes it automatically.
myFile.Close();

The application takes about 1 second to write the file. Can I speed this up? I would like it to be less than 100 milli seconds.

opsens_claude_belleville

34 Posts

Posted - 21 Apr 2005 :  11:11:38  Show Profile
I have similar problem here

I saw big delay with following commands

CreateFile("\\Flash FX\\File.txt") : 40ms to 1.5s delay, it depends
WriteFile(little amount of data) : 50ms to 1.5s delay, it depends
CloseHandle : 11ms to 1.5s delay, it depends

So I have an average of 300ms per file saving (if i try it 100 times)


I try it with th Compact Flash PCMCIA card and it is alot faster... ?


Thanks



Edited by - opsens_claude_belleville on 21 Apr 2005 11:16:24
Go to Top of Page

akidder

1519 Posts

Posted - 21 Apr 2005 :  12:15:32  Show Profile
The FlashFX driver creates a file system that provides load leveling of flash memory. The features come at a price, which is the "garbage collection" that erases blocks of flash memory and moves data into them. We have a white paper on flash disk performance posted at topic 398 that describes the variables involved. CompactFlash memory cards usually get around the delays by buffering the writes in RAM.

There are a couple of ways you might improve performance:
- make sure you're using the latest CE build for your product
- create a separate thread that handles flash operations
- perform manual garbage collection at "off" times (we'll have to look into this if you need it)

If flash disk performance is an issue for your application, contact us with details and we'll be glad to work with you.
Go to Top of Page
  Topic  
 Forum Locked
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000