USB Mass Storage Device

Hello,

I'm starting now a project where I have to build a little file system on a Serial Flash. Mainly, the stored files are to be transmitted to a Control Unit through any proprietary wireless link and I have not any special requirements to this file system. But it is required to allow also USB access to this storage,i.e. PC to be connected to my MCU via USB and my MCU is to be connected to Ser. Flash via SPI. We want to do nothing on PC side, therefore I want my unit to be a Mass Storage Class. In order to allow PC to explore my Serial Flash storage must I organize my files in FAT16/32 ? If it is not must,nevertheless may be it would be better to use FAT instead of proprietary file system ? My Ser. Flash size is 8Mbit. Assume that max. number of files is 100, and max. number of folders is 10. Actually, I found a very similar to my needs application, where the difference is that instead of Ser. Flash it has NAND Flash. I didn't find there any FAT implementation, but I can explore in PC its content ! And I don't know how does it work !

Thanks in advance, E.L.

Reply to
ira litvak
Loading thread data ...

Hi.

The mass storage driver works at a lower level than the file system. The commands which go back and forth over USB are SCSI commands involved in accessing blocks.

So you can choose whatever file system type is supported by whatever OS you are running on your PC and also by the OS in your embedded device.

Regards, Steve

Reply to
steve_schefter

You should be able to open the raw device (assuming it looks like a mass storage device) on most OS's, and then treat it as an array of

512 byte blocks. If this device does *not* look like the usual array of sectors, you'll need to at least do some hardware drivers. You could also write a file system driver on the PC if you used a proprietary format of some sort, but that's a big undertaking.

But if you can drop FAT* on the device, you have the advantage that pretty much *anything* will be able to access the device. That's why, for example, essentially all cameras write FAT formatted flash devices.

What concerns me is the serial flash device itself. Most serial flash devices (and I'm not really an expert here), tend *not* to look like sector oriented disk drives, how are you going to attach this to the PC? Or is this going to be in the device, and software on the device will perform the mapping as needed?

*For 2MB, it'll be FAT12 - you just don't have enough space to make the smallest valid FAT32 volume (which cannot be smaller than 65526 clusters), and you almost certainly can't do FAT16, since that requires 4086 clusters at a minimum (even with one sector clusters, that would leave only about ten sectors for the boot sector, FAT(s) and root directory).
Reply to
robertwessel2

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.