DFU-util with Windows - "Cannot open DFU device"

I can’t get dfu-util to work on the Photon. I tried to follow the steps in other forum posts/threads, the 3518 tutorial in particular, although the directions were not entirely consistent across the several threads I reviewed. I used Zadig to load the driver and saw the “Driver was installed successfully!!!” screen. I have the Photon in DFU mode (blinking yellow), using Windows 8.1.

One thing to note is the “@DCT Flash”, rather than the “@SPI Flash” that I’ve seen in other posted log screens. Additionally, when I tried to use dfu-util to update the firmware (part1 and 2 binary files), I got other errors and I don’t think the update was successful.

Here is what I get when I use the -l flag/option:

C:\Particle\firmware-photon_043\modules>dfu-util -l
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Cannot open DFU device 2b04:d006
Found DFU: [2b04:d006] ver=0200, devnum=6, cfg=1, intf=0, alt=1, name="@DCT Flash   /0x00000000/01*016Kg", serial="00000000010C"
Found DFU: [2b04:d006] ver=0200, devnum=6, cfg=1, intf=0, alt=0, name="@Internal Flash   /0x08000000/03*016Ka,01*016Kg,01*064Kg,07*128Kg", serial="00000000010C"

C:\Particle\firmware-photon_043\modules>

What might cause “Cannot open DFU device” to occur? Is it actually a problem, is it something minor, operator error, perhaps?

Through webIDE and particle-cli, I have been able to flash many “BlinkyLED” programs to the Photon, OTA I’m quite sure, although the USB cable was attached most of the time. Using particle-cli (and --usb) does not work, as it makes use of dfu-util.

I just went thru some steps with particle-cli and I believe I updated the firmware to 0.4.3, but I don’t know for sure.

Here are two other basic, but related questions:

  1. My webIDE Build screen shows “You are building with Spark firmware V0.3.4.” Is that the firmware version on the physical Photon (or Core) device?

  2. Is there a way to read/determine what firmware version (0.4.0, 0.4.1, or 0.4.2, etc.) is on a particular Photon?

Thanks!

To see the system firmware: Determining the version of system firmware on a Photon/P1

I wonder if the DFU driver is incompatible with Windows 8.1?

I saw that other post you are referring to and was able to determine the firmware version on my Photon. Apparently, I have 0.4.3. Thanks.

I tried dfu-util on a Win7 machine and got a step further. I didn’t see the “Cannot open DFU device” message, but was unable to flash anything to the Photon (via cli flash with --usb). Particle-cli does work directly via OTA (no --usb).

So, I still can’t flash anything using dfu-util on either Win7 or Win 8.1. And I still get that same message on my Win 8.1 machine. That Zadig program offers several drivers to install - I tried each of them, but no joy. I believe I went back to the recommended driver.

One other issue is that the Particle Build webIDE generates binaries for the Core rather than a Photon. They are all in the 75k size range. I get the binaries by clicking on the little “cloud” icon (up near the Current App name). Does that have anything to do with the “Spark firmware V0.3.4” mentioned in my originating post?

On Particle-Dev, the exact same code will generate smaller ~2k binaries (for the Photon). I can flash the Particle-Dev binaries to the Photon (OTA via Particle-cli) and they work. Obviously, the larger Particle Build binaries do not work.

Has someone else reported anything similar? I have read numerous posts/threads looking for any relevant info on several fronts, but I’m not making much progress on any issue I have.

@dyh, if you :star: the Photon in the Web IDE, it will compile for the Photon and give the correct binary :smile:

If you can, can you paste the full DFU verbose here? Also… What does the Device manager show the Photon as when in DFU mode?

What do I need to get a Photon binary from Web IDE? I didn’t understand what that “star” meant.

Also, what is the syntax for flashing code directly via dfu-util, again? Not system firmware, but any blinky-type code. Like: “dfu-util …” instead of “particle flash …”.

Is it:

dfu-util -d 2b04:d006 -a 0 -i 0 -s 0x080A0000:leave -D d7Blink.bin

