2012-04-18 05:05 AM
Hi,
I am trying to implement a new project to combine MSD Mass Storage Device with DFU capabilities. I First play with both MSD ST's example and DFU ST's example separetely. Then I made a project with Both capabilities combined together. I simply go from DFU to MSD, or MSD to DFU thanks to a delay. To do so : I disconnect my USB, set the appropriate PID and initialize a new MSD connection or DFU connection respectively. Thus my host (PC) load the appropriate driver. Everything work properly. However, I would like to be in MSD mode by default and enter DFU mode thanks to a software command. I saw that the Detach DFU command would correspond. However I am a little confuse about how to do so. I would be very pleased with any advise, Thanks in advance Regards, Greg2012-04-19 01:36 AM
Hi,
I find that I should either use the composite device capabilities or use the DFU run-time capabilities. I have a few questions : 1) If I use the composite device capabilities. The Host PC will load a driver for each declared interfaces. But the PID is described en the desc.c file once. How to provide the Host different PID ? 2) Using run-time DFU I begin with the MSD ST's example. And I try to add the run-time DFU interface and functional descriptor. I m not sure about where it should go... I tried once in the desc.c file in /* USB Standard Device Descriptor */ or once in the usbd_msc_core.c in /* USB Mass storage device Configuration Descriptor */ I add this :// Run-Time DFU Interface Descriptor taken from the// USB Device Firmware Upgrade Specification, Rev. 1.1
//
0x09, // bLength
0x04, // bDescriptorType
0x00, // bInterfaceNumber
0x00, // bAlternateSetting
0x00, // bNumEndpoints
0xFE, // bInterfaceClass: Application Specific Class
0x01, // bInterfaceSubClass: Device Firmware Update
0x01, // bInterfaceProtocol: Runtime protocol
0x00, // iInterface
0x09, // bLength
0x21, // bDescriptorType: DFU_FUNCTIONAL
0x0B, // bmAttributes: WillDetach, CanUpload, bitCanDownload
0xff, 0x00, // wDetachTimeOut: 255 ms
0x00, 0x04, // wTransferSize: 1024 byte
0x00, 0x01 // bcdDFUVersion As I told you before, I want to send a software command to enter DFU. If anyone could have a look, It would be very appreciated... Thanks, Greg
2012-04-20 08:14 PM
I guess the example from ST provide this capability already. DFU -> MSD and Back. Can you pls re-check ? i am not so sure
For Composite device, only 1 PID needs to be provided in Device Desc and composite device implementation is done using Configuration Desc. Using this, the Host becomes DFU capable MSD device.2012-05-02 06:23 PM
Though i could not clarify things in this post, i would like to point you to an firmware source example code available from ST
Donwload iNEMO GUI and firmware. The firmware has both options enabled, Hardware DFU mode and software DFU mode when the device connected to USB of computer.I guess you are particularly asking for MSD case. If it is so, ignore my reply.2012-05-09 05:26 AM
Hi alkom andothers,
You are right that it already support it.However I can t see how to launch a detach request to get in DFU when my MSD works.My PC see it as a Mass storage device and load the driver,Thus the DFUSE does not recognize my board.Consequently, I m not able to do anything linked with DFU...Any Idea about how I should proceed ?Thanks in advance,Greg