Particle photon randomly crashing / indicating corrupt bootloader?

Hi,

Issue
I’m experiencing a reliability problem with a Photon, whereby it will (as far as I’ve analyzed) crash randomly with reset reason power_down and then reboot. However, sometimes it will also enter a mode in which the Photon’s onboard LED is off, but only a dimly lit LED at D7 remains on in blue.
Reading https://docs.particle.io/tutorials/device-os/led/photon/#no-status-led , leads me to believe this is a corrupt bootloader? But then again, if I reset the Photon using the momentary push button, it will restore normally and then go through the same.
A crash occurs never during application code being executed in setup(), but it does when entering loop(), sometimes immediately. Sometimes after 5 minutes.
I doubt whether application code can be blamed. Since I don’t think this could trigger power_down. I’d rather expect stack overflows / SOS and corresponding blinking.

Context
I’m using this Particle photon for a specific self-made digital clock that uses LEDs. Basically, it is an LED matrix controlled by SN74HC595s and I control the LEDs ‘brightness’ in an overall manner by indirectly PWMing an IRF640n from the Photon’s TX port. I’m open to share the source code and hardware schematic with you if needed. However I didn’t yet since because of what I tried (below) and what worked, I believe it may be caused by the specific Photon device.

What I’ve tried

I’ve tried the following steps

    • Stripping down the application code to a ‘bare minimum’ with no system thread, just automatic mode. Didn’t solve it.
    • Updating the device from 1.5.2 to 2.0.0. RC3. Didn’t solve it.
    • Put the device in safe_mode, then reflash application code. Didn’t solve it.
    • Measure voltage at Photon Vin, which is neatly set to 5.00 V. Didn’t solve it.
    • Switch the Photon with a different one, flashing the exact same application code and on firmware 1.5.2. This did solve it.

Now, since this worked, I’d like to know if I can reflash the OS / Bootloader (not too experienced with what is running other than my application code) and if that could solve it? Are there ‘health or diagnostics’ options I can run that could detect something like this? Also open to other ideas.

Since you updated the device from 1.5.2 to 2.0.0 it’s most likely not the bootloader as this would also refresh that.
However, you can download the bootloader binary from here and flash it via CLI

Listening Mode (will work with any preinstalled bootloader)

particle flash --serial <bootloader.bin>

or DFU Mode (only more recent versions)

particle flash --usb <bootloader.bin> -v

The same can be done with the device OS binaries (best via DFU).
If you want to flash the current default device OS version particle update -v would be the easiest.

However, when the issue sticks with a particular device chances are that it may be a hardware issue rather than device OS, bootloader or application firmware.

Sounds very much like a hardware fault to me.