Hi all,
We have recently seen a number of different reports that an Electron will no longer boot up after powering them from a battery that has completely discharged. The type of battery and where it is applied varies. Here are a few related posts:
We have investigated this since the first report without success in reproducing, and after seeing more reports we ramped up the investigation yet again with little success. This is a top priority for us at this time, and since this issue remains elusive we need your help. We're placing a bounty of $200 in Particle store credit on this issue in the hopes that some of you in the Community have more information that can help us find the root cause of this issue.
Let's break down the details of the problem and tests done to date, then we'll talk about the bounty!
Problem
The Electron will not boot properly after the battery discharges completely. This could be the included LiPo battery, or a different one attached to the VIN and GND pins. One report simply suggested: the on-board blue D7 LED is only dimly lit after leaving the electron in a drawer for a month. This may indicate that some corruption has occurred in the bootloader, DCD, system or user flash memory. Pressing RESET does not clear the problem. The electron may not be able to enter DFU mode, or if it can enter DFU mode some other part of flash memory is corrupted. In general, it could be a hardware issue, firmware issue or most likely an interaction between the two.
Bounty Goal
There are ways to forcibly corrupt the firmware on embedded devices, but the goal with this bounty is to identify a repeatible way in which the Electron will no longer boot properly as described above.
What data to collect?
- Ensure you are starting with a known base system firmware (0.4.8-rc.6 is the firmware Electrons are manufactured with and 0.5.2 is the current default).
- There are an infinite number of things you could test for in user firmware. If you think some code is more prone to making this issue occur, go ahead and use it but keep it limited to things most users would do. I.e., do not attempt write low level code that specifically erases memory... that's invalid. Do use our Documented Firmware Reference for the Electron, everything in there is fair game! Whenever this has been reported in the past, the user has reported that they weren't doing anything special in their code. Some of them might have even been running Tinker. One of the posts above even has posted code.
- Record voltages (and currents if you have enough equipment)
- Record times
- Record cycles
- Record which pins are hooked up to which things.
- Take pictures or video of the setup
- What steps lead up to the Electron not booting any longer? Can you repeat them after backup/restore (below)?
- Maybe you end up shipping us your hardware for post mortem.
- Take a snapshot of firmware before and after testing. Before should be easy with a DFU command (
dfu-util -d 2b04:d00a -a 0 -s 0x8000000:0x100000 -U electron_backup.bin
), but after could require a JTAG tool if your bootloader is not operational. Note: Be sure not to post your Electron flash image on the forum since it contains IDs and keys which belong to you, not including any compiled firmware you may have written. Please email that with your data below, but there is no need to send a pre-death image without a post-death image or hardware. - More information is better, as long as it's organized
- Please email your data collected to , or you may post it here if you don't have a complete entry and want to share your findings so that others may learn and build up the solution.
- If you have a JTAG tool, you can restore your Electron with the combined binary image found here: (0.4.8-rc.6), and make sure to upload a copy of the Flash memory (post-death) before a complete erase! You will have to also run
particle keys doctor <device_id>
with the CLI after your Electron is back up and running again to connect to the Cloud.
The following are all of the tests I have done to date, these were performed on a G350 Electron running v0.4.8-rc.6 firmware with Tinker
Test #1 (manual - LiPo on JST):
Setup: Discharge supplied lipo to 2.85V (it’s protection cut-off voltage).
- Revive battery with a bit of charging voltage supplied from VIN.
- Remove VIN source.
- Electron will boot and battery will drain again until the cut-off voltage is reached.
- While the battery is attempting to reach it’s cut-off voltage, the modem will turn on and draw a higher current that causes the battery to sag very rapidly. This causes the STM32 to reset, because the process repeats itself over and over very rapidly with the RGB led flashing white. Eventually after ~14 seconds, the battery cut-off voltage is reached and the battery goes into a HI-Z state.
- These steps can be easily repeated over and over.
Results Test #1
- The bootloader or DCD does not appear to be corrupting, however a test of one is hardly a test at all. An automated test rig was set up to apply the charging voltage over and over (Test #2), with a dwell period of 60 seconds to ensure the battery completely drains again.
- Electron was also powered from Li+ and VIN separately with no ill effects.
- The Electron will shut off at about 2.4V on Li+. This is well below the battery cut-off voltage of 2.85V, which is the protection circuit opening the battery terminals (HI-Z). A charging voltage must be applied to the battery again to kick the protection circuit out of the HI-Z state.
- The Electron will shut off at just below 4.33V on VIN without a battery attached on Li+. With a battery attached on Li+ it will stop charging a dead battery when VIN falls below 3.8V, after which the battery will take over powering the electron until it’s dead again at 2.85V.
Test #2 (automated cycling - LiPo on JST):
Setup: Discharge supplied lipo to 2.85V (it’s protection cut-off voltage).
- Revive battery with a bit of charging voltage supplied from VIN for 3 seconds.
- Remove VIN source for 60 seconds.
- Electron will boot and battery will drain again until the cut-off voltage is reached.
- While the battery is attempting to reach it’s cut-off voltage, the modem will turn on and draw a higher current that causes the battery to sag very rapidly. This causes the STM32 to reset, because the process repeats itself over and over very rapidly with the RGB led flashing white. Eventually after ~14 seconds, the battery cut-off voltage is reached and the battery goes into a HI-Z state.
- These steps are automated over and over using a Particle relay shield powered by a Photon ( Photon code here )
Results Test #2:
After 1088 cycles of 3 seconds on, 60 seconds off, the electron still boots fine. It doesn’t have enough charge to make a connection though, so Test #3 will expand on this.
Test #3 (automated cycling - LiPo on JST):
Same as Test #2, but with 30 seconds on and 5 minutes off. This allows the electron to boot, connect to cellular, and handshake with the Cloud before it discharges.
Results Test #3:
30 seconds of charging seems to be enough to get it to connect to the cloud in most cases, and 5 minutes is more than enough to discharge it all of the way again. This one ran for several days, over 1175 cycles, and still boots fine!
Test #4 (automated cycling - 6V SLA on VIN):
Same as Test #3, except set up 6V SLA battery now to only apply power to VIN (for enough time to allow the electron to connect to the cloud) with the LiPo battery detached, then charging current to the battery is removed and it’s allowed to discharge. I’m using a simple 6V sealed lead acid battery for this test, as it will discharge similarly to many other battery types.
Results Test #4:
1085 cycles and the electron was still booting and connecting to the Cloud.
Test #5 (automated cycling - 6V SLA on VIN):
Same as Test #4, except off time is set to 1 hour instead of 5 minutes.
Results Test #5:
After a week of testing (about 200 cycles) it hasn’t been an issue. Soon after that I saw VIN is at 5V and the electron was off (dead). If I manually connect my relay I terminals to deliver charge, I get about 0.5A or so, but no red LED on the electron and no other dim blue LED either. The 3V3 output was not reaching more than about 2.5V or so with 5V applied to VIN. After plugging in a battery to Li+, the unit powered up instantly. This appears to have been some temporary latch-up condition with the PMIC.
So those were my tests.... many cycles later and yet hardly the results we were after
We are issuing the following bounty:
- If you (1) submit your findings in a well documented format (see What data to collect? above), and (2) your findings identify or lead to the discovery of the root cause of this issue; we will (3) send you a $200 credit for Particle stuff (Electrons, Photons, accessories, or kits).
- If multiple findings are submitted, the first that we accept will get the bounty. If we conclude that multiple individuals contributed to the final root cause discovery, we'll split the bounty up accordingly and each entry will also receive a free Particle T-Shirt to reward your team effort !
Thanks for your help on this one, and if you have any questions, please let me know.
Firmware for the Electron can be found here, however you should not need to build firmware locally to encounter this issue. You may want to have a peek at the source code though.
For testing, you can try the firmware that's shipped with all manufactured Electrons (0.4.8-rc.6 or try one of the latest releases in firmware 0.5.2 is the current default)
If you'd like to discuss below, please do!
For anyone looking to mitigate the risk of this issue (it feels very low though), you can check out the techniques employed in this electron-maintain-capacity app: