DFU flash firmware

the docs explain how to update the system firmware using dfu-util:

https://docs.particle.io/reference/firmware/photon/?fw_ver=0.6.2&cli_ver=1.22.0&electron_parts=3#programming-and-debugging-notes

but how do you DFU flash your app?

That would be particle flash --usb NameOfFile.bin :slight_smile:

1 Like

@Moors7

that’s my problem… I cannot (and I have tried hundreds of times un-installing and installing) use the particle cli. It simply won’t run on my mac.

the device won’t connect to my WiFi likely because of the app I flashed on the device.

so again, I want to flash my app using dfu-util… is it possible?

It should be, though I don’t know the command on the top of my head (I usually use the CLI). Trying to figure it out.

Have you tried Safe Mode already (since that won’t run your user app) :speak_no_evil:?

yes, but since it is not connected/ing to my WiFi, I just get green flashing…

$ node -v
v8.9.4
$ npm -v
5.6.0

I try to install particle-cli:

$ sudo npm install -g particle-cli
Password:
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
/Users/browerjames/.npm-global/bin/particle -> /Users/username/.npm-global/lib/node_modules/particle-cli/bin/particle.js
+ particle-cli@1.27.0
updated 1 package in 5.955s

$ particle -v
! Error loading module 'serialport': Could not locate the bindings file. Tried:
 → /usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/serialport.node
 → /usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/Debug/serialport.node
 → /usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/Release/serialport.node
 → /usr/local/lib/node_modules/particle-cli/node_modules/serialport/out/Debug/serialport.node
 → /usr/local/lib/node_modules/particle-cli/node_modules/serialport/Debug/serialport.node
 → /usr/local/lib/node_modules/particle-cli/node_modules/serialport/out/Release/serialport.node
 → /usr/local/lib/node_modules/particle-cli/node_modules/serialport/Release/serialport.node
 → /usr/local/lib/node_modules/particle-cli/node_modules/serialport/build/default/serialport.node
 → /usr/local/lib/node_modules/particle-cli/node_modules/serialport/compiled/8.9.4/darwin/x64/serialport.node
Please reinstall the CLI again using npm install -g particle-cli
$ 

I’ve installed and uninstalled Node and npm dozens of times… perhaps the latest versions are not appropriate for the current CLI?

It seems that Serialport is acting up again. Considering you’re on a Mac, have you tried po-util by @nrobinson2000? He seems to have better luck installing the tools in *nix environments. I, unfortunately, haven’t got any experience with Mac.

1 Like

I’ve seen my what used to be reliable Photon do a lot of Flashing Green lately after some firmware and CLI updates and I’m not sure why it’s happening but it’s less reliable than it used to be.

Try unplugging your WiFi router to reset it and see if the Photon will connect then. I’ve had to reset the WiFi hotspot to get a flashing green Photon to reconnect to the internet. Maybe its the same for you? If so then maybe something has been changed that is causing this for both of us.

I already mentioned, it was my firmware that is preventing the connection to WiFi.

I just did, and you can flash firmware using:

po photon dfu

making sure your firmware is called firmware.bin and in a subdirectory called bin

1 Like

Sorry, I figured the “Likely because” meant you were not sure that was the cause of your problems.

I’ve seen the same flashing green issue with code that used to be stable, with the only difference being I’ve upgraded to new firmware.

1 Like