[SOLVED] Electron suddenly unable to flash via usb, now in confusing state

5 weeks ago I powered up my first electron (after experience with the photon) and all was good. Flashing over cellular, flashing over usb,publishing events, all was good.

Then, this week, flashes over usb were not working. They would send the device into safe mode however simple the program. Flashes over the air still worked. I suspected I was building bad bins somehow but could not figure that out. My method was:

particle compile electron hello_world.ino 
particle flash --usb <electron...bin>  # i removed all old bins, triple checked the file, etc...

I really didn’t want to do all my flashing over cellular, so this morning I decided to try other things

particle update

That looked promising – I figured it might be a firmware mismatch or something, and this looked harmless. Got it from the docs.

Now my electron is in a mode I don’t see documented.

  1. flashing cyan (1 sec), rapid flash cyan (2sec), rapid flash red(<1sec), flashing cyan (2sec) repeat…
  2. I can not get it into safe mode. When I try, I release the reset button, I get blinking purple, I release mode button, I get one breath of white, followed by the sequence in #1
  3. I can get it into dfu-mode, and have retried the “particle update” – no change
  4. If i do a reset, it goes right to pattern #1 above
  5. If i remove power, it blinks green for a while, then goes to #1 pattern
  6. I am still able to do all expected activities with a photon, same computer, etc… yes, I’m carful to check that I am compiling for the right target device.

More details:

$ dfu-util -V
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

$ particle --version
1.8.16

    $ particle compile electron hello_world.ino 
    
    Compiling code for electron
    
    Including:
        hello_world.ino
    attempting to compile firmware 
    pushing file: hello_world.ino
    Memory use: 
       text	   data	    bss	    dec	    hex	filename
       4972	      8	   1532	   6512	   1970	
    grabbing binary from: https://api.particle.io/v1/binaries/5842f32c899efe67032d431a
    Compile succeeded.
    Saved firmware to: /Users/dandixon/spark/interlock/electron_firmware_1480782634530.bin
           
     $ particle flash --usb ./electron_firmware_1480782634530.bin 
        Found DFU device 2b04:d00a
        checking file  ./electron_firmware_1480782634530.bin
        spawning dfu-util -d 2b04:d00a -a 0 -i 0 -s 0x08080000:leave -D ./electron_firmware_1480782634530.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
    
    dfu-util: Invalid DFU suffix signature
    dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
    Deducing device DFU version from functional descriptor length
    Opening DFU capable USB device...
    ID 2b04:d00a
    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 = 0x08080000, size = 4980
    Download	[=========================] 100%         4980 bytes
    Download done.
    File downloaded successfully
    
    Flash success!

I now also tried the manual firmware update called out here (for mac):
https://docs.particle.io/support/troubleshooting/firmware-upgrades/electron/
This seemed to go well.

Same result. Although, the rapid red part of the pattern now looks more purple/magenta – not sure if that is a change. Also, it did eventually settle out into a steady blink-cyan mode after a few minutes.

$dfu-util -d 2b04:d00a -a 0 -s 0x8020000 -D system-part1-0.5.3-electron.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

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Deducing device DFU version from functional descriptor length
Opening DFU capable USB device...
ID 2b04:d00a
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 = 0x08020000, size = 122916
Download	[=========================] 100%       122916 bytes
Download done.
File downloaded successfully

$ dfu-util -d 2b04:d00a -a 0 -s 0x8060000:leave -D system-part2-0.5.3-electron.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

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Deducing device DFU version from functional descriptor length
Opening DFU capable USB device...
ID 2b04:d00a
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 = 0x08060000, size = 122436
Download	[=========================] 100%       122436 bytes
Download done.
File downloaded successfully

I think you have two (maybe three) separate problems.

First, your CLI is way out of date; the current version is 1.18.0.

sudo npm update -g particle-cli

This is important because particle update does not update to the latest firmware. It updates to the current firmware at the time your CLI version was released. So keeping up-to-date with the CLI is important.

You’re going into safe mode (blinking magenta) after flashing when building with the CLI because the particle compile builds against the latest release system firmware by default, currently 0.6.0. Since your Electron is running something older, you go into safe mode. You can change this behavior by doing:

particle compile electron --target 0.4.8 hello_world.ino 

The red flash may be a keys issue. Hold down the MODE button until it blinks blue, then do a:

particle identify

Save the device ID; you’ll need it next.

Then put the Electron in DFU mode (blinking yellow) and do:

particle keys doctor YOUR_DEVICE_ID
particle keys server

It’s probably also a good idea to update your Electron to 0.6.0 and get it into a known state while you’re at it. With the Electron in DFU mode (blinking yellow)L

particle update
particle flash --usb tinker
1 Like

That was it! I was unaware that the firmware update was tied to the CLI version. Good to know.
An update of my CLI, and a “particle update” on the device did the trick. No issue with keys it seems.

Thanks SO MUCH for the help and the detailed reply. I’m running again!!

-dan

2 Likes

Thanks @rickkas7 for the help!