AnsweredAssumed Answered

STM32F4 composite USB device

Question asked by fjullien on Aug 6, 2014
Latest reply on Aug 6, 2014 by fjullien
Hi,

I'd like to implement a composite USB device with MSC + a custom class. I'm using a STM32428I-EVAL board and some code generated by STMCube.

MSC alone is working (with bulk endpoint 0x82 and 0x02). When I add a new interface (a custom class, with one bulk IN endpoint 0x81 as Interface 0), my MSC (as Interface 1) doesn't receive anymore datas on its endpoints.

However, if I put my MSC as Interface 0 and my custom class as Interface 1, the MSC works and the custom class doesn't.

WORKING:
---------------
 
Device Descriptor:
bcdUSB:             0x0200
bDeviceClass:         0x00
bDeviceSubClass:      0x00
bDeviceProtocol:      0x00
bMaxPacketSize0:      0x40 (64)
idVendor:           0x0483 (STMicroelectronics)
idProduct:          0x572A
bcdDevice:          0x0200
iManufacturer:        0x01
0x0409: "STMicroelectronics"
iProduct:             0x02
0x0409: "STM32 Mass Storage"
iSerialNumber:        0x03
0x0409: "00000000001A"
bNumConfigurations:   0x01
 
ConnectionStatus: DeviceConnected
Current Config Value: 0x01
Device Bus Speed:     Full
Device Address:       0x05
Open Pipes:              2
 
Endpoint Descriptor:
bEndpointAddress:     0x82  IN
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00
 
Endpoint Descriptor:
bEndpointAddress:     0x02  OUT
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00
 
Configuration Descriptor:
wTotalLength:       0x0030
bNumInterfaces:       0x02
bConfigurationValue:  0x01
iConfiguration:       0x04
0x0409: "MSC Config"
bmAttributes:         0xC0 (Bus Powered Self Powered )
MaxPower:             0x32 (100 Ma)
 
Interface Descriptor:
bInterfaceNumber:     0x00
bAlternateSetting:    0x00
bNumEndpoints:        0x02
bInterfaceClass:      0x08
bInterfaceSubClass:   0x06
bInterfaceProtocol:   0x50
iInterface:           0x05
0x0409: "MSC Interface"
0x0409: "MSC Interface"
 
Endpoint Descriptor:
bEndpointAddress:     0x82  IN
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00
 
Endpoint Descriptor:
bEndpointAddress:     0x02  OUT
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00
 
Interface Descriptor:
bInterfaceNumber:     0x01
bAlternateSetting:    0x00
bNumEndpoints:        0x01
bInterfaceClass:      0x00
bInterfaceSubClass:   0x00
bInterfaceProtocol:   0x00
iInterface:           0x05
0x0409: "MSC Interface"
0x0409: "MSC Interface"
 
Endpoint Descriptor:
bEndpointAddress:     0x81  IN
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00
 
 
NOT WORKING:
--------------
 
Device Descriptor:
bcdUSB:             0x0200
bDeviceClass:         0x00
bDeviceSubClass:      0x00
bDeviceProtocol:      0x00
bMaxPacketSize0:      0x40 (64)
idVendor:           0x0483 (STMicroelectronics)
idProduct:          0x572A
bcdDevice:          0x0200
iManufacturer:        0x01
0x0409: "STMicroelectronics"
iProduct:             0x02
0x0409: "STM32 Mass Storage"
iSerialNumber:        0x03
0x0409: "00000000001A"
bNumConfigurations:   0x01
 
ConnectionStatus: DeviceConnected
Current Config Value: 0x01
Device Bus Speed:     Full
Device Address:       0x05
Open Pipes:              1
 
Endpoint Descriptor:
bEndpointAddress:     0x81  IN
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00
 
Configuration Descriptor:
wTotalLength:       0x0030
bNumInterfaces:       0x02
bConfigurationValue:  0x01
iConfiguration:       0x04
0x0409: "MSC Config"
bmAttributes:         0xC0 (Bus Powered Self Powered )
MaxPower:             0x32 (100 Ma)
 
Interface Descriptor:
bInterfaceNumber:     0x00
bAlternateSetting:    0x00
bNumEndpoints:        0x01
bInterfaceClass:      0x00
bInterfaceSubClass:   0x00
bInterfaceProtocol:   0x00
iInterface:           0x05
0x0409: "MSC Interface"
0x0409: "MSC Interface"
 
Endpoint Descriptor:
bEndpointAddress:     0x81  IN
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00
 
Interface Descriptor:
bInterfaceNumber:     0x01
bAlternateSetting:    0x00
bNumEndpoints:        0x02
bInterfaceClass:      0x08
bInterfaceSubClass:   0x06
bInterfaceProtocol:   0x50
iInterface:           0x05
0x0409: "MSC Interface"
0x0409: "MSC Interface"
 
Endpoint Descriptor:
bEndpointAddress:     0x82  IN
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00
 
Endpoint Descriptor:
bEndpointAddress:     0x02  OUT
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00

Any idea ? Anyone can point me to an existing composite USB device example based on the ST HAL ?

Thanks in advance,

Franck.

Outcomes