Safe mode after particle flash, seen across multiple devices


#1

Hi,

Seen safe mode triggered twice. It never completes booting.

{"name":"spark/flash/status","data":"started ","ttl":60,"published_at":"2017-08-12T01:25:22.044Z","coreid":"58003f000f51353338363333"}
{"name":"spark/status","data":"offline","ttl":60,"published_at":"2017-08-12T01:26:10.686Z","coreid":"58003f000f51353338363333"}
{"name":"spark/status","data":"online","ttl":60,"published_at":"2017-08-12T01:26:12.033Z","coreid":"58003f000f51353338363333"}
{"name":"spark/status/safe-mode","data":"{\"p\":6,\"m\":[{\"s\":16384,\"l\":\"m\",\"vc\":30,\"vv\":30,\"f\":\"b\",\"n\":\"0\",\"v\":7,\"d\":[]},{\"s\":262144,\"l\":\"m\",\"vc\":30,\"vv\":30,\"f\":\"s\",\"n\":\"1\",\"v\":100,\"d\":[]},{\"s\":262144,\"l\":\"m\",\"vc\":30,\"vv\":30,\"f\":\"s\",\"n\":\"2\",\"v\":100,\"d\":[{\"f\":\"s\",\"n\":\"1\",\"v\":100,\"_\":\"\"}]},{\"s\":131072,\"l\":\"m\",\"vc\":30,\"vv\":26,\"u\":\"153790B1DF94A332C290930076EFF123B0CB9D87AC11619491D58B6120185C80\",\"f\":\"u\",\"n\":\"1\",\"v\":4,\"d\":[{\"f\":\"s\",\"n\":\"2\",\"v\":108,\"_\":\"\"}]},{\"s\":131072,\"l\":\"f\",\"vc\":30,\"vv\":0,\"d\":[]}],\"f\":[],\"v\":{}}","ttl":60,"published_at":"2017-08-12T01:26:13.902Z","coreid":"58003f000f51353338363333"}

The reported symptom is that it stays purple status light.

I’ve realised that particle-cli was out of date, and this prior post suggests particle update via DFU mode is the fix. Is there any other way to remotely trigger the appropriate update? I did particle-cli update, tried particle compile again, tried flashing that and it does trigger an update but goes back to safe mode.

Any words of wisdom?

PS, I’ve got fingers crossed that the response isn’t along the lines of ‘if particle update their cloud firmware and you don’t update particle-cli but then flash a device it will brick it’


#2

Some more info:

Devices with issue were running 0.6.0-rc.1

Flashing a very basic test code that simply does a particle publish in setup and every 15 seconds in loop works fine if I use build.particle and select 0.6.0-rc1 as the firmware target.

I just tried 0.6.0-rc2 and it flashed, triggered safe mode, started flash again, but worked.

Safe mode output if I try a straight upgrade is:

{"name":"spark/status/safe-mode","data":"{\"p\":6,\"m\":[{\"s\":16384,\"l\":\"m\",\"vc\":30,\"vv\":30,\"f\":\"b\",\"n\":\"0\",\"v\":7,\"d\":[]},{\"s\":262144,\"l\":\"m\",\"vc\":30,\"vv\":30,\"f\":\"s\",\"n\":\"1\",\"v\":100,\"d\":[]},{\"s\":262144,\"l\":\"m\",\"vc\":30,\"vv\":30,\"f\":\"s\",\"n\":\"2\",\"v\":100,\"d\":[{\"f\":\"s\",\"n\":\"1\",\"v\":100,\"_\":\"\"}]},{\"s\":131072,\"l\":\"m\",\"vc\":30,\"vv\":26,\"u\":\"40BCEA59C845F6D97AB200C4F1D86A142B4EB7236F5D7BE326F668DFBD48D135\",\"f\":\"u\",\"n\":\"1\",\"v\":4,\"d\":[{\"f\":\"s\",\"n\":\"2\",\"v\":102,\"_\":\"\"}]},{\"s\":131072,\"l\":\"f\",\"vc\":30,\"vv\":0,\"d\":[]}],\"f\":[],\"v\":{}}","ttl":60,"published_at":"2017-08-12T02:30:45.069Z","coreid":"330034000f51353338363333"}

#3

@mterrill, are the photons in safe mode or in self-healing mode, upgrading the firmware to match your app’s version?


#4

They were frozen effectively - though I could issue another flash and they’d listen and try starting flash.

From a fair bit of experimentation I’ve found:

0.6.0-rc1

  • Upgrade to 0.6.0-rc2
  • Upgrade to 0.6.0
  • Upgrade to 0.6.1 (I did to be safe)
  • Upgrade to 0.6.2 with actual firmware

Some paths that didn’t work:
0.6.0-rc1 to 0.6.0, freezes, required customer to reset power
0.6.0-rc1 to 0.6.1, halted per above debug outputs
0.6.0-rc1 to 0.6.2, halted per above debug outputs


#5

I’ll write a process and a few tiny firmware bundles that post their version when they go online rather than my normal app code. It’ll intercept 0.6.0-rc1 and go the path I found to work without halting.

Incidentally, I’ve upgraded a few hundred of these devices over the past 3 weeks and I think its only the last 24 hours that this problem has popped up. Strange.


#6

Interestingly just had it stall unresponsive (to another flash via cli or build.particle) when doing 0.6.1 to 0.6.2 with real application code

edit: required power reset and about 5 mins of loops and it sorted itself. the issue there is the 0.6.2 flash was not able to upgrade one minor version…