2011-10-06 04:22 PM
Hi, i m using stm32 cortext m3. Is it normal to have CDC (virtual com port) combine with FDU to become a composite USB device? Is there any example on this? Thanks.
This is so that a PC application can perform not only firmware upgrade but also other communication/operations with uC. The PC application will make sure that uC is in the right mode before performing firmware upgrade.2011-10-09 02:11 AM
I think you mean DFU, not FDU. Yes, it is normal for a device to expose a DFU interface in addition to their ''normal'' interfaces. The DFU interface is in this case in ''run-time'' mode. When a DFU_DETACH request is sent to the DFU interface, the device will enter DFU mode, and then only the DFU interface will be exposed, and is ready to receive the firmware update through DFU_DNLOAD requests.
2011-10-09 10:30 PM
So sorry, typo. It should be DFU (Device Firmware Upgrade). Thanks for pointing out and the reply.
Is there any stm32 example that implemented CDC and DFU class together?2011-10-10 01:13 AM
ST's own examples (from the USB FS Device Library) do not use standard DFU, and the device is booting directly into DFU mode (if e.g. a special button is pressed).
But take a look at the Maple project, they have tried the combined serial + DFU device approach, the problem seems to be the driver handling in MS Windows:2011-10-10 08:18 AM
Thanks again for the info. It seems that IAD is the solution to windows driver. Any idea on how to quickly modify ST's examples of FDU and CDC to run both function at the same time?
2011-10-11 01:05 PM
The ST DFU example (using DfuSe, not the normal DFU protocol) is always in DFU mode. I would not try to combine it with another interface. But if you are fine with a solution where only one of the interfaces boots up depending on some hardware switch, you can use the examples as-is.
If you want a standard DFU device that will switch from run-time to DFU mode (and allow combined interfaces) you should look at the Maple code instead.2011-10-12 08:13 PM
Thank you.
>>If you want a standard DFU device that will switch from run-time to DFU mode (and allow combined interfaces) you should look at the Maple code instead.Yes, I think this is what I want. I prefer to modify using st example because there is already a PC host software (Dfuse Demonstration) codes, which I can modify to add other controls for uC through CDC. This would save time. At any time, I would like to be able to upload/download firmware or control other features implemented in uC immediately, rather than reset and go into DFU mode wait loop. Besides, the CDC and DFU example is already working on the uC that I am using. So, things would be quicker if I use these examples instead of Maple? What do you think? I am new to this.>>ST's own examples (from the USB FS Device Library) do not use standard DFUThe example on desktop uses STDFU.DLL and it seems that it does not support IAD. Do you have any info? I implemented IAD in uC. The PC software (DfuSeDemo.exe) STDFU_GetDFUDescriptor( ) return STDFUPRT_NOERROR but the contents are empty. As a result, DfuSeDemo.exe could not proceed into DFU. Does this means I cannot use DfuSeDemo.exe even if IAD is successfully implemented? STDFU_GetDFUDescriptor( ) is in STDFU.DLL and codes are not available.Thanks again.2011-10-30 02:32 AM
Yes, if you want the DFU down/uploading to be possible all the time, you might as well use the DfuSe firmware code. You should be able to combine the example DFU and CDC interfaces, but it might not be straight-forward and you will have to understand USB and the USB firmware code well. For instance, you will have to merge both into one Data_Setup function in usb_prop.c and dispatch according to which interface is being addressed. Would be interesting to see if you can make it. Is this an open-source project?
For your DfuSeDemo.exe issues, I have no idea. I am using an open-source firmware loader.