I work on a small battery-powered location tracker that charges on a wireless pad. One unit came back from the field because it ticked on the charger. Tik, tik, tik, about twice a second, and it never charged. Then my own development unit did the same thing after I let its battery run completely flat. Three different chargers, same sound.
The tick was the device starting and dying, again and again. Here is how I measured it, what fixed it, and where I fooled myself on the way.
What the tick really is
With a dead battery on the pad, the supply rail came up to 3.29 V, stayed there for about 0.45 seconds, fell to 0 V for about 0.1 seconds, and then came back. Every time the reset reason was a plain power-on.
One test told me where to look. When I halted the chip with the debug probe, the rail stayed up. So the charger could hold the supply. It was my own firmware, starting up, that pulled it down.
flowchart LR
A["Pad powers<br/>the unit"] --> B["Rail up<br/>3.29 V"]
B --> C["Firmware<br/>starts"]
C --> D["Start-up load<br/>and beep"]
D --> E["Rail falls<br/>to 0 V"]
E --> A
The small beep at start-up is the tick. The buzzer never gets to finish it.
One reading per second sees nothing
My first watcher asked the probe for the target voltage once a second. It showed a healthy rail the whole time, because a 0.1 second gap almost never lands on a sample.
The probe can answer much faster if you stop it from connecting to the chip and feed it a file with thousands of status commands. That gave me about 1,500 voltage readings per second, with no extra hardware on the bench.
# st8k.jlink holds 8,000 lines, each one just: st
JLinkExe -device <your-chip> -if SWD -speed 4000 \
-autoconnect 0 -CommandFile st8k.jlink | grep -o 'VTref=[0-9.]*V'
If a fault repeats faster than your tool samples, the tool will tell you everything is fine. Check the sample rate before you trust a flat line.
The fix is about order
Three small changes in the start-up code:
- The charger is set up first, before anything else draws current.
- The interrupt priority for the charger bus is set before the Bluetooth stack starts.
- The start-up beep is skipped when the battery is flat and the unit is on the charger.
| Firmware | Power drops in 5 s | Result |
|---|---|---|
| Before | 8 to 9 | Ticks, never charges |
| After | 0 | Boots once, charges |
I booted the fixed build three times on a dead battery, and it was clean each time.
I still cannot name the exact load that pulls the rail down. One cross-check was neutral: the old firmware, flashed back after 45 seconds of charging, did not tick. And a unit that is already ticking cannot take an over-the-air update, so the fix only protects units before they get there.
Where I went wrong
A flat battery is test equipment too
The slowest part of this bug was not the code. To test a fix for a dead battery you need a dead battery, and you need it again for every attempt. A healthy device fights you here: the lower the voltage, the less it draws, so the last few percent take the longest. My drain mode switched on everything that uses power, and even then the unit reset near 3.0 V and I had to wait for the rest.
A proper lab does not wait. As far as I know, there are three common ways around it:
| Method | What it does | Good for |
|---|---|---|
| Battery simulator | A power supply that behaves like a cell at any charge level, with its internal resistance | Repeating the same "2.9 V and weak" start a hundred times |
| Electronic load | Drains a real cell at a set current down to a set voltage | Getting a real cell to a known state fast |
| Pre-conditioned cells | A box of cells already taken to known levels | Tests where the real chemistry matters |
The simulator is the interesting one for a bug like this. A weak battery is not only a low voltage. It is a low voltage that sags when you pull current, and that sag is exactly what killed my rail. A plain bench supply set to 2.9 V will not show it.
Keithley and Keysight sell full battery simulators. Small teams often use a power profiler such as the Nordic PPK2 or an Otii in source mode. Those give you the voltage, but only part of the weak-cell behaviour.
There is a catch for a sealed product. The battery sits behind the charger chip inside a closed housing, so a simulator needs an opened unit with wires on the battery pads. That is my next step: with a simulated weak cell I can finally find which load pulls the supply down.
The whole thing took two days, and most of that time went on getting a battery flat enough and on trusting readings that were too slow. Next time I measure the rail fast on the first day, and I write the diagnosis into the issue only after the numbers agree with it.

Related notes
Sending Ableton locators from Max for Live to a cloud API
How I sent song sections from a Max for Live device to a small FastAPI service on Cloud Run, stored them in PostgreSQL and showed them in the browser.
One Slack channel for every deploy and alarm
I moved a client's deploy notices and CloudWatch alarms from my old agency Slack into their own workspace, with one message format for four apps. The format was agreed on an HTML mock before any PR merged.



