Duo - Corrupt Keys


I have experience 3 cases now where the device keys get corrupted the below is required to recover.

particle keys server

I received the following response from particle regarding this issue and the reply is suggesting it is common to the Duo as well. Is the following library relevant to the Duo and has anyone had success with it to mitigate the corrupted keys issue?

The lost keys, lost settings, and lost boot loader may be variations of this problem:

In some situations, it tends to be a low-power brown-out type of situation that occurs. It appears that certain flash sectors can be erased. Sometimes, it’s the sector that contains settings (like Wi-Fi settings or device keys), and sometimes it’s the boot loader.

When the boot loader gets erased, the only thing that happens is the blue D7 LED will light dimly, and it will not respond to other buttons. When this happens, we typically replace the device, though users can typically fix it with JTAG/SWD programmer.

This has a tendency to occur on Electrons mainly because more of them operate on battery power. It can also occur on Photons. It has also been seen on a RedBear Duo, which we don’t even manufacture. All of these devices have similar STM32F205 processors, however. It also is not specific to battery power, it can happen when using a power adapter as well, though much less frequently.

Also, it’s not simply running at a low voltage. The processor has protection for that, and we’ve tried running the devices at all voltage levels and can’t make the problem happen. It appears to be some combination of factors that is quite elusive.

For battery powered devices, the best workaround until the problem is solved is to make sure you don’t run until the power goes completely out. Instead, use sleep modes to conserve power until sufficient power is available again. I recommend running with SYSTEM_MODE(SEMI_AUTOMATIC) and checking the battery SoC at boot or after waking from sleep. If it’s below 15 to 20% SOC, immediately go back to sleep and do not turn on the modem.

We’ve added code to system firmware 0.7.0 to be able to recover the server key automatically if this occurs, as well, though this may not work in all cases.

For automatically restoring your device private keys, this library can be used:


Thanks for the topic, it is relevant to me. More details here.