The short answer: a BMS firmware specification is incomplete until it states four things in writing: which conditions count as a fault, what the pack does when the microcontroller resets, whether each fault latches or clears on its own, and how each behaviour is proved by fault injection rather than assumed. Watchdog, brownout and fault-latch are not three separate features to be added later. They are one recovery scheme, and if the scheme is not defined at the specification stage the behaviour is decided by whichever default the chip vendor shipped with.
This article is written for the embedded firmware or electronics engineer who has to write that specification, and for the buyer who has to accept it. It is deliberately narrow. It covers what the BMS does when its own processor misbehaves: the watchdog that catches a hung loop, the brownout that catches a supply dip, the latch that stops a fault from clearing itself, and the policy that decides what happens next. It does not cover how fault flags are carried on the bus, how the firmware image is versioned, or how the pack behaves under electromagnetic disturbance; those are separate problems with their own controls, and the boundaries are set out below.

Keep runtime fault handling separate from configuration and communication
Three neighbouring topics get confused with this one, and the confusion is why fault handling often ends up undocumented.
Firmware configuration control is about what is inside the image and which unit got which version: the binary hash, the parameter set, the write locks and the change record. It answers “what firmware is on this pack”. It does not answer “what the firmware does when it resets”. A pack can have perfect firmware configuration control and still have no defined recovery behaviour, because the two controls live in different documents.
The communication protocol is about how fault state is reported to the host: which register carries which flag, how the host is told that a protection has tripped, and what happens when the link goes quiet. That is covered in our guide to BMS communication over CAN bus and SMBus. A timeout on the bus is not the same event as a watchdog reset inside the BMS, even though both can look like “the pack stopped talking”.
Electromagnetic compatibility is about whether outside interference can disturb the protection functions in the first place, which is the subject of EMC compliance for BMS-equipped packs. Immunity testing may show that a disturbance causes a reset; this article is about what the pack is specified to do when that reset happens.
The four fault classes and the safe state
Before a watchdog or a latch can be specified, the faults have to be grouped by what the pack must do about them. Grouping by severity rather than by sensor makes the recovery policy tractable: the number of classes stays small, and every new fault that is added later can be assigned to an existing class instead of inventing a new behaviour.
| Class | Typical triggers | Required pack action | Recovery class |
|---|---|---|---|
| Transient measurement fault | A single out-of-range sample, a spike on a sense line, a corrupted frame | Reject the sample, keep running on the last valid value, flag it | Self-clearing after N consecutive good samples |
| Protection trip | Over-current, over-voltage, under-voltage, over-temperature beyond the trip threshold | Open the charge or discharge path, hold the pack in a defined safe state | Latched, or time-delayed, depending on the fault |
| Processor fault | Watchdog timeout, brownout, stack corruption, illegal instruction | Reset the processor, re-enter the safe state before resuming normal control | Automatic restart with a bounded retry count |
| Permanent or safety-critical fault | Cell over-temperature that persists, contactor or FET failure detected, repeated processor resets | Latch off, keep the pack disabled, record the cause | Latched until serviced and cleared by an authorised procedure |
The safe state itself has to be defined, because “the processor resets” is not a safe state. For most packs the safe state is: charge and discharge paths open, the balancing function stopped, the fuel gauge frozen rather than reset, and the fault cause written to non-volatile memory before the reset completes. The specification should name the pin states and the register states that produce this condition, so that the reset path and the normal control path converge on the same outputs.
The classification also gives the FMEA a place to plug in. A design FMEA for the pack lists the failure modes; the firmware specification then states which class each one falls into and what the pack does about it. Without that link the FMEA produces failure modes with no defined response, which is the most common way a fault matrix ends up being decorative. For industrial packs the safety functions the BMS must keep working, and the way their failure is assessed, are set out in IEC 62619:2022, which is why the fault classes should be traceable back to it rather than invented per project.
Watchdog: what it guards, and how long it may wait
A watchdog is a timer that the firmware must service before it expires; if the firmware hangs, the timer expires and forces a reset. The specification question is not whether to have one, which is settled, but what it guards and how long it is allowed to wait.
A simple watchdog is serviced from one place in the main loop, which catches a total hang but not a loop that keeps running while a critical task has stopped. A windowed watchdog adds a lower bound as well as an upper bound: servicing too early is also a fault, which catches a task that has run away and is now servicing the timer far too often. Windowed watchdogs are worth the extra complexity on packs that run a scheduler, because the failure they catch, a task that has lost its timing but not its ability to tick the timer, is exactly the failure a simple watchdog misses.
The timeout budget has to be derived, not guessed. Start from the longest legitimate blocking operation in the control loop, add the worst-case execution time of the tasks that must complete within a cycle, and add margin for the slowest clock the product is specified to run at across its temperature range. If the resulting number is longer than the time in which the pack must reach its safe state, the architecture is wrong: the watchdog cannot be the only mechanism, and a hardware or independent path has to take over. The reasoning is the same one used in functional-safety software practice, where the watchdog is treated as one measure among several rather than as a guarantee on its own, and where the software architecture has to show how the measures combine to keep a hazardous output from persisting. IEC 60730-1:2022 is a common reference for automatic electrical controls where the control is treated as safety-related, and IEC 62304 sets out the software lifecycle and risk-control expectations that medical-device software is assessed against.
Brownout: the dip that is not quite a reset
A brownout is a supply voltage that falls below the level at which the processor can run reliably but above the level at which it has fully reset. It is more dangerous than a clean reset, because the processor may keep executing with corrupted state. The specification has to say what the brown-out detector is set to, what happens when it trips, and what state is preserved.
Two decisions matter most. The first is the threshold. It must sit above the minimum operating voltage of the processor and its non-volatile memory write cycle, with margin for the tolerance of the detector itself, because a brown-out that fires during a flash write can leave the record half-written. The second is what gets written before the supply collapses. If the fault cause and the accumulated counters are to survive the event, they must be committed early and often enough that the write completes before the threshold is crossed; the specification should state the write strategy and the worst-case write time, not just the fields.
A related question is whether the pack should distinguish a brownout from a commanded reset in its fault log. It should, because the two point at different root causes: a brownout usually means the supply, the connector or the load, while a commanded reset usually means the host or the service tool. Losing that distinction is how a field return ends up diagnosed as “unknown reset”.
Latch or auto-recover: write the policy matrix
The decision that causes the most argument in design review, and the most surprise in the field, is whether a fault clears itself. A pack that auto-recovers from a genuine fault will retry into the fault until something fails; a pack that latches on every transient will strand the equipment for a fault that would have cleared. The way to settle it is a policy matrix, agreed once and applied consistently.
| Fault class | Retry allowed | Retry window | Latch after | Cleared by |
|---|---|---|---|---|
| Transient measurement fault | Not applicable; no shutdown | Recovery after N good samples | Never latches | Automatic |
| Over-current (discharge) | Yes, bounded | Defined delay after the load is removed | Repeated trips inside the window | Automatic until the retry limit, then latched |
| Over-temperature (charge) | Yes, after cooldown | Until temperature returns with margin below the trip point | Not latched unless it recurs | Automatic |
| Cell over-voltage or under-voltage | Yes, hysteresis-based | Until the cell returns inside the recovery band | Latched if the band is crossed repeatedly | Automatic with hysteresis |
| Processor reset (watchdog or brownout) | Yes, counted | Per power cycle | After the retry count is exhausted | Automatic until the limit, then latched |
| Safety-critical permanent fault | No | Not applicable | Immediately | Authorised service procedure only |
Two details make the difference between a policy that works and one that generates nuisance trips. The first is hysteresis: every recovery threshold should be tighter than the trip threshold, with a defined gap, or the pack will oscillate at the boundary. The second is the counting basis. A retry counter that resets on every power cycle is not a latch, because the operator can defeat it by cycling the key; a counter that persists in non-volatile memory is a latch, and it has to be cleared by a procedure that is not simply “power off and on”. The logic is the same one behind counter-based fault confirmation in other safety systems, where the number of consecutive confirmations is designed from the required reliability rather than tuned by feel.
The retry counter is also where the fault log earns its keep. Recording the count, the class and the timestamp of each event is what lets a field failure be diagnosed instead of replaced. If the pack cannot say “this was the fourth over-current trip in two hours”, the diagnosis starts from zero every time.
Verification by fault injection
None of the above is proven by reading the code. It is proven by injecting the fault and observing the pack. The table below is a starting test matrix; the acceptance evidence is the trace, not the pass statement.
| Test case | Injection method | Pass criterion | Evidence |
|---|---|---|---|
| Watchdog expiry during normal operation | Halt the control task in a debug build, or force the service call to stop | Reset occurs within the specified timeout; the pack re-enters the safe state before resuming | Trace showing service stop, reset and safe-state entry |
| Windowed watchdog, early service | Service the timer faster than the lower bound | The watchdog treats it as a fault and resets | Trace showing the early service and the reset |
| Brownout during a non-volatile write | Ramp the supply down across the detector threshold at a controlled rate | No partially written record; the previous record remains valid | Read-back of the log after power restore |
| Brownout above the reset threshold | Hold the supply in the band where the processor runs but is unreliable | The pack reaches the safe state and the event is logged as a brownout, not a reset | Log entry and output state |
| Latched protection, power cycle | Trip a safety-critical fault, then remove and restore power | The pack remains disabled; the counter survives the cycle | State after each power cycle |
| Retry exhaustion | Drive repeated over-current trips inside the retry window | The pack latches after the specified count and does not retry again | Count and final state |
| Recovery hysteresis | Hold the fault at the boundary and step it slowly across the recovery band | No oscillation; recovery occurs once, inside the defined band | Trace of the threshold crossing |
Fault injection is worth doing on the bench rather than in simulation, because the timing that matters, the write time of the non-volatile memory, the detector tolerance and the reset latency, are the parts a model is most likely to get wrong. Where the pack is being qualified for a regulated market, the test record also becomes part of the evidence file, and the same discipline applies: the test states which fault was injected, how, and what was observed. The practice of classifying faults by impact and applying a defined recovery to each class, rather than handling them ad hoc, is the same one used in fault-detection and recovery frameworks for other embedded systems.

What to put in the RFQ or firmware specification
The specification can be short, but it has to be explicit. At minimum it should state: the fault classes and the safe state for each, the watchdog type and its timeout budget with the derivation, the brown-out threshold and what is written before the supply collapses, the latch-or-recover policy with the retry window and the counting basis, the fields and retention of the fault log, and the fault-injection tests with their acceptance criteria. A supplier that can answer all of these has a recovery scheme; one that answers “the BMS handles it” has a default.
The behaviour also has to survive the reset without corrupting the state the rest of the system depends on. That is why the specification should say which state is preserved across a reset, in particular the accumulated state of charge and the protection history, so that a pack that resets does not come back reporting a state that contradicts its own log. The accuracy of that reported state is a separate problem, covered in our guide to BMS state of charge accuracy, but a reset that wipes it is a fault-handling decision, and it belongs in this document.

