2014-01-23 03:00 AM
I have used the STM32 USB-FS-Device development kit examples to implement the custom HID and the DFU. It all works OK and I can upgrade the custom HID application from the DFU application using DfuSeDemo. The problem is that the DFU application does not reset when the upgrade is complete, I have to cycle the power. There is a system reset in the code but it isn’t called. Where do I need to do the system reset to force the DFU app to reset when the download is complete?
2014-01-23 03:16 AM
Hi
You have not said which device you are using! Have you read the reference manual? No - try reading the section titled ''Reset and clock control'' Another interesting section titled ''Window Watchdog'' And that is just from a quick search through the reference manual!2014-01-23 03:44 AM
Sorry, forgot to say I am using the STM32L100.
Of course I have read the manual! My question is not about HOW to reset the device, is it WHEN to do it. At what point in the code is the DFU complete so I know I can reset the device?2014-01-23 03:55 AM
Hi
Sorry, by ''Where do I need to do the system reset
'' - I thought you meant which register. My missunderstanding, my bad. ''The problem is that the DFU application does not reset when the upgrade is complete, I have to cycle the power. There is a system reset in the code but it isn’t called. Where do I need to do the system reset to force the DFU app to reset when the download is complete?
'' The DFU application - is that the PC side or are you talking about the built in DFU code that is entered by BOOT0? Or something else?2014-01-23 04:50 AM
Something else. As I explained above I am using the Device Firmware Upgrade component of the STM32 USB-FS-Device development kit.
2014-01-23 04:57 AM
Hi
OK - just googled USB DFU Found : AN3156 ( Doc ID 17068 Rev 3) ''It is possible to exit DFU mode (and bootloader) and jump to a loaded application (in theinternal Flash or in the embedded RAM) using the DFU download request.
The Host sends a DFU_DNLOAD request with 0 data length (no data stage after the
request) in order to inform the device that
it will have to exit DFU mode. The device
acknowledges this request if the current state is dfuDNLOAD-IDLE or dfuIDLE.''
http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/CD00264379.pdf There is also a generic USB DFU doc : http://www.usb.org/developers/devclass_docs/usbdfu10.pdf2014-01-23 05:02 AM
I have read those. My question was specifically about the code example that implements the Device Firmware Upgrade component of the STM32 USB-FS-Device development kit. Thanks for your help.
2014-01-23 06:23 AM
Hi
''Thanks for your help.'' No problem. '' My question was specifically about the code example that implements the Device Firmware Upgrade component of the STM32 USB-FS-Device development kit. '' ''I have used the STM32 USB-FS-Device development kit examples to implement the custom HID and the DFU.
It all works OK and I can upgrade the custom HID application from the DFU application using DfuSeDemo.
'' ''There is a system reset in the code but it isn’t called. Where do I need to do the system reset to force the DFU app to reset when the download is complete?
'' ''The Host sends a DFU_DNLOAD request with 0 data length (no data stage after therequest) in order to inform the device that it will have to exit DFU mode.''
So eitherDfuSeDemo
is not sending a DFU_DNLOAD request with 0 data length OR The implementation of DFU is not calling the system reset when it receives a DFU_DNLOAD request with 0 data length.2014-01-23 06:38 AM
So either
DfuSeDemo
is not sending a DFU_DNLOAD request with 0 data length OR The implementation of DFU is not calling the system reset when it receives a DFU_DNLOAD request with 0 data length. Exactly right. As both of these are supplied by ST I was hoping that someone who has used them might have found a solution.2014-01-23 06:47 AM
Hi
''I have used the STM32 USB-FS-Device development kit examples to implement the custom HID and the DFU.
'' .... '' As both of these are supplied by ST'' You should be able to debug which of the 2 the problem is. If the problem is in your implementation of the DFU - you should be able to fix it. However, if the problem is inDfuSeDemo
then yes, it is somebody else problem. USB DFU is an 'industry standard' - are there any other host DFU programmers?