3.1.8. waf_tools.bms_config_generate
Generate foxBMS configuration headers and environment flags.
This waf tool generates C header files containing #define directives
derived from the validated BMS system configuration (bms.json). It also
sets the corresponding waf environment variables so that build steps can
conditionally include source files and apply compiler flags based on the
active hardware and software configuration.
- The tool covers the following configuration domains:
Aerosol sensor - Manufacturer/model detection and support defines.
Algorithm - State estimation method selection (SOC, SOE, SOF, SOH).
Balancing strategy - Active balancing algorithm selection.
Current sensor - Manufacturer, model, and communication type.
IMD sensor - Insulation monitoring device selection and type.
Redundancy - Redundant measurement path enable/disable.
Debug interfaces - UART support toggle.
RTOS - Real-time OS selection and addon configuration (e.g. TCP).
BMS-Slave - Analog front-end IC, driver type, and temperature sensor.
MCU - Cache enable/disable.
Additionally, the module provides @conf-decorated helper functions that
allow build scripts to query the active sensor/device configuration
(e.g. is_current_sensor_lem_cab500(), is_imd_bender_iso165c()).
3.1.8.1. Usage
Validate the configuration and set environment variables:
bms_config_node = bld.srcnode.find_node(bld.env.BMS_CONFIG) system = bms_config_validate.validate_bms_configuration(bld, bms_config_node) bms_config_generate.set_env_variables(bld, system)
Declare task generators with the
foxbms_configfeature for each configuration domain:contents = [ "aerosol_sensor", "algorithm", "balancing_strategy", "current_sensor", "imd_sensor", "redundant_v_t_measurement", "debug", "rtos", "bms_slave", ] for content in contents: bld( features="foxbms_config", bms_config_node=bms_config_node, system=system, content=content, target=content, )
Each task generator produces a
foxbms_config_<target>.hheader file in the build directory.
3.1.8.2. Dependencies
waf_tools.bms_config_model- Typed dataclass model for the system configuration.waf_tools.bms_config_validate- Validation entry point forbms.json.
Functions
|
Process the |
Determine whether the aerosol sensor is Honeywell BAS6C-X00. |
|
Determine whether the BMS-Slave is Debug CAN. |
|
Determine whether the current sensor is Isabellenhuette IVT-S. |
|
Determine whether the current sensor is LEM CAB500. |
|
|
Determine whether the IMD is Bender IR155. |
Determine whether the IMD is Bender iso165c. |
|
|
Determine whether no IMD device shall be used. |
|
Configure aerosol sensor defines and environment variables. |
|
Configure state estimation algorithm defines and environment variables. |
|
Configure balancing strategy defines and environment variables. |
|
Configure BMS-Slave defines and environment variables. |
|
Configure current sensor defines and environment variables. |
|
Configure debug interface defines and environment variables. |
|
Set all build environment variables based on the system configuration. |
|
Configure insulation monitoring device defines and environment variables. |
|
Configure MCU defines and environment variables. |
|
Configure redundancy defines and environment variables. |
|
Configure RTOS defines and environment variables. |
Classes
|
Waf task that generates a foxBMS configuration header file. |