Re: SPI communication protocol for micro-sd



On May 28, 10:54 pm, Mark Borgerson <mborger...@xxxxxxxxxxx> wrote:
In article <3132d35e-4763-430f-95f0-
809623d02...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, zwsdot...@xxxxxxxxx says...> On May 28, 12:44 pm, Mark Borgerson <mborger...@xxxxxxxxxxx> wrote:

of 512 bytes to the SD can vary quite a bit---especially when
the card has to erase a new block of internal flash.  If you're

Depending on how the filesystem works, the worst case (non-application-
optimized FS) is when ALL of the following need to happen in order to
write the next byte:

1) need to find next free cluster and it is not contiguous with
current cluster
2) need to update FAT chain for the file
3) need to erase the block containing the new cluster

I'm writing my file system to avoid #1 and #2.   I think I can
handle #3 with about 32K of buffer space.

In earlier tests, #1 turned out to be a real killer---especially
near the end of an SD where the FAT may be a megabyte or
more.  The problem doesn't have reasonable bounds if your're
looking for that one free cluster in the middle of
a 2G disk filled with other files.

Mark Borgerson

Sorry, my recent post went composed as a reply to the wrong
message, my mistake. Here it is again, quoting the message
I initially intended to quote.

----
This demonstrates the fundamental weakness of the FAT system.
While it was nearly perfect for a floppy disk of 1.44M (FAT12),
when it comes to gigabytes a FAT32 is just too large.
A filesystem which uses a bit per cluster for allocation purposes
is 32 times more efficient (at least on some processors, those
which have a "count leading 0s" opcode). For MS compatibility
purposes the remote system can be shown a FAT image, built
based on the more efficient internal filesystem image (this is
how I have been doing DPS <-> FAT for > 10 years).

Dimiter

------------------------------------------------------
Dimiter Popoff Transgalactic Instruments

http://www.tgi-sci.com
------------------------------------------------------
http://www.flickr.com/photos/didi_tgi/sets/72157600228621276/
.



Relevant Pages

  • Re: Embedded RTOS - features poll
    ... If the FAT ... lowest freed cluster from the last file delete. ... all the clusters on a 32GB SDHC card. ... That's about 32768 512-byte sectors. ...
    (comp.arch.embedded)
  • Re: Portable CP/M
    ... FAT at the level of access to a specific image file is less demanding ... its primarily being able to map a single FAT file as CP/M sectors. ... M-86 and pcDos. ... Directory cluster, and numbers clusters starting with the first ...
    (comp.os.cpm)
  • Re: Embedded RTOS - features poll
    ... If the FAT ... lowest freed cluster from the last file delete. ... all the clusters on a 32GB SDHC card. ... That's about 32768 512-byte sectors. ...
    (comp.arch.embedded)
  • Re: Embedded RTOS - features poll
    ... allocate the next open cluster. ... beginning of the FAT table. ... The next attempt to allocate a cluster will see the next ... all the clusters on a 32GB SDHC card. ...
    (comp.arch.embedded)
  • Re: FAT32 or NTFS?
    ... >>of a hugely bloated FAT and large cluster sizes, ... resilience --- As far as FAT partitions go, don't forget to wave goodbye to ... technologies imbedded in the file system ensure that data is only written on ... Which brings me to this - In an NTFS file ...
    (microsoft.public.windowsxp.general)