Power Select Error Codes

Power select broadcasts some errors/warnings in SYSTEM_CAN_MESSAGE_POWER_SELECT_STATUS , which is defined as follows:

msg { id: 44 source: POWER_SELECT target: "CENTRE_CONSOLE" msg_name: "power select status" can_data { u16 { field_name_1: "fault_bitset" field_name_2: "warning_bitset" field_name_3: "valid_bitset" field_name_4: "cell_voltage" } } }

These are also stored locally in a PowerSelectStorage instance.

Fault Bitset

The fault_bitset offsets are defined by the PowerSelectFault enum in power_select_defs.h:

typedef enum { POWER_SELECT_FAULT_AUX_OV = 0, POWER_SELECT_FAULT_DCDC_OV, POWER_SELECT_FAULT_PWR_SUP_OV, POWER_SELECT_FAULT_AUX_OC, POWER_SELECT_FAULT_DCDC_OC, POWER_SELECT_FAULT_PWR_SUP_OC, POWER_SELECT_FAULT_DCDC_PIN, NUM_POWER_SELECT_FAULTS, } PowerSelectFault;

Here, OV represents an overvoltage and OC an overcurrent.

These are mostly self-explanatory: POWER_SELECT_FAULT_AUX_OV represents an aux power supply overvoltage, POWER_SELECT_FAULT_PWR_SUP_OC represents a main power supply overcurrent, and so forth.

POWER_SELECT_FAULT_DCDC_PIN refers to a fault triggered by POWER_SELECT_DCDC_FAULT_ADDR going high.

IMPORTANT: Some faults are severe enough that they require the LTC to be turned off, stopping the car’s operation. These are set in POWER_SELECT_LTC_DISABLE_FAULT_MASK. Currently, POWER_SELECT_FAULT_AUX_OCand/or POWER_SELECT_FAULT_PWR_SUP_OC will cause this.

Warning Bitset

The only warning_bitset offset is defined by the PowerSelectWarning enum in power_select_defs.h:

typedef enum { POWER_SELECT_WARNING_BAT_LOW = 0, NUM_POWER_SELECT_WARNINGS, } PowerSelectWarning;

POWER_SELECT_WARNING_BAT_LOW indicates that the 3V3 cell used to jumpstart the board needs to be replaced. Its exact voltage is reported in the cell_voltage field of SYSTEM_CAN_MESSAGE_POWER_SELECT_STATUS.

Valid Bitset

valid_bitset indicates which of the three power sources are considered valid by the LTC. For reference, the sources are defined by the PowerSelectMeasurement enum in power_select.h: