Hi guys,
I'm trying to programm a USB composite device, MSC and CDC (virtual serial port). I started with the usb_dev_comp_ser_ser, figured this would be the easiest way. I copied the ramdisk.c and usbdmscglue.c files from the usb_dev_msc example and added the structs for the msc device in the usb_structs.c:
tMSCInstance g_sMSCInstance;
const tUSBDMSCDevice g_sMSCDevice =
{
USB_VID_STELLARIS,
USB_PID_MSC,
"TI ",
"Mass Storage ",
"1.00",
500,
USB_CONF_ATTR_SELF_PWR,
0,
0,
{
USBDMSCStorageOpen,
USBDMSCStorageClose,
USBDMSCStorageRead,
USBDMSCStorageWrite,
USBDMSCStorageNumBlocks
},
USBDMSCEventCallback,
&g_sMSCInstance
};
Basically just copied it from usb_dev_msc and removed the device descriptors. Then I added the device to the list in the composite device:
#define NUM_DEVICES 3
#define DESCRIPTOR_DATA_SIZE (COMPOSITE_DCDC_SIZE + COMPOSITE_DCDC_SIZE + COMPOSITE_DMSC_SIZE)
tCompositeEntry g_psCompDevices[NUM_DEVICES]=
{
{
&g_sCDCSerDeviceInfo,
0
},
{
&g_sCDCSerDeviceInfo,
0
},
{
&g_sMSCDeviceInfo,
0
}
};
And then in the main() rutene I added the initialisation:
g_psCompDevices[0].pvInstance = USBDCDCCompositeInit(0, (tUSBDCDCDevice *)&g_sCDCDevice1);
g_psCompDevices[1].pvInstance = USBDCDCCompositeInit(0, (tUSBDCDCDevice *)&g_sCDCDevice2);
g_psCompDevices[2].pvInstance = USBDMSCCompositeInit(0, (tUSBDMSCDevice *)&g_sMSCDevice);
USBDCompositeInit(0, &g_sCompDevice, DESCRIPTOR_DATA_SIZE, g_pucDescriptorData);
Well, I thought this would work, but it doesn't. The device doesn't enumerate and the board just freezes. The usb_dev_comp_ser_ser and usb_dev_msc work individually, but together something just hangs. Any idea what I'm doing wrong?
Thanks and best regards,
George