![]() |
Forum Index : Microcontroller and PC projects : CMM2: updating firmware using dfu-utils on Windows
Author | Message | ||||
capsikin Guru ![]() Joined: 30/06/2020 Location: AustraliaPosts: 341 |
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: 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: I read it could use the winusb driver go to device manager, DFU in FS mode skip this testing: 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: |
||||
capsikin Guru ![]() Joined: 30/06/2020 Location: AustraliaPosts: 341 |
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: AustraliaPosts: 341 |
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 StatesPosts: 719 |
+ 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 StatesPosts: 719 |
Leave the power (USB B) connected and on through everything ? my site |
||||
capsikin Guru ![]() Joined: 30/06/2020 Location: AustraliaPosts: 341 |
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 StatesPosts: 719 |
When do you switch run-program ? ( move jumper ) my site |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
( 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 StatesPosts: 719 |
A - Ha ! ![]() my site |
||||
capsikin Guru ![]() Joined: 30/06/2020 Location: AustraliaPosts: 341 |
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: 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: 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: AustraliaPosts: 341 |
Something's changed, not sure if it's CMM2 firmware or windows 10, and I can't do this anymore 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 I read it could use the winusb driver go to device manager, DFU in FS mode skip this testing: 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 dfu-util.exe -l This now gives a "Cannot open DFU device 0483:df11" error |
||||
capsikin Guru ![]() Joined: 30/06/2020 Location: AustraliaPosts: 341 |
I used dfu-util on a raspberry pi instead, that worked. |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4044 |
Sounds like Windows has changed. John |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
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 KingdomPosts: 4044 |
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: AustraliaPosts: 341 |
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: AustraliaPosts: 341 |
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-. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |