nxpUSBlib MassStorageDevice support FAT32 ?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

nxpUSBlib MassStorageDevice support FAT32 ?

1,108 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by honphylin on Sun Oct 14 19:23:42 MST 2012
Dear NXP:

     In our example, DEVICE mass storage only support FAT12. In fact, in many applicatons, we need to use FAT32, for example, the NANDFlash or SD/MMC card through USB Device, is mounted on the a PC.

     I would like to our nxpUSBlib, when support for USB Device Mass Storage FAT32?

标签 (1)
0 项奖励
6 回复数

841 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by javos on Mon Oct 22 04:54:59 MST 2012
What tepytec says is right. You only need to give read/write commands through USB, the PC will give you the file system when formating.

Now if you need to read/write file from your device, then you need a File system library like FatFs.

anyway, be care that nxpUSBlib (v0.97) is not supporting Mass Storage Class for external Flash like SD, or any other. Please see http://www.lpcware.com/content/forum/mass-storage-device-msd-external-spi-flash-sst25vf064c-ussing-l.... Only for RAM like in example.

Hope it help!!!

Regards!
0 项奖励

841 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by honphylin on Sun Oct 21 19:59:48 MST 2012
Thanks for you replay.

Have anybody, throught USB, mount SD-card to PC, and use FAT32 interface. In the NXP example, only achieved FAT12, below:

void InitializeFAT12(DISKIMAGE *DiskImagePtr)
{
int i;

SetFAT12Entry(DiskImagePtr, 1, 0xfff);
for(i = 0; i < ((DiskImagePtr->BootSector.BPB_TotSec16 - StartDataRegion / BytesPerSector) / DiskImagePtr->BootSector.BPB_SecPerClus); i++)
{
if (!i)
DiskImagePtr->DirectoryEntries[1].startCluster = 2;// Startcluster is always 2 as defined by FAT12
else
{
SetFAT12Entry(DiskImagePtr, i + 1, i + 2);// 2 represents the  startcluster (which is fixed by definition)
SetFAT12Entry(DiskImagePtr, i + 2, 0xfff);
}
DiskImagePtr->DirectoryEntries[1].fileSize += BYTESPERCLUSTER;
}
InitializeDiskDiskImage(DiskImagePtr);
}

void InitializeFAT16(DISKIMAGE *DiskImagePtr)
{
}

void InitializeFAT32(DISKIMAGE *DiskImagePtr)
{
}

Another, fact, i also need a NAND FTL layer, use for manage NANDFlash.
0 项奖励

841 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tepytec on Tue Oct 16 22:55:50 MST 2012
I think I misunderstood your description the first time; So you want to read SD-card through USB connection on PC?

In that case I think that you do not even need file system. Just map USB bulk read/write to SD-card read/write commands, and PC handles the file system. (Can somebody confirm this?)

But if you want to also read SD-card files inside the device, then you need a file system, but that has nothing to do with the nxpUSBlib. If you do this, SD-card must not be accessed by the USB and the device FAT library at the same time, or file system might get corrupted.
0 项奖励

841 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by honphylin on Mon Oct 15 07:35:21 MST 2012
Tks. I can quickly support Fatfs in my board, however, the combination of USB devce and NAND,SD/MMC,Fatfs, I need some time. If these are integrated together by NXP, will save me a lot of time to do the application.
0 项奖励

841 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tepytec on Sun Oct 14 23:21:29 MST 2012
You probably have to write FAT32 support yourself, or use existing library, such as FatFs ( http://elm-chan.org/fsw/ff/00index_e.html ).
0 项奖励

841 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by honphylin on Sun Oct 14 19:26:31 MST 2012
I would like to ask, our nxpUSBlib, when support for USB Device Mass Storage FAT32?
0 项奖励