Dfu-programmer installation : windows

Hey all,

Can someone expand a bit on this line of the firmware update instructions, its the only instruction I can find for installing dfuprogrammer:

download the dfu-programmer binary from dfu-programmer.github.io.

How is this installed? I am not a programmer and am only aware of gitHub in the most basic sense. I’ve downloaded the zip file, which contains some folders and an executable. Running the executable does not install anything, but instead gives some errors. I have the feeling I that I should have some sort of environment or system software on my machine in order to install this, but I have no idea.

I could definitely use some help.
Any takers?

the zip file does not contain an installer - it contains the actual executable, which you need to run from the command line.

so what you need to do is unzip it to some folder, then copy the firmware file to that folder. then if you have windows 7/8 go to Start (or whatever it’s called now), and start typing cmd and it should come up with Command Prompt or Command Line - right click on it and choose Run As Administrator.

it will open a new window where you have to type in the following:
c: [or whatever drive you unzipped dfu programmer to]
cd [folder where you unzipped dfu programmer]
dfu-programmer at32uc3b0256 erase
dfu-programmer at32uc3b0256 flash whitewhale.hex --suppress-bootloader-mem
dfu-programmer at32uc3b0256 start

so if you have dfu programmer unzipped to d:\dfu then you will need to execute the following:
d:
cd d:\dfu
dfu-programmer at32uc3b0256 erase
dfu-programmer at32uc3b0256 flash whitewhale.hex --suppress-bootloader-mem
dfu-programmer at32uc3b0256 start

that’s it. make sure you power up the module with the front panel button pressed first.

1 Like

Thanks @scanner_darkly for taking the time to write all this. I will try again tonight when I get off work! :smile:

After reading this part in the doc:

Navigate to the folder where you installed dfu-programmer

I was trying to figure out how to install it!

no problem!

if that works for future updates just create a new file in the dfu folder and name it something like update.bat (extension is important) and edit it to contain the following commands, then next time you can just run update.bat or create a shortcut for it.

dfu-programmer at32uc3b0256 erase
dfu-programmer at32uc3b0256 flash whitewhale.hex --suppress-bootloader-mem
dfu-programmer at32uc3b0256 start

Yes a batch file is a good idea for this! – I’ll update tonight on my progress.
Thanks again @scanner_darkly.

Everything worked and I was able to update WW and ES.

Two things threw me off that might be worth modifying in the doc:

  1. The doc mentions installing dfuProgrammer which is incorrect terminology and confusing.
  2. When first tying to run the dfuProgrammer utility without a) a module hooked up via USB and b) the USB driver updated, the utility will pop up an error that lead me to believe it was not able to run on my machine.

Things to note:

  • dfuProgrammer is just a downloadable executable that comes with with some subdirectories full of files.
  • dfuProgrammer comes with its own drivers.
  • to install dfuProgrammer drivers, connect a module to your PC via USB and power it up with its button held. If it doesn’t find the drivers itself right away, go to the device manager, double click the errored device and manually load the drivers by browsing to the dfuProgrammer folder.

Thanks to @scanner_darkly for your help!!
Thanks to @tehn for graciously offering to update all my modules for me!

Great community here!

glad it worked, and thank you for posting detailed info!

i should take the blame for the terminology confusion - it was taken from this thread Updating modular firmware - should’ve been more clear, apologies!

Without your help I would still be stuck! :blush: :smiley:

1 Like

Thanks so much! This was useful to me too. Just updated my Ansible.

Thank you @scanner_darkly for your info here, just helped me update Ansible with Earthsea :+1:

1 Like

tons of problems trying to install dfu programmer…
very fussy if you mind my opinion…no clear instructions anywhere…
installed mingw, tried to install libusb but failing.
dfu-programmer wont find the libusb0.dll file which i cannot find in any libusb distribution.
if anybody wants to help with a few step by step instructions i’d be immensely grateful.
on mac it was very easy, on windows i’m going crazy.

The zip file being discussed in this topic (on this page under “Downloads”), as of v0.7.2, contains libusb0.dll in the dfu-prog-usb-1.2.2/amd64, dfu-prog-usb-1.2.2/ia64, and dfu-prog-usb-1.2.2/x86 directories. Is dfu-programmer.exe unable to find these library files when you extract the zip file and run it as in this post? You should not need mingw or to install libusb0, but maybe an existing installation of some library is being found first on Windows’ DLL search path and loaded instead. A tool like Dependency Walker might help figure out what all a program is trying to load and from where.

1 Like

thanks, i sort of missed one point and went the long route (failing).
i will try this now!
thank you!

it worked flawlessly thank you!

1 Like