Cet article existe aussi en français. Lire en français →
Battery management system software turns raw measurements into decisions: is every cell inside its limits, how much energy is left, how much power can be given, when to open the contactors. In a production BMS it is also a safety-critical system, which shapes how it is structured, written and verified.
The layers
Most automotive BMS software follows AUTOSAR Classic or a similar layered approach: drivers and microcontroller abstraction at the bottom, basic services (communication, diagnostics, non-volatile memory, OS) in the middle, and application components on top. Industrial and rail products often use lighter frameworks, with the same principles.
Application components
| Component | What it does |
|---|---|
| Measurement acquisition | Reads cell voltages and temperatures from the AFEs, current and high voltages; filters and timestamps |
| Plausibility and diagnostics | Checks sensors against each other and against limits; open-wire, stuck values, communication errors |
| Protection and fault manager | Compares with thresholds and timers, decides derating or safe state, stores diagnostic codes |
| Contactor state machine | Sequences precharge and contactors, detects welding |
| State estimation | SOC, SOH and SOP (see Kalman filter SOC estimation) |
| Balancing | Selects cells to balance and schedules it |
| Thermal requests | Asks the cooling or heating system for what the cells need |
| Charging | Talks to the charger or the PCS, applies charge maps |
| Logging and calibration | Event and history logs, calibration parameters through XCP |
Task periods
| Period | Typical content |
|---|---|
| 1 ms | Current measurement, fast overcurrent checks, contactor feedback |
| 10 ms | Protection logic, contactor state machine, power limit updates |
| 100 ms | Cell voltage and temperature acquisition cycle, state estimation, balancing decisions |
| 1 s | Ageing models, logging, thermal requests, housekeeping |
The periods must be consistent with the fault tolerant time intervals: detection and reaction of each fault must fit, including worst-case execution time and communication delays.
Safety partitioning
- Memory protection: the MPU prevents QM code from writing into safety-related data.
- Timing protection: the OS supervises execution budgets so a QM task cannot starve a safety task.
- End-to-end protection of data between partitions and over CAN: CRC, counters, timeouts.
- Independent paths for the most critical reactions, sometimes in hardware, so a software failure cannot prevent the safe state.
How it is developed
- Model-based design for algorithms (estimation, state machines), with automatic code generation, or hand-written C for drivers and services.
- Coding rules (MISRA C), static analysis and unit testing with structural coverage, at the rigour the integrity level requires.
- Model-in-the-loop and software-in-the-loop for algorithms, then hardware-in-the-loop for the real ECU, including fault injection.
- Calibration in the vehicle or system with measurement tools, under configuration management.
- A bootloader and update strategy designed with cybersecurity from the start.
FAQ
What does BMS software do?
It acquires cell measurements, checks them, protects the battery, estimates state of charge, health and power, manages contactors, balancing, thermal requests and charging, and communicates with the system.
Is BMS software developed with AUTOSAR?
Most automotive BMS use AUTOSAR Classic or a similar layered architecture; industrial and rail BMS often use lighter frameworks with the same principles.
What is freedom from interference?
The guarantee that non-safety software cannot corrupt the data, timing or execution of safety-related software sharing the same microcontroller.
How is BMS software tested?
With unit tests and static analysis, model-in-the-loop and software-in-the-loop for algorithms, and hardware-in-the-loop testing of the real ECU, including fault injection.
Which language is BMS software written in?
Mostly C, often generated from models for algorithms, following MISRA C rules for safety-related code.
Learn it live
This topic is covered in depth, with industrial case studies, in the Battery systems & BMS program. Join the waitlist to hear first when it opens — or browse the 64 free guides in the meantime.


