cancel
Showing results for 
Search instead for 
Did you mean: 

UM0424: Composite example?

melchor
Associate II
Posted on February 11, 2013 at 18:48

The STM32 USB FS Device Development kit documentation describes a Composite Example, but I am not able to find this example in the supplied source examples. Is this really available and in this case could you point out where is available?

My aim is implementing MSC+CDC but the MSC+HID example would be great as a starting point.

Thanks

#f4 #composite-device-with-stm32f2 #composite-device-with-stm32f2-f4
8 REPLIES 8
melchor
Associate II
Posted on February 14, 2013 at 06:58

I found the new version of the USB FS library 4.0.0, which includes the composite MSC+HID example.

harasak
Associate II
Posted on February 26, 2013 at 00:39

Hi,

Can you post here the link to the library? I can't find it. Thanks
Posted on February 26, 2013 at 02:17

[DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Discovery/STM32F3DISCOVERY%20USB-Virtual%20Com%20Port&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&currentviews=804]https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2FSTM32Discovery%2FSTM32F3DISCOVERY%20USB-Virtual%20Com%20Port&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F¤tviews=804

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
harasak
Associate II
Posted on February 26, 2013 at 16:34

Thanks, Clive.

I am working with F4-discovery kit. I have done my HID and MSC applications separately and now I want to make a composite device from them. I used f4-discovery demo example for HID and lib STM32_USB-Host-Device_Lib_V2.1.0 for MSC. It seems that these examples are made for one class and it is impossible to use 2 interfaces (2 classes).

The problem is with the initialization of the USB with the callbacks for 2 classes. Does anyone has an experience with this? Thanks.

In the lib STM32_USB-FS-Device_Lib_V4.0.0 which you sent me, Clive, there is completely different solution for usb. Even for core level. It seems it is gonna be pretty tough to implement my projects into this one.
Posted on February 26, 2013 at 17:12

Yes, it's a different track for F1 and F3 designs. The F2/F4 use the OTG track.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
harasak
Associate II
Posted on February 26, 2013 at 17:28

Then, I can't use the lib STM32_USB-FS-Device_Lib_V4.0.0  ??

Is there any example of composite device for F2/F4 ? Or do you know the way how to manage with the callbacks for 2 classes using F2/F4?

Thanks Clive.
javi_esf
Associate
Posted on July 14, 2013 at 11:30

to make a composite device with STM32_USB-Host-Device_Lib_V2.1.0 for stm32f2 and stm32f4 and stm32f105,107 you must do this stages:

1-make your composite device describtore and pass it in GetConfigDescriptor class callback function

2-config your endpoints with DCD_EP_Open and DCD_EP_Close function in Init and DeInit class callback functions

3-use DCD_EP_Flush function for all new endpoints and make Out endpoits Prepare to recive data with DCD_EP_PrepareRx function in Init class callback function

4-config TXn_FIFO_FS_SIZE in usb_conf.h file

-note that for full speed device sum of RX_FIFO_FS_SIZE + TX0_FIFO_FS_SIZE + TX1_FIFO_FS_SIZE +TX2_FIFO_FS_SIZE can not be more than 320 so for example if you have 2 bidirectional

endpoints(1(in and out) and 2(in and out)) other than endpoint0 correct values for RX_FIFO_FS_SIZE,TX0_FIFO_FS_SIZE,TX1_FIFO_FS_SIZE,TX2_FIFO_FS_SIZE are:

#define RX_FIFO_FS_SIZE 128

#define TX0_FIFO_FS_SIZE 64 //max packet size for endpoint0

#define TX1_FIFO_FS_SIZE 64 //max packet size for endpoint1

#define TX2_FIFO_FS_SIZE 64 //max packet size for endpoint2

#define TX3_FIFO_FS_SIZE 0

5-use your DataOut class callback with epnum parameter to manage which endpoint event callback occure

Gawie
Associate II
Posted on November 05, 2013 at 11:33

Thanks dadkhah.javad! I followed your instructions and managed to get a composite sample to work on the STM32F4. I basically just combined the MSC and HID device examples into a composite device.

FWIW, see attached for the sample... as is...

Cheers,

Gawie

________________

Attachments :

Composite.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0Tv&d=%2Fa%2F0X0000000bbG%2FEvyk.NrRXB3RKAqezFF.sMmK14sS4hwqVqXXULhh77E&asPdf=false