Allow special STM32 DFU operations without -a setting
Multiplatform USB DFU host utility
Brought to you by:
tormod
Allow special STM32 DFU operations without upload/download.
Example: I have an STM32 device in DFU mode and just want to get it out of it. When uploading and downloading the option "-s 0x08000000:leave" will do the trick, but the thing is that I don't want to do either, I just want to get the device out of DFU state. Right now I'm forced to do an upload and just discard the data, but doesn't feel right and also I don't know whether that will work when the memory is protected.
Anonymous
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
I agree. The need to specify -U or -D for :leave looks strange
Hi every one,
Here is a proposal for a patch to trigger leaving the DFU mode with a single command line flag.
Hope this can help :-)
I tested it with an STM32F7.
Stephane, thanks for the patch, but I don't want to introduce a new option only for DfuSe devices when we already have the -s modifiers for DfuSe. dfuse.c also already have code for sending the "leave" request.
The "special commands" like leave, mass erase, etc are like the download process just without the part where the file is actually sent. I suggest this patch, where the -s modifier implies a download (unless upload is specified) and if there is no file (if no -D) it will skip that part. Hence:
dfu-util -s :leave -a 0
ordfu-util -s :mass-erase -a 0
should now work. I have some work in the pipeline for another feature which will might eliminate the need for specifying an alternate interface (the current code assumes one and only one alternative interface remains after filtering, which makes sense for all normal DFU actions). Testing is welcome.I have applied my above solution to git. The -a 0 part is still required, this looks confusing to the user and is technically not needed, so I am keeping this ticket open for this.