Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
b1ef97c
Add DTC for PDU LV current limit
florenceyuen Nov 29, 2024
782c415
Fix to use proper DTC macro name
florenceyuen Nov 29, 2024
4428417
Fix formatting
florenceyuen Nov 30, 2024
2f3a0f6
Add DTC for PDU LV current limit (#65)
jlim25 Nov 30, 2024
b1b5aa6
Added CAN messages to communicate changes of states for boards.
EmadsGitHub Jan 17, 2025
7002184
Added the variable declaration before calling CAN messages.
EmadsGitHub Jan 17, 2025
33a107d
Added CAN messages to communicate changes of states for boards.
EmadsGitHub Jan 17, 2025
199c6f3
Merge branch 'publish_state_changes_can' of github.com:UWaterloo-Form…
EmadsGitHub Jan 17, 2025
37b4bd9
Added CAN messages for state changes of each board.
EmadsGitHub Jan 17, 2025
3c207f2
Publish state changes can (#69)
EmadsGitHub Jan 18, 2025
439ce1f
Revert "Publish state changes can" (#71)
aryanGajelli Jan 29, 2025
3f125c0
Implemented Debugging Value Tables for State Changes
EmadsGitHub May 13, 2025
0f0737d
Fixed value table.
EmadsGitHub May 13, 2025
448ac73
Fixed value tables again
EmadsGitHub May 13, 2025
9397e31
Added CAN messages for event changes.
EmadsGitHub May 13, 2025
9b7c726
Clean up
EmadsGitHub May 13, 2025
2ef40ab
Updated message CAN ID's
EmadsGitHub May 21, 2025
9a0a568
Update README.md
jlim25 Sep 18, 2024
5aa40f6
Update README.md
jlim25 Sep 20, 2024
ca79a2d
init some IVT-S CAN messages WIP
DanBishara Oct 29, 2024
b1b15a8
fix Wh message
DanBishara Oct 30, 2024
08cf5a9
change BMU pins, changes to fault monitor WIP, doesn't compile
DanBishara Dec 2, 2024
0f56f20
update fault monitor
DanBishara Dec 17, 2024
ddcc2ff
ioc changes
DanBishara Dec 17, 2024
f69288b
BUILDS, remove all ADC references, update linker, update method for H…
DanBishara Dec 18, 2024
a412ae5
fixed ADC config, addec contactor current sense, moved task IDs to bsp.h
DanBishara Dec 19, 2024
821c62f
added missing signals
BayLaptop Dec 19, 2024
d3b66d5
fix IVT command message
BayLaptop Dec 19, 2024
fb500b1
change mux ID from multiplexor signal to regular signal
BayLaptop Dec 19, 2024
c736e7a
add scale to U1 result signal
BayLaptop Dec 19, 2024
4dc09ff
add IMD general info message
BayLaptop Dec 20, 2024
c6e2bdf
CAN PRECHARGE, imd support, adjusted precharge NEEDS TO CHECK FOR CUR…
DanBishara Dec 23, 2024
eff5c67
move code for contactor control
DanBishara Dec 24, 2024
a272c6b
move ADC drivers to legacy folder, add all IMD faults
DanBishara Dec 31, 2024
1813fa2
log contactor current
DanBishara Jan 11, 2025
22e27d6
contactor current stuff
DanBishara Jan 11, 2025
e302282
Updated cubemx and dma adc now works
aryanGajelli Jan 16, 2025
4bf921b
Implementing TSSI lights with timer interrupts. (#74)
EmadsGitHub Apr 7, 2025
c6cb3a6
modify IOC file to combine VCU and DCU functionality
jlim25 Dec 17, 2024
ced63a6
update bsp
jlim25 Dec 17, 2024
48ad620
update documentation on VCU code and remove beaglebone code
jlim25 Dec 21, 2024
2fdbd2b
port LED task from the DCU to the VCU
jlim25 Dec 28, 2024
cb77cf9
update common files (bit of CAN message, DTC, and disable DCU heartbeat
jlim25 Dec 28, 2024
59f6c42
modify IOC file to include LED task and minor note on bsp.h
jlim25 Dec 28, 2024
64c296d
update DCU references to VCU in the BMU
jlim25 Dec 28, 2024
6b5401f
update canReceive
jlim25 Dec 28, 2024
4e03cda
Update state machine logic in the VCU. Probably has error. Must review
jlim25 Dec 28, 2024
ccca800
minor changes
jlim25 Dec 28, 2024
b323bb0
WORKING STATE, add interrupt for buttons, adjust SM, introduce BPS
DanBishara Dec 31, 2024
bf36dc4
Tuned Accel Pedals
aryanGajelli Apr 12, 2025
d054d70
modify existing IOC for 2025 PDU
jlim25 Oct 29, 2024
0c76ecf
update board support package
jlim25 Oct 29, 2024
1824395
add Daniel's code for hystersis for brakelights
jlim25 Oct 29, 2024
78923e9
update cooling for 2025 and clean up controlStateMachine (not done)
jlim25 Oct 29, 2024
8f9feba
fix cooling task period
jlim25 Oct 29, 2024
fd1ca34
fix driver path
jlim25 Oct 29, 2024
e76db46
clean up controlStatemachineMock. Fix LED macros
jlim25 Oct 29, 2024
bbacf62
setup blank task for load sensor reading
jlim25 Oct 29, 2024
0bd13d4
fix compile errors
jlim25 Oct 29, 2024
6e7e7d9
blank task for temperature reading
jlim25 Oct 29, 2024
b740587
update CAN signals for 2025 PDU
jlim25 Nov 2, 2024
ba90505
fix compile error + add CLI command for AUX enable
jlim25 Nov 2, 2024
d00a71e
fix build error on the VCU
jlim25 Nov 7, 2024
4c8ded2
Add logic to report highestTempThermistor from the bmu (Alex) and upd…
jlim25 Nov 8, 2024
21cd78d
initial commit for current sensing
rijin113 Oct 30, 2024
542d613
updated code logic for retrieving channel currents
rijin113 Nov 1, 2024
b884b39
redid all current sensing logic code, need to remove small funcs and …
rijin113 Nov 1, 2024
b99f178
updated sensing logic
rijin113 Nov 1, 2024
c6a404a
updated code after merge; added CAN message support
rijin113 Nov 3, 2024
4258070
added new internal clk timer for sub ms delays
rijin113 Nov 3, 2024
0c10b28
update IOC to fix delay timer and ADC1 configuration
jlim25 Nov 8, 2024
3af9a8e
revert J1939 change in the DBC file. Is incompatible with canalyzer
jlim25 Nov 16, 2024
ef70b8f
fix incorrect ADC config and update FreeRTOS tasks
jlim25 Nov 16, 2024
4960ee0
remove power task (LTC4110) and other minor changes
jlim25 Nov 23, 2024
3842322
rename sensors.c to lvMeasure.c. lvMeasure working
jlim25 Nov 23, 2024
2349f5e
working load sensing. calibration still needed
jlim25 Nov 23, 2024
c96cd2f
wip controlStateMachine. Requires clean up later
jlim25 Dec 13, 2024
d425650
Pump debugging
aryanGajelli Apr 12, 2025
aacd8a0
Newlib hack
aryanGajelli Apr 12, 2025
889bbcd
Brake pedal tuned
aryanGajelli Apr 13, 2025
d2f4949
ooga booga deleting all checks
aryanGajelli Apr 13, 2025
ac0bf34
Reset to normal checks (undoing hv testing blank bmu loops)
aryanGajelli Apr 20, 2025
398a300
Segment 6 works
aryanGajelli Apr 24, 2025
2d9acb5
Car Movesgit status!
aryanGajelli Apr 26, 2025
f6f48b5
Generated cubemx code, only dates changed
aryanGajelli Apr 26, 2025
6bf8b3d
Changed buttons to input from exti
aryanGajelli Apr 26, 2025
fc4e388
Buttons are good now
aryanGajelli Apr 26, 2025
d3dd4b6
Stabler adc readings, less flaky throttle
aryanGajelli Apr 27, 2025
f996054
hot fix unable to compile bmu
aryanGajelli Apr 27, 2025
43ee6ee
fix bug in BMY dtc callback
BayLaptop Apr 28, 2025
e720b78
trip IMD on warning
DanBishara Apr 29, 2025
b4a41bc
helper macro
DanBishara Apr 29, 2025
6c84ea3
rename AUX 1 to transponder
DanBishara Apr 29, 2025
387a834
Recalibrated throttle
aryanGajelli Apr 30, 2025
5d93037
fatal dtc on throttle failure
aryanGajelli Apr 30, 2025
27751cf
brake tuned
aryanGajelli Apr 30, 2025
f085bc0
throttle tuning post mech fix
DanBishara May 1, 2025
aac5c2d
increase throttle plausibility check
DanBishara May 1, 2025
3148e23
drop to glv on bad throttle (#76)
aryanGajelli May 12, 2025
bf1bf25
Dash il (#77)
aryanGajelli May 12, 2025
59ec9dd
Pdu loadsensor fix (#79)
aryanGajelli May 12, 2025
887bb0b
HV button flashes based on precharge. CBRB dow/up now flashes HV button
aryanGajelli May 13, 2025
ae18a03
Fixed bits (#80)
aryanGajelli May 13, 2025
aa57122
Interlock status periodic (#81)
aryanGajelli May 13, 2025
bcf7641
Implemented Debugging Value Tables for State Changes
EmadsGitHub May 13, 2025
dd0255a
Fixed value table.
EmadsGitHub May 13, 2025
54fa73a
Fixed value tables again
EmadsGitHub May 13, 2025
f3bab24
Added CAN messages for event changes.
EmadsGitHub May 13, 2025
86b6ce3
Clean up
EmadsGitHub May 13, 2025
80e2bd8
Updated message CAN ID's
EmadsGitHub May 21, 2025
aeef08d
Merge branch 'Debugging_Value_Tables' of github.com:UWaterloo-Formula…
EmadsGitHub Jul 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@ This is the firmware monorepo for the UW Formula Electric team. This repository

# Onboarding Instructions

- [OpenProject Access](#open-project)
- [Notion Access](#notion)
- [SSH Key](#ssh-key-set-up)
- [Vagrant (Windows Only)](#Vagrant-Environment-Set-Up-for-Windows-Users)
- [Mac OS](#mac-os-set-up)
- [Linux](#linux-set-up)
- [Other Resources](#other-resources)
- [FAQ](#FAQ)

# Open Project
# Notion

We use Open Project for task management. Steps to get set up:
We use Notion for task management and documentation. Steps to get set up:

1. Visit http://owenbrake.com/pm
2. Create an account with your school email
3. Message your email in the new-members thread under #firmware on Slack, and a lead will add you to the project
1. Create a Notion account with your school email
2. Fill out this [form](https://forms.gle/Mz7rk66djoDZY9Fv9) and we will invite you to the team's Notion workspace

# SSH Key Set Up

Expand All @@ -39,7 +38,7 @@ The repository we use is found [here](https://github.com/UWaterloo-Formula-Elect
### Prerequisites

- Install the latest version of [Vagrant](https://developer.hashicorp.com/vagrant/downloads)
- Install the latest version of [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
- Install 7.0.18 version of [VirtualBox](https://www.virtualbox.org/wiki/Download_Old_Builds_7_0). DON'T install the latest version, there are compatibility issues with Vagrant.
- Install the matching [VirtualBox Extension Pack](https://www.virtualbox.org/wiki/Downloads) to get USB data
After installing the above, verify the Vagrant installation worked by opening a new command prompt or console, and checking that **vagrant** is available.

Expand Down
60 changes: 60 additions & 0 deletions common/Data/2024CAR.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ BS_:

BU_: IMD IVT VCU_BeagleBone DCU PDU BMU VCU_F7 WSBFL WSBFR WSBRL WSBRR ChargeCart INV
VAL_TABLE_ BMU_Interlock_State 512 "FSM_STATE_FAILED" 256 "HW_CHECK_FAILED" 128 "TSMS_FAILED" 64 "CBRB_FAILED" 32 "IMD_FAILED" 16 "AMS_FAILED" 8 "HVD_FAILED" 4 "BSPD_FAILED" 2 "EBOX_FAILED" 1 "BOTS_FAILED" 0 "No Fault" ;
VAL_TABLE_ DCU_Events 8 "EV_ANY" 7 "EV_Fatal" 6 "EV_CAN_Receive_EM" 5 "EV_CAN_Receive_HV" 4 "EV_BTN_Endurance_Lap" 3 "EV_BTN_Endurance_Mode_Toggle" 2 "EV_BTN_TC_Toggle" 1 "EV_BTN_EM_Toggle" 0 "EV_BTN_HV_Toggle" ;
VAL_TABLE_ VCU_Events 13 "EV_ANY" 12 "EV_Inverter_Fault" 11 "EV_Fatal" 10 "EV_Throttle_Failure" 9 "EV_Brake_Pressure_Fault" 8 "EV_BTN_Endurance_Mode_Toggle" 7 "EV_CAN_Receive_HV" 6 "EV_BTN_TC_Toggle" 5 "EV_BTN_EM_Toggle" 4 "EV_BTN_HV_Toggle" 3 "EV_Hv_Disable" 2 "EV_Bps_Fail" 1 "EV_EM_Toggle" 0 "EV_Init" ;
VAL_TABLE_ PDU_Events 6 "EV_ANY" 5 "EV_Cycle_MC" 4 "EV_EM_Disable" 3 "EV_EM_Enable" 2 "EV_CriticalDelayElapsed" 1 "EV_HV_CriticalFailure" 0 "EV_Init" ;
VAL_TABLE_ BMU_Events 17 "EV_ANY" 16 "EV_Balance_Stop" 15 "EV_Balance_Start" 14 "EV_Cockpit_BRB_Unpressed" 13 "EV_Cockpit_BRB_Pressed" 12 "EV_Notification_Stop" 11 "EV_Charge_Error" 10 "EV_Notification_Done" 9 "EV_Charge_Start" 8 "EV_Enter_Charge_Mode" 7 "EV_FaultMonitorReady" 6 "EV_IMD_Ready" 5 "EV_HV_Fault" 4 "EV_PrechargeDischarge_Fail" 3 "EV_Discharge_Finished" 2 "EV_Precharge_Finished" 1 "EV_HV_Toggle" 0 "EV_Init" ;
VAL_TABLE_ PDU_States 5 "STATE_ANY" 4 "STATE_Critical_Failure" 3 "STATE_Warning_Critical" 2 "STATE_Motors_On" 1 "STATE_Boards_On" 0 "STATE_Boards_Off" ;
VAL_TABLE_ VCU_States 5 "STATE_ANY" 4 "STATE_Failure_Fatal" 3 "STATE_EM_Enable" 2 "STATE_HV_Enable" 1 "STATE_HV_Disable" 0 "STATE_Self_Check" ;
VAL_TABLE_ DCU_States 4 "STATE_ANY" 3 "STATE_Failure_Fatal" 2 "STATE_EM_Enable" 1 "STATE_HV_Enable" 0 "STATE_HV_Disable" ;
VAL_TABLE_ BMU_States 11 "STATE_ANY" 10 "STATE_Balancing" 9 "STATE_Failure_CBRB_Enabled" 8 "STATE_Failure_CBRB_Disabled" 7 "STATE_Failure_Fatal" 6 "STATE_Charging" 5 "STATE_Discharge" 4 "STATE_Precharge" 3 "STATE_HV_Enable" 2 "STATE_HV_Disable" 1 "STATE_Wait_System_Up" 0 "STATE_Self_Check" ;
VAL_TABLE_ BMS_State 7 "Failure_Fatal" 6 "Charging" 5 "Discharge" 4 "Precharge" 3 "HV_Enable" 2 "HV_Disable" 1 "Wait_System_Up" 0 "Self_Check" ;
VAL_TABLE_ Contactor 4 "CONTACTOR_FAULT_CLOSED" 3 "CONTACTOR_FAULT_OPEN" 2 "CONTACTOR_CLOSED" 1 "CONTACTOR_OPEN" 0 "INVALID" ;
VAL_TABLE_ DCDC_State 3 "Error" 2 "On" 1 "Off" 0 "Invalid" ;
Expand Down Expand Up @@ -67,6 +75,46 @@ BO_ 3221225472 VECTOR__INDEPENDENT_SIG_MSG: 0 Vector__XXX
SG_ ChannelCurrentMCRight : 0|16@1+ (0.01,0) [0|0] "Amps" Vector__XXX
SG_ ChannelCurrentAUX : 0|16@1+ (0.01,0) [0|0] "" Vector__XXX

BO_ 2298478347 WSBRR_State_Change: 8 WSBRR
SG_ StateMachineState : 16|8@1- (1,0) [0|0] "" Vector__XXX
SG_ StateMachineNewState : 8|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ StateMachineEvent : 0|8@1- (1,0) [0|0] "" Vector__XXX

BO_ 2298478346 WSBRL_State_Change: 8 WSBRL
SG_ StateMachineState : 16|8@1- (1,0) [0|0] "" Vector__XXX
SG_ StateMachineNewState : 8|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ StateMachineEvent : 0|8@1- (1,0) [0|0] "" Vector__XXX

BO_ 2298478345 WSBFR_State_Change: 8 WSBFR
SG_ StateMachineState : 16|8@1- (1,0) [0|0] "" Vector__XXX
SG_ StateMachineNewState : 8|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ StateMachineEvent : 0|8@1- (1,0) [0|0] "" Vector__XXX

BO_ 2298478344 WSBFL_State_Change: 8 WSBFL
SG_ StateMachineState : 16|8@1- (1,0) [0|0] "" Vector__XXX
SG_ StateMachineNewState : 8|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ StateMachineEvent : 0|8@1- (1,0) [0|0] "" Vector__XXX

BO_ 2298478343 DCU_State_Change: 8 DCU
SG_ StateMachineState_DCU : 16|8@1- (1,0) [0|0] "" Vector__XXX
SG_ StateMachineNewState_DCU : 8|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ StateMachineEvent_DCU : 0|8@1- (1,0) [0|0] "" Vector__XXX

BO_ 2298478339 PDU_State_Change: 8 PDU
SG_ StateMachineState_PDU : 16|8@1- (1,0) [0|0] "" Vector__XXX
SG_ StateMachineNewState_PDU : 8|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ StateMachineEvent_PDU : 0|8@1- (1,0) [0|0] "" Vector__XXX

BO_ 2298478338 VCU_State_Change: 8 VCU_F7
SG_ StateMachineState_VCU : 16|8@1- (1,0) [0|0] "" Vector__XXX
SG_ StateMachineNewState_VCU : 8|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ StateMachineEvent_VCU : 0|8@1- (1,0) [0|0] "" Vector__XXX

BO_ 2298478337 BMU_State_Change: 8 BMU
SG_ StateMachineState_BMU : 16|8@1- (1,0) [0|0] "" Vector__XXX
SG_ StateMachineNewState_BMU : 8|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ StateMachineEvent_BMU : 0|8@1- (1,0) [0|0] "" Vector__XXX

BO_ 2282621955 PDU_Charging_Lipo_Status: 1 PDU
SG_ Charging_Lipo_Status : 0|4@1+ (1,0) [0|0] "" Vector__XXX

Expand Down Expand Up @@ -1270,6 +1318,18 @@ BA_ "GenMsgCycleTime" BO_ 2365563393 100;
BA_ "GenMsgCycleTime" BO_ 2365563137 100;
BA_ "GenMsgCycleTime" BO_ 2365562881 100;
BA_ "GenMsgCycleTime" BO_ 2365566977 3;
VAL_ 2298478343 StateMachineState_DCU 4 "STATE_ANY" 3 "STATE_Failure_Fatal" 2 "STATE_EM_Enable" 1 "STATE_HV_Enable" 0 "STATE_HV_Disable" ;
VAL_ 2298478343 StateMachineNewState_DCU 4 "STATE_ANY" 3 "STATE_Failure_Fatal" 2 "STATE_EM_Enable" 1 "STATE_HV_Enable" 0 "STATE_HV_Disable" ;
VAL_ 2298478343 StateMachineEvent_DCU 8 "EV_ANY" 7 "EV_Fatal" 6 "EV_CAN_Receive_EM" 5 "EV_CAN_Receive_HV" 4 "EV_BTN_Endurance_Lap" 3 "EV_BTN_Endurance_Mode_Toggle" 2 "EV_BTN_TC_Toggle" 1 "EV_BTN_EM_Toggle" 0 "EV_BTN_HV_Toggle" ;
VAL_ 2298478339 StateMachineState_PDU 5 "STATE_ANY" 4 "STATE_Critical_Failure" 3 "STATE_Warning_Critical" 2 "STATE_Motors_On" 1 "STATE_Boards_On" 0 "STATE_Boards_Off" ;
VAL_ 2298478339 StateMachineNewState_PDU 5 "STATE_ANY" 4 "STATE_Critical_Failure" 3 "STATE_Warning_Critical" 2 "STATE_Motors_On" 1 "STATE_Boards_On" 0 "STATE_Boards_Off" ;
VAL_ 2298478339 StateMachineEvent_PDU 6 "EV_ANY" 5 "EV_Cycle_MC" 4 "EV_EM_Disable" 3 "EV_EM_Enable" 2 "EV_CriticalDelayElapsed" 1 "EV_HV_CriticalFailure" 0 "EV_Init" ;
VAL_ 2298478338 StateMachineState_VCU 5 "STATE_ANY" 4 "STATE_Failure_Fatal" 3 "STATE_EM_Enable" 2 "STATE_HV_Enable" 1 "STATE_HV_Disable" 0 "STATE_Self_Check" ;
VAL_ 2298478338 StateMachineNewState_VCU 5 "STATE_ANY" 4 "STATE_Failure_Fatal" 3 "STATE_EM_Enable" 2 "STATE_HV_Enable" 1 "STATE_HV_Disable" 0 "STATE_Self_Check" ;
VAL_ 2298478338 StateMachineEvent_VCU 13 "EV_ANY" 12 "EV_Inverter_Fault" 11 "EV_Fatal" 10 "EV_Throttle_Failure" 9 "EV_Brake_Pressure_Fault" 8 "EV_BTN_Endurance_Mode_Toggle" 7 "EV_CAN_Receive_HV" 6 "EV_BTN_TC_Toggle" 5 "EV_BTN_EM_Toggle" 4 "EV_BTN_HV_Toggle" 3 "EV_Hv_Disable" 2 "EV_Bps_Fail" 1 "EV_EM_Toggle" 0 "EV_Init" ;
VAL_ 2298478337 StateMachineState_BMU 11 "STATE_ANY" 10 "STATE_Balancing" 9 "STATE_Failure_CBRB_Enabled" 8 "STATE_Failure_CBRB_Disabled" 7 "STATE_Failure_Fatal" 6 "STATE_Charging" 5 "STATE_Discharge" 4 "STATE_Precharge" 3 "STATE_HV_Enable" 2 "STATE_HV_Disable" 1 "STATE_Wait_System_Up" 0 "STATE_Self_Check" ;
VAL_ 2298478337 StateMachineNewState_BMU 11 "STATE_ANY" 10 "STATE_Balancing" 9 "STATE_Failure_CBRB_Enabled" 8 "STATE_Failure_CBRB_Disabled" 7 "STATE_Failure_Fatal" 6 "STATE_Charging" 5 "STATE_Discharge" 4 "STATE_Precharge" 3 "STATE_HV_Enable" 2 "STATE_HV_Disable" 1 "STATE_Wait_System_Up" 0 "STATE_Self_Check" ;
VAL_ 2298478337 StateMachineEvent_BMU 17 "EV_ANY" 16 "EV_Balance_Stop" 15 "EV_Balance_Start" 14 "EV_Cockpit_BRB_Unpressed" 13 "EV_Cockpit_BRB_Pressed" 12 "EV_Notification_Stop" 11 "EV_Charge_Error" 10 "EV_Notification_Done" 9 "EV_Charge_Start" 8 "EV_Enter_Charge_Mode" 7 "EV_FaultMonitorReady" 6 "EV_IMD_Ready" 5 "EV_HV_Fault" 4 "EV_PrechargeDischarge_Fail" 3 "EV_Discharge_Finished" 2 "EV_Precharge_Finished" 1 "EV_HV_Toggle" 0 "EV_Init" ;
VAL_ 2147483648 StateContactorPositive 0 "INVALID" 1 "CONTACTOR_OPEN" 2 "CONTACTOR_CLOSED" 3 "CONTACTOR_FAULT_OPEN" 4 "CONTACTOR_FAULT_CLOSED" ;
VAL_ 2147483648 StateContactorNegative 0 "INVALID" 1 "CONTACTOR_OPEN" 2 "CONTACTOR_CLOSED" 3 "CONTACTOR_FAULT_OPEN" 4 "CONTACTOR_FAULT_CLOSED" ;
VAL_ 2297236481 BMU_checkFailed 512 "FSM_STATE_FAILED" 256 "HW_CHECK_FAILED" 128 "TSMS_FAILED" 64 "CBRB_FAILED" 32 "IMD_FAILED" 16 "AMS_FAILED" 8 "HVD_FAILED" 4 "BSPD_FAILED" 2 "EBOX_FAILED" 1 "BOTS_FAILED" 0 "No Fault" ;
Expand Down
41 changes: 41 additions & 0 deletions common/Src/state_machine.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,47 @@ HAL_StatusTypeDef fsmProcessEvent(FSM_Handle_Struct *handle, uint32_t event)
ERROR_PRINT("FSM: New state out of range\n");
return HAL_ERROR;
} else {
#if BOARD_ID == ID_BMU
StateMachineEvent_BMU = event;
StateMachineNewState_BMU = newState;
StateMachineState_BMU = current_state;
sendCAN_BMU_State_Change();
#elif BOARD_ID == ID_DCU
StateMachineEvent_DCU = event;
StateMachineNewState_DCU = newState;
StateMachineState_DCU = current_state;
sendCAN_DCU_State_Change();
#elif BOARD_ID == ID_VCU_F7
StateMachineEvent_VCU = event;
StateMachineNewState_VCU = newState;
StateMachineState_VCU = current_state;
sendCAN_VCU_State_Change();
#elif BOARD_ID == ID_PDU
StateMachineEvent_PDU = event;
StateMachineNewState_PDU = newState;
StateMachineState_PDU = current_state;
sendCAN_PDU_State_Change();
#elif BOARD_ID == ID_WSBFL
StateMachineEvent = event;
StateMachineNewState = newState;
StateMachineState = current_state;
sendCAN_WSBFL_State_Change();
#elif BOARD_ID == ID_WSBFR
StateMachineEvent = event;
StateMachineNewState = newState;
StateMachineState = current_state;
sendCAN_WSBFR_State_Change();
#elif BOARD_ID == ID_WSBRL
StateMachineEvent = event;
StateMachineNewState = newState;
StateMachineState = current_state;
sendCAN_WSBRL_State_Change();
#elif BOARD_ID == ID_WSBRR
StateMachineEvent = event;
StateMachineNewState = newState;
StateMachineState = current_state;
sendCAN_WSBRR_State_Change();
#endif
handle->state = newState;
break;
}
Expand Down