Re: Throughput question with CF/DiskOnChip

From: Michael Schnell (mschnell_at_bschnell_dot_de_at_aol.com)
Date: 01/02/05

  • Next message: Michael Schnell: "Re: Throughput question with CF/DiskOnChip"
    Date: Sun, 02 Jan 2005 15:19:00 +0100
    
    

    > Hmmm...I have not read about this. Of course I can understand the
    > possibility of losing a portion of a file that is in the process of
    > being flushed to disk if the CF is removed with the write in progress
    > (and this is an acceptable constraint for this particular application).
    > However, I don't understand how the CF card could be damaged and made
    > unusable if it is removed at the wrong time. My PDA has a CF card, and
    > it has no knowledge of when I would remove the CF card...but I can
    > remove the card whenever I want. How does it solve this problem?
    >

    This has been discussed several times in this forum. Please see the
    back-log. To handle wear out effects, a CF internally monitors write and
    erase times and replaces dying blocks with fresh (spare) ones. To do
    this is uses some blocks as reference table. If such a table is changed
    (which can happen within any a normal write request), part of it is
    erased and then rewritten. When power goes down in that moment the table
    is damaged and the CF is unusable as it can't find the internal memory
    block associated to an external address range. It can't even be
    formatted with normal means. There will be special propriety IDE
    commands that allow to revive the CF by rewriting the address allocation
    table to a standard default allocation (loosing all data).

    >
    >
    > The ext2 files system on top of the DiskOnChip appears to be a fairly
    > common activity:
    >
    > http://www.rtd.com/NEW_appnote/SWM-640000017%20rev%20A.pdf
    > http://www.gctglobal.com/Download/DiskOnChip/diskonchip.html
    > http://www.denx.de/twiki/bin/view/DULG/DiskOnChip
    >
    > Why exactly do you discourage this activity?
    >
    >

    I was speaking about a DOC with no hardware intelligence (like that of a
    CF) but that is a quite naked flash chip.

    EXP2 and all "normal" file systems rewrite some blocks of the "disk"
    (e.g. the FAT with a DOS file system, more complex structures with e.g.
    EXP2). Writing a single byte in a Flash causes a complete block (size
    depending on hardware 128 Byte ... 128 K) to be erased and rewritten. A
    flash block can only be rewritten a certain number of times (depending
    on hardware 10.000 ... 1.000.000 times). When using the chip for some
    kind of log file, this number can be reached quite fast. A dedicated
    flash file system knows about the flash blocks and (re)uses them
    cyclicly to manage this "wear out" effect. Moreover it will
    automatically remove blocks that get unwritable in spite of the rotation
    scheme.

    >
    > The DOC has a considerable on-board intelligence.

    If so, you are in bad luck, as now the same applies as with the CF. With
    a "dumb" DOC you can use a Flash file system, while with a CF-Card type
    of device this does not help, as only the manufacturer knows about the
    block size and handling.

    >
    > IIRC, JFFS2 was in the works for supporting the DOC, but at the time
    > the system was being developed it was not ready yet.

    JFFS2 is ready since ages, but of course you need a media access driver
    for the device in question, too. If that is available now and specified
    for JFFS usage, this seems the way to go.

    > we haven't seen the
    > device fail (unless, of course, the "blip" we are seeing is due to the
    > number of bad blocks increasing, and thus the DOC driver/hardware
    > taking longer and longer to find valid flash blocks to write to).
    >

    I don't think so. (There should be a way to read the count of bad blocks
    from the media access driver.) I suppose the "blip" is just a cache
    write-back, that EXT2 does. This is not a good thing, either, as a large
    cache will make you loose a lot of data when power fails and the file
    system is not dismounted before. Here a journaling file system could
    help a lot, but same creates even more write accesses and increases the
    wear out problem.

    -Michael


  • Next message: Michael Schnell: "Re: Throughput question with CF/DiskOnChip"

    Relevant Pages

    • Re: FlashROM as a disk in CE 5.0
      ... FileSystem Starting - starting with clean file system ... Lower flash. ... 0x83fc8994: FLASHDRV.DLL:Unable to initialize FLASH Media Driver. ... I have added the Registry settings to Project.reg file like ...
      (microsoft.public.windowsce.platbuilder)
    • Re: STRATA flash driver - Not able to persist data
      ... Are you saying that you store data in the flash drive and after rebooting ... I have implemented the file system thro' stratad.dll. ... 0x83fc88a4: FS: Registering file system ROM, index 2, flags 0x00000031 ... doesn't exist for logical sector 0x3c!!! ...
      (microsoft.public.windowsce.platbuilder)
    • Re: need help trying to integrate IPSM
      ... As I mentioned, I left the first 59MB out of PSM, leaving the ... What I'm doing now in the catalog is checking ROM-only File System instead ... exclude the area of the flash that is ...
      (microsoft.public.windowsce.platbuilder)
    • Re: Persistent Registry on Onboard Flash
      ... Copy the folder to you platform to build it. ... > Our Onboard Flash is Intel TE28F128. ... > for Persistent Registry purpose.If Yes, ... >> You need to have a flash file system. ...
      (microsoft.public.windowsce.platbuilder)
    • Re: Atmel flash memory issue, maybe?
      ... But is rewriting without erasing so bad that it will destroy the entire ... I am using Atmel flash AT49BV322DT in a custom dsp board i am building. ... When I send the sequence of erase commands to the flash, ...
      (comp.arch.embedded)