Photon: dfu-util on Ubuntu fails to flash

Hi there,

I have setted my Photon to DFU mode:
https://docs.particle.io/guide/getting-started/modes/photon

And I am trying to flash this blink example (session Compile Locally, Flash Locally - Over USB):
https://learn.sparkfun.com/tutorials/photon-development-guide/all

But my Photon always got back to blinking blue.

Any help/suggestions?

My versions are:

$ uname -a
Linux 3.16.0-62-generic #83~14.04.1-Ubuntu SMP Fri Feb 26 22:52:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

$ particle help
Welcome to the Particle Command line utility!
Version 1.11.0

$ dfu-util -V
dfu-util 0.9

$ dfu-util -v -v -d 2b04:d006 -a 0 -i 0 -s 0x080A0000:leave -D blink.bin
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
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 "
Memory segment at 0x08000000 3 x 16384 = 49152 ®
Memory segment at 0x0800c000 1 x 16384 = 16384 (rew)
Memory segment at 0x08010000 1 x 65536 = 65536 (rew)
Memory segment at 0x08020000 7 x 131072 = 917504 (rew)
Downloading to address = 0x080a0000, size = 2936
Download [ ] 0% 0 bytesErasing page size 131072 at address 0x080a0000, page starting at 0x080a0000
Poll timeout 50 ms
Poll timeout 0 ms
Download from image offset 00000000 to memory 080a0000-080a0b77, size 2936
Poll timeout 50 ms
Poll timeout 0 ms
File downloaded successfully
Poll timeout 50 ms
Poll timeout 0 ms
dfu-util: Error during download get_status

$ particle flash --usb blink.bin
running dfu-util -l
Found DFU device 2b04:d006
checking file blink.bin
spawning dfu-util -d 2b04:d006 -a 0 -i 0 -s 0x080A0000:leave -D blink.bin
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
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 = 2936
Download [=========================] 100% 2936 bytes
Download done.
File downloaded successfully
dfu-util: Error during download get_status

Error writing firmware…dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!

dfu-util: Error during download get_status

The above means that it worked. You can safely ignore the dfu-util: Error during download get_status error as that is not a real error.

If your device is still blinking dark blue, then it does not have WiFi credentials yet.

@bko,

Yes, I have tryed this too, but my Photon got back to blinking magenta (Safe Mode) and the led D7 did not blink.

How did you run make? Did you include the platform option so it knows to build for a Photon? If not, that would give you the kind of thing you are seeing.

Try this with your device in dfu mode:

make PLATFORM=photon APP=blink program-dfu

@bko,

Yes, as follow below:

cd firmware/main
make PLATFORM=photon clean all
make PLATFORM=photon APP=blink

And after that:

  1. make PLATFORM=photon APP=blink program-dfu
  2. particle flash --usb blink.bin
  3. dfu-util -v -v -d 2b04:d006 -a 0 -i 0 -s 0x080A0000:leave -D blink.bin

But the result is the same

This command, with the part in dfu mode, compiles the blink APP and downloads it over dfu, so all the other commands are not needed.

1 Like

@bko,

I have tried with another device Photon that I have, it flash normally and worked fine the example “blink”, and does not returned any error like “dfu-util: Error during download get_status”.

Do you know the reason why that happened?

It might have more recent software that implements the get_status command in DFU mode.

That issue was closed last Sept. in this change: