FAT32使用总结,基于Sanddisk 32GB microSD

capacity=0x732480000,
SDMMC_BLOCK_SIZE=0x200

nFats=0x2,
secPerClust=0x20,
totalSec=0x398d66d,
nBlocks=0x398d66d
fatStartSec=nReservedSecs;
dataStartSec=0x8000,
nReservedSecs=0xcf4,
nHiddenSecs=0x2000

secPerFat=14726,
secPerClust=32,
totalSec=60348013,
dataStartSec=32768,
nBlocks=60348013,
blockSize=512,
nFats=2,
nFatEnts=1884853,
secSizeShift=9,
dataStartSec = nReservedSecs +(secPerFat *nFats);
nFatEnts = (((totalSec - dataStartSec) /secPerClust) + DOS_MIN_CLUST);
还是?
nFatEnts=secPerFat*blockSize/32

phycal sectorNo.=fatSecNo.+nHiddenSecs;

groupAllocStart = dosfsDiskToHost32 (&fsinfoBuf[4]);

dosFatDesc.rawEntryRead = fat32RawEntRead;
dosFatDesc.rawEntryWrite = fat32RawEntWrite;
dosFatDesc.fatEntryRead = fat32EntRead;
dosFatDesc.fatEntryWrite = fat32EntWrite;
dosFatDesc.cleanBitMask = 0x08000000;
dos_fat_reserv = 0x0ffffff0;
dos_fat_bad = 0x0ffffff7;
dos_fat_eof = 0x0fffffff;

你可能感兴趣的:(FAT32使用总结,基于Sanddisk 32GB microSD)