Proposal. Change Windows DFU driver to WinUSB

Post here first, or if you can't find a relevant section!
Post Reply
User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Proposal. Change Windows DFU driver to WinUSB

Post by RogerClark » Sat Aug 19, 2017 10:14 pm

Currently on Windows we use the "libusb-win32" driver, however this driver does not work with the DFU bootloader in the STM32F4.

The driver is installed using the libwdi-simple exe, which also has an option to use the WinUSB driver.

If you look in the driver installer bat file, the "type" argument to libwdi controls which driver is installed.
So if you change the "type" for the dfu, from 1 to 0 and re-run the bat file, it will install WinUSB instead of libusb-win32

I have tried this on my machine (W7 x64), and uploading to the Blue Pill still seemed to work fine.

But, I don't have any 32 bit Windows installations, so I don't know if this would work on W32.

Perhaps a few more people can try this, and see if it works for them.


One additional note.
The version of DFU-until we use on Windows is not compatible with the F4 either, so we will also need to update to the latest version. However I have not had time to confirm whether using the latest version of DFU-util, still works with the Blue Pill etc (I.e with our bootloader)

User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Proposal. Change Windows DFU driver to WinUSB

Post by RogerClark » Mon Aug 21, 2017 11:34 am

Just a quick update about this..

I was mistaken. The libusb driver has not been replaced by WinUSB when I ran wdi-simple

And when I uninstalled libusb and installed WinUSB for the Maple dfu VID/PID , dfu-util could not find the dfu device.

I updated dfu-util, to the latest version (0.9) and that does seem to work with the WinUSB driver, however the Maple bootloader does not reset after the upload is finished, and I had to manually reset the board after the upload.

I don't know what command line the maple_loader.jar is sending to dfu-util, so I will need to run this manually to find out where the problem lies

ag123
Posts: 742
Joined: Thu Jul 21, 2016 4:24 pm

Re: Proposal. Change Windows DFU driver to WinUSB

Post by ag123 » Mon Aug 21, 2017 12:04 pm

in linux the reset is actually not done by dfu-util
if you look in tools/linux64 you would notice a utility: upload_reset
the source code is found in tools/win/src/upload-reset
it seemed this same utility is not there for windows
but the same source code is there in tools/linux64/src/upload-reset

User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Proposal. Change Windows DFU driver to WinUSB

Post by RogerClark » Mon Aug 21, 2017 9:16 pm

@ag123

You are talking about the reset prior to upload

The problem is that the bootloader code does not jump to the start of the sketch code after the upload is complete. AFIK this process is normally triggered by the Reset command being sent by dfu-util

Lena01
Posts: 3
Joined: Sat Sep 09, 2017 10:49 am

Re: Proposal. Change Windows DFU driver to WinUSB

Post by Lena01 » Sat Sep 09, 2017 10:51 am

Microsoft Windows, or simply Windows, is a metafamily of graphical operating systems developed, marketed, and sold by Microsoft. It consists of several families of operating systems, each of which cater to a certain sector of the computing industry with the OS typically associated with IBM PC compatible architecture. Active Windows families include Windows NT and Windows Embedded; these may encompass subfamilies, e.g. Windows Embedded Compact (Windows CE) or Windows Server. Defunct Windows families include Windows 9x, Windows Mobile and Windows Phone.
ergrth 8-)

Post Reply