Unfortunately a Dim D7 is caused by an erased bootloader and can only be fixed by JTAG or SWD. It can’t even be fixed by USB.
The lost keys, lost settings, and lost boot loader may be variations of this problem:
When some situation, it tends to be a low-power brown-out type of situation, 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 developers 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. 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. Using old phone chargers with loose USB connectors is the most likely scenario for powered devices.
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.