cancel
Showing results for 
Search instead for 
Did you mean: 

USB MSD Run time DFU

gregoire
Associate II
Posted on April 18, 2012 at 14:05

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,

Greg
4 REPLIES 4
gregoire
Associate II
Posted on April 19, 2012 at 10:36

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

alok472
Associate II
Posted on April 21, 2012 at 05:14

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.
harinath
Associate III
Posted on May 03, 2012 at 03:23

Though i could not clarify things in this post, i would like to point you to an firmware source example code available from ST 

http://www.st.com/internet/evalboard/product/250367.jsp

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.

gregoire
Associate II
Posted on May 09, 2012 at 14:26

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