During the Photon’s flashing yellow, DFU mode, the Device Manager has a heading of: “libusbK USB Devices” and “Photon DFU Mode” indented on the line below. Sorry, I don’t know how to get a screen shot of it. Of course, at other times, it just shows up on a com port (COM17).

Looking at the log, you’ll see I just did:

particle flash device_name --usb filename.bin

I’m not sure why, but the flash worked just now. I’m 99.9% sure that doing the same thing (flashing via --usb) didn’t work the previous 10-15 times on two different PCs. I’m on the Win 8.1 machine now.

So here’s the terminal log output from doing a “dfu-util -l” and then from flashing two different programs:

d7Blink.bin and d7Blink-lg.bin

C:\Particle>dfu-util -l
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Cannot open DFU device 2b04:d006
Found DFU: [2b04:d006] ver=0200, devnum=6, cfg=1, intf=0, alt=1, name="@DCT Flash   /0x000
00000/01*016Kg", serial="00000000010C"
Found DFU: [2b04:d006] ver=0200, devnum=6, cfg=1, intf=0, alt=0, name="@Internal Flash   /
0x08000000/03*016Ka,01*016Kg,01*064Kg,07*128Kg", serial="00000000010C"



C:\Particle>particle flash DH-Photon-01 --usb d7Blink.bin
Found DFU device 2b04:d006
Apparently I didn't find a DFU device? util said  dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Found DFU: [2b04:d006] ver=0200, devnum=6, cfg=1, intf=0, alt=1, name="@DCT Flash   /0x000
00000/01*016Kg", serial="00000000010C"
Found DFU: [2b04:d006] ver=0200, devnum=6, cfg=1, intf=0, alt=0, name="@Internal Flash   /
0x08000000/03*016Ka,01*016Kg,01*064Kg,07*128Kg", serial="00000000010C"

checking file  d7Blink.bin
spawning dfu-util -d 2b04:d006 -a 0 -i 0 -s 0x080A0000:leave -D d7Blink.bin
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Cannot open DFU device 2b04:d006
Opening DFU capable USB device...
ID 2b04:d006
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 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x080a0000, size = 2204
Download        [=========================] 100%         2204 bytes
Download done.
File downloaded successfully
Error during download get_status
Error writing firmware...

C:\Particle>particle flash DH-Photon-01 --usb d7Blink-lg.bin
Found DFU device 2b04:d006
Apparently I didn't find a DFU device? util said  dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Found DFU: [2b04:d006] ver=0200, devnum=6, cfg=1, intf=0, alt=1, name="@DCT Flash   /0x000
00000/01*016Kg", serial="00000000010C"
Found DFU: [2b04:d006] ver=0200, devnum=6, cfg=1, intf=0, alt=0, name="@Internal Flash   /
0x08000000/03*016Ka,01*016Kg,01*064Kg,07*128Kg", serial="00000000010C"

checking file  d7Blink-lg.bin
spawning dfu-util -d 2b04:d006 -a 0 -i 0 -s 0x080A0000:leave -D d7Blink-lg.bin
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Cannot open DFU device 2b04:d006
Opening DFU capable USB device...
ID 2b04:d006
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 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x080a0000, size = 2204
Download        [=========================] 100%         2204 bytes
Download done.
File downloaded successfully
Error during download get_status
Error writing firmware...

C:\Particle>

Again, this time the flash worked, but I don’t know why. I’ll keep going and see if I have any other issues, but please let me know:

  1. How to get Photon binaries from Web IDE.
  2. What the syntax is for direct flashing via dfu-util.

Thank you.

The command reference is here: https://github.com/spark/docs/wiki/DFU-reference

Look for User firmware

For the :star:-ing information: http://docs.particle.io/photon/build/#flash-apps-with-particle-build-particle-apps-and-libraries

See: Select Your Device

:star: will choose the default device to compile code for and once you choose a Photon, hitting the :cloud: download button will download a Photon binary.

hope this helps! :smile:

In Web IDE, on my Particle Devices tab/page, I see my Photon’s name, but there isn’t a star next to it, like I see in the documentation. That must be what I need to click to get Photon binaries.

