Friday, March 3, 2017

57: Photon Error Recovery

Recently I compiled and flashed source with an error not detected by the compiler (I accidentally backspaced away the proper length of a "char" array variable). When the program ran I had just 1 second until the program wrote too many characters into the variable. As it happens, this caused a "Hard Fault" (see Particle Docs Guide).

I fixed my source error but could not flash the new version--the Photon switched to blinking red too quickly. I eventually went through the "Safe Mode" actions (a few times). I had the "particle" command loaded on my iMac. The thing that finally worked (in Mac Terminal) was--

First, hold down both the SETUP and RESET buttons. Then release the RESET button and wait for the LED to blink YELLOW. Then:

$ particle update
$ particle flash --usb tinker # Photon wired to USB port!

I wasn't interested in tinker but it allowed me to flash my corrected code.

My advice: do the Safe Mode and skip directly to USB download. Save yourself an hour.

No comments:

Post a Comment