cancel
Showing results for 
Search instead for 
Did you mean: 

Switch between Mass Storage and Custom HID in Composite project

fiim
Associate III
Posted on July 22, 2013 at 09:36

Hellow! (stm32f37)�?�ow would you organize Switch between Mass Storage and Custom HID in Composite project? Where is the variable, changing which can be initialized either hid or mass storage or together?

2 REPLIES 2
dthedens23
Associate II
Posted on July 22, 2013 at 17:14

The USB Host (PC) enumerates the device. It does this by asking questions that the device must respond to. The configuration is constant so these answers are coded in structures in flash. This happens when the device is inserted.

Single Device can be a MS or

Single Device can be HID or

Composite Device can be both MS and HID by using more endpoints

Single Device cannot switch enumeration on the fly (without some special considerations)

there are examples of composite devices.

attached custom HID + CDC

________________

Attachments :

CDC_HID_Composit.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0db&d=%2Fa%2F0X0000000bc2%2FSelgCS.nW7ArpMI8nlxDyZ1GmUCeKbL73.sZHfM8Fjs&asPdf=false
fiim
Associate III
Posted on July 22, 2013 at 21:49

Thank you! So, if I want to switch between the 3 types, I should have in my program(flash) 3 patterns: Composite_DeviceDescriptor[], HID_DeviceDescriptor[] and MassStorage_DeviceDescriptor[]. Now I have to uninitialize (USB_deinit) the previous and re-initialize using a different descriptor. So?