Also, I don’t get the “info” icon next to “Ready” at the bottom. Apparently, clicking that icon would provide some compiler info.

I’m using the Firefox browser on both PCs. I may play around with some of the browser options to see if I can get those symbols and icons to appear.

Do you only have 1 device/Photon?

If you mouse over the name, it should show some tooltip.

Yes, just one Photon. There’s a blue dot to the right of the Photon’s name. If I mouse over it, a pop-up says “Connected” or something. I don’t see any other pop-ups when I’m near anything else.

Thanks for the two references. I’m not sure I ever saw the ref for the DFU.

Thanks. We seem to be stepping on each others’ messages!!

If you have only one device it’s going to be used by default. When you have more then there’s need to specify which one you want to compile against or flash.

About the “Info” icon it’s a bug and I’ve added it to our backlog.

With one device, I can see why there’s no need to specify which device. :smile:

The issue is that my Web IDE creates a Core binary when I have a Photon device. The little cloud icon generates binaries that are in the 75k size range - for five lines of code.

I can get Photon binaries using Particle-Dev and they are in the 2k size range. I can flash those onto the Photon and they work fine, while the binaries from the Particle Build Web IDE do not work.

So I’m not sure how to “reset” Web IDE so that it generates Photon binaries.

Ok It’s a bug then. I’ve confirmed it and working on a fix as we speak.

@dyh could you try it now? You should be getting Photon firmware when downloading

1 Like

Yes, the fix seems to work for me. I got a smaller sized (Photon) binary and was able to flash the Photon using dfu-util. So, users with a lone device, either Core or Photon, will get binaries in their “format” now?

The compile info icon isn’t a concern for me. I just happened to notice the feature wasn’t implemented.

Thanks for fixing the little cloud icon. I was glad to help out in a small way.

1 Like

Users with one device will get their binary compiled for it so no matter if you have one Photon or Core :slight_smile:

2 Likes

Hi dyh and suda,
I was able to replicate this problem. The key phrase in the dfu-util -l output is:
Cannot open DFU device 2b04:d006
That’s another device - not a Core or Photon. I used Zadig and scanned all device to discover it was my machine’s (brand new Dell, Windows 10) Bluetooth controller. Why it is in DFU-mode, I have no idea, but I was able to hardware disable Bluetooth and that removed the item from the DFU-util -l list and allowed for a successful “particle update”.
In my opinion, the actual problem lies in “Particle Update”… it’s seems to be trying to update any connected device in DFU mode and errors out when it can’t and therefore ignores my connected Core/Photon. Instead, “Particle Update” should verify that the connected DFU device is actually a Core/Photon before trying to update its firmware. That will prevent erroring out on non-Particle devices… and most importantly allow me to fully use the Patricle CLI and my Bluetooth controller. Oh yes, and prevent others from running into this same problem. :smile:
best, Yogi

@nexxy, would this be something for you?

I had the same issue, even disabled Bluetooth, but Zadig was telling me that 2b04:d006 is “Photon Core in DFU Mode”. I realized I hadn’t put the Photon in DFU mode before using Zadig to install libusbK before. Once I’d done that, then “particle update” worked just fine (I have dfu-util.exe in my PATH). Hope this helps.

How did you hardware disable the Bluetooth? I am running into the same issue, but when I disable the bluetooth in the device manager, it still seems to appear. This is the output of dfu-util -l after I disabled bluetooth (0489 is bluetooth, 1d50 is my core):

Cannot open DFU device 0489:e07a
Found DFU: [1d50:607f] ver=0200, devnum=7, cfg=1, intf=0, alt=1, name="@SPI Flash : SST25x/0x00000000/512*04Kg", serial="8D6E45695654"
Found DFU: [1d50:607f] ver=0200, devnum=7, cfg=1, intf=0, alt=0, name="@Internal Flash  /0x08000000/20*001Ka,108*001Kg", serial="8D6E45695654"    

When I try to run:

particle flash --factory tinker

I get:

Cannot open DFU device 0489:e07a
Error writing firmware...Cannot open DFU device 0489:e07a

I turned off my Bluetooth in my BIOS settings. Good luck.