[En-Nut-Discussion] NutRegisterDevice().....

Harald Kipp harald.kipp at egnite.de
Thu Apr 10 14:56:22 CEST 2008


Rob,

Thanks for posting your results and sorry for not having been able to 
respond earlier.

PragmaLab wrote:

> Talking about SD/MMC cards (FAT16/FAT32), did somebody use the phat-file
> system when dealing with large amounts of files (>200)?

Using a FAT file system with a large number of entries in a single 
directory is also a big problem for all computers. However, modern PCs 
with Gigs of memory and Gigahertz crystal clocks do not really suffer.

> Mounting a 1 GB FAT32 card takes ages in our application, just
> because the PhatCountFreeClusters() routine needs to check 243345 clusters

I agree, mounting is also a big problem.

> The most obvious
> optimisation would be to cache the FAT32-table and only update the sectors
> that were modified (during the flush). But that would take away way too much
> RAM.

IMHO, it is acceptable to have this as a configurable option for systems 
which do have enough RAM.

> Since dealing with large capacity SD-cards is not unusual anymore, I suppose
> we have to look for optimisations in the existing filesystem.

The biggest advantage I had so far was optimizing the lowest level SPI 
transfer routines. But that was a bit banging routine for a CPU without 
SPI hardware. Possibly not much can be done for CPUs using SPI hardware.

> By the way, SD-HC cards use the SD specifications 2.0. I'm having to
> re-design the mmcard.c for that as well. Only SD-HC cards have a capacity >2
> GB

Not sure about this, but there may be patent problems when using SD Card 
mode instead of MMC/SPI.
http://en.wikipedia.org/wiki/Sd_card

> Any suggestions for optimisations?

Not right now. But I agree, that something needs to be done. When 
starting with this, I was surprised that no BSD compatible code was 
available. Later I regret my decision to do it myself, as it turned out 
to be much more complicated than I expected. Since then I'm near to a 
heart attack each time someone reports a possible bug. ;-)

Seriously, several people (and companies) are using PHAT with success, 
at least with one or two workarounds. So it's really time to optimize 
and clean up the code.

Regards,

Harald


P.S.: Inline quoting is more common in mailing lists (and Usenet) for 
several reasons:
1. It's easier for readers to follow discussion
2. The articles are much shorter




More information about the En-Nut-Discussion mailing list