6. Communication
6.1. CAN
foxBMS 2 supports communication with other high level devices (e.g., the VCU) through CAN.
6.1.1. DBC File
These files describe the CAN interface used by foxBMS 2.
The .dbc-file has been created using PCAN Symbol Editor
Version 6.5.2 from symbol file Version 6.0.
The .dbc-file and .sym-file are located in tools/dbc.
6.1.1.1. Supported CAN Messages
6.1.1.1.1. Insulation Measurement Device
ID |
Name |
Comment |
Implementation file |
|---|---|---|---|
022h |
IMD_BenderIso165c_Request |
can_cbs_tx_imd_bender-iso165c-request.c |
|
023h |
IMD_BenderIso165c_Response |
can_cbs_rx_imd_bender-iso165c-response.c |
|
037h |
IMD_BenderIso165c_Info |
can_cbs_rx_imd_bender-iso165c-info.c |
6.1.1.1.2. Crash Dump
ID |
Name |
Comment |
Implementation file |
|---|---|---|---|
0FFh |
f_CrashDump |
Fatal error information |
can_cbs_tx_f_crash-dump.c |
6.1.1.1.3. BMS Status
ID |
Name |
Comment |
Implementation file |
|---|---|---|---|
210h |
f_BmsStateRequest |
Requests specific BMS behavior and gives the BMS required information from the higher-level control unit |
can_cbs_rx_f_bms-state-request.c |
220h |
f_BmsState |
Message contains general BMS state information |
can_cbs_tx_f_bms-state.c |
221h |
f_BmsStateDetails |
Details on flags transmitted by the ‘BmsState’ message |
can_cbs_tx_f_bms-state-details.c |
222h |
f_BmsFatalError |
Message contains the fatal error code |
can_cbs_tx_f_fatal-error.c |
6.1.1.1.4. State Machine Information
ID |
Name |
Comment |
Implementation file |
|---|---|---|---|
219h |
f_SystemState |
Message contains the state of our System state machine |
can_cbs_tx_f_sys-state.c |
6.1.1.1.5. Pack Information
ID |
Name |
Comment |
Implementation file |
|---|---|---|---|
230h |
f_PackMinMaxCellTemperature |
can_cbs_tx_f_pack-minimum-maximum-values.c |
|
231h |
f_PackMinMaxCellVoltage |
can_cbs_tx_f_pack-minimum-maximum-values.c |
|
232h |
f_PackLimits |
Electrical limit information |
can_cbs_tx_f_pack-limits.c |
233h |
f_PackValuesP0 |
can_cbs_tx_f_pack-values-p0.c |
|
234h |
f_PackValuesP1 |
can_cbs_tx_f_pack-values-p1.c |
|
235h |
f_PackStateEstimation |
can_cbs_tx_f_pack-state-estimation.c |
6.1.1.1.6. String Information
ID |
Name |
Comment |
Implementation file |
|---|---|---|---|
240h |
f_StringState |
Message contains string related error and warning flags |
can_cbs_tx_f_string-state.c |
241h |
f_StringMinMaxCellTemperature |
Message contains minimum and maximum cell temperature values and their indices of respective string |
can_cbs_tx_f_string-minimum-maximum-values.c |
242h |
f_StringMinMaxCellVoltage |
Message contains minimum and maximum cell voltage values and their indices of respective string |
can_cbs_tx_f_string-minimum-maximum-values.c |
243h |
f_StringValuesP0 |
Message contains string voltage, current and power |
can_cbs_tx_f_string-values-p0.c |
244h |
f_StringValuesP1 |
Message contains energy counting value |
can_cbs_tx_f_string-values-p1.c |
245h |
f_StringStateEstimation |
Message contains SOC, SOE and SOH state estimations |
can_cbs_tx_f_string-state-estimation.c |
6.1.1.1.7. Cell Information
ID |
Name |
Comment |
Implementation file |
|---|---|---|---|
250h |
f_CellVoltages |
Cell voltage measurement data |
can_cbs_tx_f_cell-voltages.c |
260h |
f_CellTemperatures |
Cell temperature measurement data |
can_cbs_tx_f_cell-temperatures.c |
270h |
AFE_CellVoltages |
Cell voltage measurement data |
can_cbs_rx_afe_cell-voltages.c |
280h |
AFE_CellTemperatures |
Cell temperature measurement data |
can_cbs_rx_afe_cell-temperatures.c |
6.1.1.1.8. Debug
ID |
Name |
Comment |
Implementation file |
|---|---|---|---|
300h |
f_Debug |
Reserved - for debug/development purpose only |
can_cbs_rx_f_debug.c |
301h |
f_DebugResponse |
Responses to the ‘Debug’ message |
can_cbs_tx_f_debug-response.c |
302h |
f_DebugUnsupportedMultiplexerVal |
can_cbs_tx_f_debug-unsupported-multiplexer-values.c |
|
303h |
f_DebugBuildConfiguration |
Contains the build configuration |
can_cbs_tx_f_debug-build-configuration.c |
304h |
f_DebugIdentifyHardware |
Contains the hardware identifications |
can_cbs_tx_f_debug-identify-hardware.c |
6.1.1.1.9. Current Sensor
ID |
Name |
Comment |
Implementation file |
|---|---|---|---|
3C2h |
CS_LemCab500String0 |
LEM Current Sensor |
can_cbs_rx_cs_lem-cab500.c |
521h |
CS_IsabellenhuetteIvtString0Curr |
Current sensor string 0: current |
can_cbs_rx_cs_isabellenhuette-ivt-s.c |
522h |
CS_IsabellenhuetteIvtString0V1 |
Current sensor string 0: voltage 1 |
can_cbs_rx_cs_isabellenhuette-ivt-s.c |
523h |
CS_IsabellenhuetteIvtString0V2 |
Current sensor string 0: voltage 2 |
can_cbs_rx_cs_isabellenhuette-ivt-s.c |
524h |
CS_IsabellenhuetteIvtString0V3 |
Current sensor string 0: voltage 3 |
can_cbs_rx_cs_isabellenhuette-ivt-s.c |
525h |
CS_IsabellenhuetteIvtString0Temp |
Current sensor string 0: temperature |
can_cbs_rx_cs_isabellenhuette-ivt-s.c |
526h |
CS_IsabellenhuetteIvtString0Pwr |
Current sensor string 0: power |
can_cbs_rx_cs_isabellenhuette-ivt-s.c |
527h |
CS_IsabellenhuetteIvtString0Cc |
Current sensor string 0: coulomb counting |
can_cbs_rx_cs_isabellenhuette-ivt-s.c |
528h |
CS_IsabellenhuetteIvtString0Ec |
Current sensor string 0: energy counting |
can_cbs_rx_cs_isabellenhuette-ivt-s.c |
6.1.1.1.10. Aerosol Sensor
ID |
Name |
Comment |
Implementation file |
|---|---|---|---|
3C4h |
AS_HoneywellBas6cX00 |
can_cbs_rx_as_honeywell-bas6c-x00.c |
6.1.2. CAN TX Behavior
6.1.2.1. Cyclic Messages
The cyclic transmit list is configured in can_txMessages[] in
src/app/driver/config/can_cfg_tx_cyclic.c.
The cyclic messages are not sent immediately after startup.
Periodic TX is globally gated by can_state.periodicEnable in
CAN_MainFunction():
If
periodicEnable == false, no cyclic TX is executed.If
periodicEnable == true,CAN_PeriodicTransmit()sends all configured cyclic messages according to period and phase.
This gate is enabled during SYS initialization. After that point, cyclic transmission runs continuously.
The BMS cyclically transmits these messages:
f_SysStatef_BmsStatef_BmsStateDetailsf_CellVoltagesf_CellTemperaturesf_PackLimitsf_PackMinimumMaximumVoltagef_PackMinimumMaximumTempf_PackStateEstimationf_PackValuesP0f_PackValuesP1f_StringStatef_StringMinimumMaximumVoltagef_StringMinimumMaximumTempf_StringStateEstimationf_StringValuesP0f_StringValuesP1
6.1.2.2. On-demand Messages
The following transmitted messages are sent on request, not cyclically:
f_DebugResponse, including requested payload variants such as version information, commit hash, RTC time, boot timestamp and uptime.f_DebugBuildConfiguration.f_DebugIdentifyHardware.f_DebugUnsupportedMultiplexerValueswhen an unsupported debug multiplexer value is received.
These responses are triggered by received f_Debug frames in
CANRX_Debug().
6.1.2.3. Further Asynchronous Transmitted Messages
Some asynchronous TX messages are event-driven and therefore neither cyclic nor
request/response from f_Debug:
f_BmsStateis additionally sent asynchronously when BMS state or substate changes (CANTX_TransmitBmsState()).f_BmsFatalErroris sent by the diagnosis module when fatal errors are set/cleared and periodically resent while active.f_CrashDumpis sent on detected stack overflow.
6.2. Ethernet
Additionally to to CAN communication an ethernet communication interface is
provided.
Currently plain TCP/IP is supported for user defined application tasks.
These tasks can be placed in ethernet.c.
As an example and for testing purposes an echo server is implemented there.
More details can be found in Ethernet.