Flashing Application Firmware to Photon Directly With DFU-Util Command?

I am creating a Windows batch file to automate some steps for flashing system and application firmware for our Photons. Everything was going smooth and it flashes the system firmware fine, but the script kept hanging when it got to the line:

particle flash --usb application.bin

I have Particle CLI installed and if I enter the above command on its own it seems to work fine, so I’m not sure what the problem there is. However, while looking at the output from the command prompt it looked as though this particle flash command was actually just a shortcut for:

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

In my batch file, when I switched it over to this dfu-util command directly everything works great. My question is, is there any risk or things I should watch out for in using this direct dfu-util command versus the Particle CLI command, or is this fine to use for flashing application firmware?

Seems to be one of the suggested ways of doing things, so shouldn’t hurt.

Great, thanks @Moors7!

I had seen the recommended dfu-util commands for flashing the system firmware, but I wasn’t able to find the specific commands for doing the same with application firmware (until I analyzed the output from my command prompt).

The CLI does sometimes prompt for input, which may have happened when invoked from a script causing your script to block.

1 Like