P1 breathing white after flash

Hi all,

We are building a product with the P1 and having some issues getting our first run of boards up and running. We set up our board to be similar to the Photon; we have the RGB LED, blue LED, momentary switches and USB just like the Photon.

I powered up the board for the first time today and the P1 went into blinking blue: check.

I connected to the P1 over USB and set the WiFi credentials using a serial port terminal app. After rebooting, the P1 connected to the cloud and started breathing cyan: check.

Shortly after that, it started flashing magenta as it pulled down the OTA firmware update: check.

Here’s where things went weird. Before it was finished with the OTA update (it was only flashing magenta for a few sec, the OTA update took 10-20 sec on the Photons we’ve used in the past), it stopped flashing magenta and started breathing white.

Is that bad? What does breathing white mean?

I was able to get the P1 into DFU mode so I flashed v0.4.4 over usb to make sure it had the latest system FW. I could then get back to a breathing cyan. However, whenever I try to flash an OTA firmware, it does a similar behavior as the first OTA update: it blinks magenta for a few seconds then goes to breathing white. If I reboot, I get breathing magenta. Does that mean there’s a problem with the firmware that’s putting the device into safe mode?

I then tried flashing firmware that I’ve compiled locally. I have three firmwares that I’m trying, one is our prototype product firmware (communicates with an SPI peripheral, works fine on Photon), another is a simple test firmware that just dumps text out the serial port every 500 ms, and I also tried the “Blink an LED” sample firmware.

When I flash the firmware over USB, it goes to breathing white. Then if I reboot, it goes to breathing magenta. So same behavior as OTA.

Hopefully this post is comprehensible to someone. In summary, I’m unable to flash any firmware to our new P1 board. I’ve tried loading with the OTA tools and command line tools. Any tips would be greatly appreciated!

Andrew

Can you flash tinker to the device?

particle flash --usb tinker

And tell us how the LED is after that?

I tried flashing tinker over USB, but I get an error:

$ particle flash --usb tinker
Found DFU device 2b04:d008

Error writing firmware...no known App found.

I tried flashing OTA and I get a similar error:

$ particle flash 2f004... tinker
? Which type of device? P1
I don't have a tinker binary for P1.

Another observation that might be worth mentioning here is that there seems to be something strange going on with the P1 reset. As I mentioned above, we have a reset button wired up, but pressing it doesn’t seem to do a reset as one would expect. Pressing the reset button results in a transition to the breathing white state I mentioned in the first post. To reset the P1 I have to fully power cycle the board.

Ah…no tinker for P1. I’ve raised that issue internally with the CLI maintainers - for now could you download and flash the binary from here - https://github.com/spark/firmware/releases/download/0.4.3-rc2/tinker-p1.bin
Thanks :smile:

Ok a couple updates:

  • We are able to replicate the same behavior on a second board that we built up.

  • I’m able to flash tinker from the command line. After the flash, it goes to the breathing white mode. Then after a power cycle, it connects to the cloud and shows up as expected:

      P1-PROTOTYPE-02 [34004...............] (P1) is online
        Functions:
          int digitalread(String args) 
          int digitalwrite(String args) 
          int analogread(String args) 
          int analogwrite(String args) 
    

So it looks like the breathing white thing is a function of the P1 not resetting as I would expect based on the Photon behavior. But it appears that even when I get the breathing white, it has still programmed the firmware successfully and it boots normally after a power cycle.

  • So the secondary issue then is why am I getting safe mode when I try to load a custom firmware onto the P1? For all the other firmwares I’ve tried other than the tinker binary, I get safe mode after power cycle. Even for the “Blink an LED” sample project. Do I need to have some special compiler flags/macros, setup commands, or similar? What would cause the P1 to go into safe mode besides being told to go into safe mode by pressing the momentary switches? I’m using the web IDE and CLI tool, do I need to switch to Particle Dev?

Thank you for your help!

If you are flashing firmware from the cloud, then install the latest updates with

# put device in DFU mode
npm install -g particle-cli
particle update

If you are building locally then you can update the system modules by building from the modules folder. You’ll find detailes in the build docs.

Cheers,
mat

I upgraded my particle-cli package from 1.6.9 (version used for all previous activity) to 1.7.0, but I still get the same results.

Just to clarify, I’m trying to program firmware using two separate methods, both of which are failing and have the same result:

  • Building and programming OTA with the Web IDE
  • Building and programming using DFU with the particle-cli tool

For some reason, the only firmware that I can get to “work” is the precompiled tinker binary you linked to. All other firmwares go into safe mode after connecting to the cloud. This happens whether the firmware is compiled with the web IDE or the command line tool.

Can you confirm that no special code is required in the project to compile for P1?

Ok, so you’re now on safe mode, and not breathing white - that’s good progress.

There is no special code needed - this should just simply work.

Can you confirm you did run particle update? This should be all that is needed to update the system firmware. The only other cause of safe mode is if the cloud is compiling for a different platform, so let’s check that.

When using the IDE, please be sure to have your P1 selected in the “devices” drawer and do verify it’s listed under a heading P1. Can you also verify it’s listed as a P1 when running particle list.

Thanks :slight_smile:

Yes I did run particle update on both of the devices. It sounds like it must be that the firmware is getting compiled for another platform.

When I first registered the P1’s, they showed up as “Unknown” in the Web IDE. Now they show up under the P1 heading though. The behavior with particle list was the same: showing up first as Unknown, then showing up as P1.

I downloaded Particle Dev, and the devices are both listed as Unknown. They have “?” icons next to them, whereas my Cores and Photons have “C” and “P” icons.

When I compiled firmware from the command line with particle compile, I did specify P1:

particle compile p1 ./blinkled

this produced an output file named p1_firmware_1441920921437.bin

So it really seems like I should be compiling correctly. In the web IDE I select the P1 device, and in the command line I specify P1. But, I always get safe mode!

We are still having this same issue where we can’t get past Safe Mode with our P1. Does anyone have any ideas we could try?

Thanks!
Andrew