Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:50 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2: updating firmware using dfu-utils on Windows

Author Message
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 08:00am 16 Aug 2020
Copy link to clipboard 
Print this post

I made some notes while installing a CMM2 firmware upgrade using dfu-utils on Windows.

Pretty messy notes but would be a helpful start if someone wants to do the same thing.

Heavily based on this guide by JohnS for doing it in Linux:
http://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=12171

Download Win64 zip file from https://sourceforge.net/projects/dfu-util/files/
(want to use https for security)
(e.g. version 0.9).
Extract zip file.

Download firmware from Geoff's site:
https://geoffg.net/maximite.html
Make a folder and extract into it.

Didn't need to do this bit:
  Quote  Have CMM2 turned off with keyboard unplugged.


No, need to type command:
UPDATE FIRMWARE (lowercase okay)

unplugged keyboard.
verified green power light still on (no screen signal now)

plug into computer using USB A to A cable.

a to a - shows up as DFU in FS mode

go to cmd prompt

cd to the dfu util folder

Skip this testing:
  Quote  
dfu-util.exe -l
- cannot open

in device manager is DFU in FS mode - update driver.

try A to B USB
update firmware
teraterm disconnect

dfu-util.exe -l
nothing.

try A - kbd, type update firmware, while B has power.
next, USB A-A on computer.
a to a - shows up as DFU in FS mode
warning for no driver?


I read it could use the winusb driver

go to device manager, DFU in FS mode
skip this testing:
  Quote  update driver ... browse ... dfu util - nope

