I could not find this is any documentation, but I assumed that the dfu-suffix would be used to make sure the right target was programmed. However if I set the wrong suffix, dfu-util happily download the file anyway:
dfu-util -a 0 -s 0x08005000:leave -D usb_test.bin
Match vendor ID from file: 0111
Match product ID from file: 2222
Opening DFU capable USB device...
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 1024
DfuSe interface name: "Internal Flash "
Downloading to address = 0x08005000, size = 19048
Download [=========================] 100% 19048 bytes
Download done.
File downloaded successfully
Anonymous
I think this has to do with your device already being in DFU mode. Normal DFU devices (not ST's DfuSe implementations) have a run-time and DFU mode, and the file ID is matched against the run-time ID. Devices often get a new ID in DFU mode, so the file ID does not apply to DFU mode. To match for DFU mode devices (usually not necessary because only one device should have been put into DFU mode ...) you can define a DFU mode match on the command line with the ID after a comma: -d ,0483:df11
Otherwise we would need to special case the DfuSe devices also, but nothing prevents DfuSe compliant devices from also having a run-time mode and switch on request per the DFU specification.
OK thanks for this explanation. I understand better now.
This is probably not obvious to people who only work with typical DfuSe devices. Any suggestions to improve the documentation is welcome.