Can a Photon be forced into dfu mode via serial command?

Hi Everyone,

I am hoping this feature exists. It would help a lot with speeding up the initial programming of our device in a gang fashion.

Another alternative that would also work great is if I could manually set all the devices to dfu mode via the button simultaneously and then be able to target each device via the dfu-uti. When I try this I get an error message that more then 1 dfu device is connected and the program bombs.

Hi @HardWater

I believe that you can force a Photon into DFU mode by opening the serial port at 14400 baud on the host side. There are a couple of threads about how to modify the Particle CLI (if you want to) in order to force that.

The limitation of DFU only targeting one device at time in DFU mode is a limitation of the DFU-Util program, I believe, and is not related to Particle.

1 Like

@bko, I can vouch for the 14400 baud method working.

@HardWater, with the 14400 baud trick, you can enable each device one at a time so DFU will work just fine. I have actually re-flashed a locally compiled image on a USB connected Photon while I was remotely connected to my PC from work!

3 Likes

Hey @peekay123 & @bko,

How sure are you that this 14400 method to get into dfu is reliable. I had it working for a few units then it stopped functioning. I am on a windows pc I have tried rebooting the pc , starting with new photons right out of unopened boxes, doing factory resets etc. I had one of my coworkers thy to set the baud rate to 14400 on his mac to see it it worked there but no go also.

One thing that had me a bit surprised is when this 14400 setting worked I had not passed any data.
How does the photon recognize that the PC has switched to 14400 baud does the PC send a message that it has changed baud rate to the photon at the old baud rate?

Hi @HardWater

Maybe @mdma can give more input here. My understanding is that when the Photon as a USB device “enumerates” (which is one particular phase of starting a USB peripheral) it reports as a serial device and the host can send it a “baud rate” but this is only notional since the transfer is over USB.

There was a firmware update that added this feature, so it could be possible that the devices that don’t work predate that update to the shipping firmware image.

1 Like

It was added in 0.4.3 firmware, so please be sure you are using at least that version. Serial over USB is purely virtual, so things like baudrate are simply sent as messages containing connection metadata, and don’t actually affect the rate of transfer. These messages are recieved by the device, which uses the baudrate change as a trigger to enter dfu mode.

2 Likes