update .. browse ... let me pick ... universal serial bus devices ... winusb device / winusb device .. yes (against warning, can't verify compatible)

dfu-util.exe -l

confirm alt=0 is internal flash (the option bytes is the other one, alt=1)

copy line from http://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=12171 but modified with two changes before running:
original: sudo dfu-util -d ,483:df11 --alt 0 -s 0x08000000:leave --download xxx.bin
first change, removed the "sudo" part: dfu-util -d ,483:df11 --alt 0 -s 0x08000000:leave --download xxx.bin
second change was to put in the correct bin file name. Entered that in command prompt in dfu utils folder.

result:
File downloaded successfully
Error during download get_status

(probably should have turned it off here)
unplug USB A to A cable. (I replaced it with a keboard in the CMM2 USB A socket)
turn it on.

Looks like it's updated, version number on start screen is the new one.

Finished, the rest is just more testing:
  Quote  

at this point I wondered if I could have the computer plugged into both USB ports at the same time, in case I hadn't had a keyboard.

Testing:
Don't remember if I started with CMM2 on or off.
Plugged computer into both the A and B USB slots in the CMM2.
Started terminal, it works.

Tried dfu-util.exe -l in windows cmd prompt - it didn't work.
typed update firmware into terminal, CMM2 switched.
Tried dfu-util.exe -l in windows cmd prompt - it showed the flash, like I would be able to update it.

But I'd already updated it, so I unplugged things and changed back to my usual setup. USB B to power supply, USB A to keyboard.
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 10:06am 16 Aug 2020
Copy link to clipboard 
Print this post

It seems to have changed my keyboard option. Easy enough to change back though.

edit: oh yeah, I should mention that it was Windows 10 I used.
Edited 2020-08-17 01:35 by capsikin
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 11:11am 22 Aug 2020
Copy link to clipboard 
Print this post

I tried it again and had a bit of trouble, maybe because I'd unplugged power. This worked:

plugged in power - usb b. keyboard - usb a. Had CMM2 switched on.
command: update firmware. CMM2 screen goes off. green light still on.
unplug keyboard (power switch still on). Plug A-A cable.
heard a USB noise from windows indicating it connected.
Saw it under Universal Serial Bus devices, as DFU in FS Mode.

Then I was able to continue as above.
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 03:08pm 22 Aug 2020
Copy link to clipboard 
Print this post

  capsikin said  It seems to have changed my keyboard option.


+ 1 using the Cube programmer .... The options
go back to default .
Edited 2020-08-23 01:09 by hitsware2
my site
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 03:13pm 22 Aug 2020
Copy link to clipboard 
Print this post

  capsikin said  I tried it again and had a bit of trouble, maybe because I'd unplugged power. This worked:

plugged in power - usb b. keyboard - usb a. Had CMM2 switched on.
command: update firmware. CMM2 screen goes off. green light still on.
unplug keyboard (power switch still on). Plug A-A cable.
heard a USB noise from windows indicating it connected.
Saw it under Universal Serial Bus devices, as DFU in FS Mode.

Then I was able to continue as above.

Leave the power (USB B) connected and on through everything ?
my site
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 04:13pm 22 Aug 2020
Copy link to clipboard 
Print this post

  hitsware2 said  
  capsikin said  I tried it again and had a bit of trouble, maybe because I'd unplugged power. This worked:

plugged in power - usb b. keyboard - usb a. Had CMM2 switched on.
command: update firmware. CMM2 screen goes off. green light still on.
unplug keyboard (power switch still on). Plug A-A cable.
heard a USB noise from windows indicating it connected.
Saw it under Universal Serial Bus devices, as DFU in FS Mode.

Then I was able to continue as above.

Leave the power (USB B) connected and on through everything ?


Yeah, I left the power connected through everything. Switched the power switch only after completing the update, to boot back in normal mode.
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 04:45pm 22 Aug 2020
Copy link to clipboard 
Print this post

When do you switch run-program ?
( move jumper )
my site
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 09:23pm 22 Aug 2020
Copy link to clipboard 
Print this post

  hitsware2 said  When do you switch run-program ?
( move jumper )


He doesn't.
He is using the UPDATE FIRMWARE command instead.
That's equivalent to flicking the switch and rebooting.

Jim
VK7JH
MMedit
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 09:47pm 22 Aug 2020
Copy link to clipboard 
Print this post

A - Ha !  
my site
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 04:38am 23 Aug 2020
Copy link to clipboard 
Print this post

I thought I'd better test doing an upgrade using the jumper, in case I can't use the update firmware command for some reason. Here's what I did:

USB A unplugged, USB B has USB A-B cable in CMM2 but not plugged into power.
Meant to have CMM2 power switch off but had:
  Quote  
CMM2 power switch on.


open case
jumper moved from RUN to PROGRAM.

USB A-B plugged into laptop for power.

This is just because I hadn't already turned it off, otherwise can be skipped:
  Quote  
The laptop made a Windows USB noise and showed it in device manager as USB Serial device (COM3) within Ports (COM & LPT)
Cannot connect using terminal program as CMM2 is not in RUN mode.

Switched power off (I'd meant it to be off already), unplugged USB A-B from laptop, and plugged it back in.

Doesn't show up as a serial port now it's switched off.

Connected USB A-A between laptop and CMM2, heard Windows USB noise, now I see two devices - the previous serial one, and the DFU one I want: Universal Serial Bus devices / DFU in FS Mode

Now the dfu-util commands work. I did the dfu-util command to update it.

Heard a USB disconnect noise at the end, this one is no longer listed:
Universal Serial Bus devices / DFU in FS Mode
Power light is still on despite me not having turned on the CMM2 power switch (I think since I plugged in the A-A cable)
Unplugged USB A-A and power light went off.
Plugged in display and audio cable (I'd had them unplugged, probably didn't need to)
Switched jumper back to RUN.
Plugged in USB keyboard.
Switched on.
Terminal connection works. Keyboard works.
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 01:45am 01 Sep 2020
Copy link to clipboard 
Print this post

Something's changed, not sure if it's CMM2 firmware or windows 10, and I can't do this anymore

  capsikin said  
plug into computer using USB A to A cable.

a to a - shows up as DFU in FS mode

Now it shows up as Universal Serial Bus controllers / STM Device in DFU Mode
instead of: Universal Serial Bus devices / DFU in FS Mode
  Quote  
I read it could use the winusb driver

go to device manager, DFU in FS mode
skip this testing:
  Quote  update driver ... browse ... dfu util - nope

update .. browse ... let me pick ... universal serial bus devices ... winusb device / winusb device .. yes (against warning, can't verify compatible)

Now it has a driver from STM even though I'd previously changed it.
When I try to change it, initially only the one driver is offered, and even if I untick "Show compatible hardware" I can't find universal serial bus devices ... winusb device / winusb device
  Quote  
dfu-util.exe -l

This now gives a "Cannot open DFU device 0483:df11" error
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 06:13am 01 Sep 2020
Copy link to clipboard 
Print this post

I used dfu-util on a raspberry pi instead, that worked.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 07:27am 01 Sep 2020
Copy link to clipboard 
Print this post

Sounds like Windows has changed.

John
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 08:13am 01 Sep 2020
Copy link to clipboard 
Print this post

Gents - you really are making life hard for yourselves. In my development I create the binaries using STMCubeIDE and then most of the time just use STM32CubeProgrammer over USB to do the update - exactly as in the manual. It is rock solid reliable over a decent USB A-A cable. Both UPDATE FIRMWARE and the switch/jumper work identically in putting the processor into bootstrap mode. In all cases you need to RESET or power cycle to then start the new firmware but this should never be necessary on normal power up. If it is then the chip hasn't flashed properly.

If you insist on doing the update over the serial port then I don't know what/if error correcting is built into DFU. Certainly USB is much faster and more reliable. A proper A to A cable should have a twist in it D+ to D-, D- to D+ but some USB implementations on a PC may work without this.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 08:56am 01 Sep 2020
Copy link to clipboard 
Print this post

Not everyone can use that tool and also the changed Windows message is alarming or at least confusing when things then don't apparently work.

Thanks for saying what UPDATE FIRMWARE does.

Also, for the info on the cable.

John
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 09:53am 01 Sep 2020
Copy link to clipboard 
Print this post

I got Windows dfu-util working by installing Zadig from zadig.akeo.ie (which links to its GitHub location https://github.com/pbatard/libwdi/releases/download/b730/zadig-2.5.exe) and using that to pick the right driver again. I wish I knew in advance it was going to take 5 minutes installing the driver and give an error, but despite that it fixed the problem.
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 11:10pm 01 Sep 2020
Copy link to clipboard 
Print this post

  matherp said  Gents - you really are making life hard for yourselves. In my development I create the binaries using STMCubeIDE and then most of the time just use STM32CubeProgrammer over USB to do the update - exactly as in the manual. It is rock solid reliable over a decent USB A-A cable. Both UPDATE FIRMWARE and the switch/jumper work identically in putting the processor into bootstrap mode. In all cases you need to RESET or power cycle to then start the new firmware but this should never be necessary on normal power up. If it is then the chip hasn't flashed properly.

If you insist on doing the update over the serial port then I don't know what/if error correcting is built into DFU. Certainly USB is much faster and more reliable. A proper A to A cable should have a twist in it D+ to D-, D- to D+ but some USB implementations on a PC may work without this.


Looking at some data sheets from a vendor I found via digikey, D+ and D- are twisted together, but ultimately D+ connects to D+, D- connects to D-.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025