Post Hard Fault safe mode

Hey,

I have some devices that are hitting a Hard Fault before calling particle connect.
I have solved that problem, but…
I’ve been scouring the forums and haven’t found a remote solution to fixing this remotely.
The devices in question are very difficult to get to physically.

Is there a setting or something to enter safe mode on “next boot” after a Hard Fault?
Basically we want to be able to OTA these devices if we flash a bad firmware that causes a Hard Fault.
(We’re improving our upgrade testing, but this would be a great recovery option if the worst happens).

Thanks!

In setup() of your firmware you can use the reset reason and check for RESET_REASON_PANIC.

If so you could enter safe mode by using System.enterSafeMode().

1 Like

Awesome, that sounds like a viable strategy!