Ask anyone who programs ECMs for a living what kills a flash, and nobody says "the software". They say voltage.
What actually goes wrong
Writing a calibration is not one big transfer. It is thousands of small write-and-verify operations against the ECM's flash memory, and the module needs steady power for all of them.
If supply voltage dips below what the ECM expects — even briefly — the module can abort mid-write. What you are left with is a control unit holding a partial calibration: not the old one, not the new one. Some ECMs recover on their own and let you retry. Some come back only through a recovery procedure. Neither is how you want to spend the afternoon.
What "steady" means
Hold the system above roughly 12.5 V for a 12-volt system, for the whole session. Two details matter more than the number:
- No dips. A steady 12.6 V is better than something that swings between 14 and 12.1.
- For the whole write. Not "it was fine when we started".
Why the truck fights you
Even with the engine off, a modern truck is not asleep. Dash modules stay awake, the interface itself draws power, and the ECM you are writing to is working harder than it does at idle. Add a cab heater or a light left on and a marginal battery bank sags.
Cold makes it worse: a battery that reads fine at 20 °C can lose a meaningful chunk of its cranking ability near freezing.
What to do about it
Put it on a charger. A proper bench charger or maintainer on the batteries, connected before the session and left there. This is the single highest-value thing you can do.
Do not just idle the engine. It seems logical — the alternator is charging, after all. But some procedures require key-on-engine-off, and an alternator's output is not as clean as a charger's. Follow whatever the procedure calls for; do not improvise.
Turn off what you can. Lights, HVAC blower, inverters, anything on an auxiliary circuit.
Check the batteries beforehand if the truck has been sitting or the batteries are old. A load test takes minutes. Finding out mid-flash costs a lot more.
If the write does get interrupted
Stop. Do not cycle the key repeatedly and do not start pulling fuses. Tell us what happened and what the tool showed. Most interruptions are recoverable if the next step is the right one — and much less recoverable after three wrong ones.