> So here's the thing. I've read that I can
have a seperate interface descriptor > for my composite USB device or use the LUNs bit of
the spec to represent both > devices on one interface.
LUN approach is definitely better.
The mass storage class implementation is roughly divided into four
layers as follows.
1) Standard request/ bulk endpoint handling
2) MSC BOT (Mass Storage Class Bulk-Only Transfer) handling
3) SCSI command handling
4) Serial FLASH / SD handling
When you apply a separate interface for the another storage, you
should modify whole stack of these layers to support it. But for the
LUN approach, most of modification is applied just to the SCSI command
handling.
> I've been scratching around for examples of
> a dual composite MSD without success...
As you have a successful MSD implementation for the serial FLASH, it's
not so much difficult to add another LUN support to it. In your
implementation, the serial FLASH is already handled as LUN=0. Then,
add LUN=1 for the SD.
LUN is specified by the bCBWLUN field of the CBW.
- GetMaxLUN request - return 1 instead of 0
- CBW validity check - allow bCBWLUN == 0 and 1
- SCSI commands - When LUN equals to 1, apply the command to SD.
--- In l..., medwar19@... wrote: >
> Hi All,
>
> I've coded up a dual FAT file system using the Philips LPC2148, serial flash and SD card. >
> I basically use a file system on the serial flash for a data logger and then transfer the files to the SD card when I'm done. I've
got a
USB mass storage interface to the Serial flash and thought it would be
useful to have the SD card show up as a second drive. >
> So here's the thing. I've read that I can have a seperate
interface descriptor for my composite USB device or use the LUNs bit of the spec
to represent both devices on one interface. >
> Any suggestions on what works best? I've been scratching around for examples of a dual composite MSD without success... >
> Cheers,
>
> Mark.
>
Reply by medw...@hotmail.com●March 18, 20072007-03-18
Hi All,
I've coded up a dual FAT file system using the Philips LPC2148, serial
flash and SD card.
I basically use a file system on the serial flash for a data logger and then
transfer the files to the SD card when I'm done. I've got a USB mass
storage interface to the Serial flash and thought it would be useful to have the
SD card show up as a second drive.
So here's the thing. I've read that I can have a seperate interface
descriptor for my composite USB device or use the LUNs bit of the spec to
represent both devices on one interface.
Any suggestions on what works best? I've been scratching around for
examples of a dual composite MSD without success...