Firmware for the Mk.11 vehicle control unit, running on an STM32 H723ZGT microcontroller.
The VCU manages the main drive-state flow for the vehicle:
- Reads pedal sensors through ADC + DMA.
- Calculates and transmits torque requests to a Cascadia Motion CM200DX Inverter.
- Handles precharge sequencing and response tracking.
- Plays the ready-to-drive sound over I2S.
- Processes BMS and Inverter temperatures to send cooling commands over CAN to control fans.
Core/Src/main.cinitializes hardware, configures FDCAN filters, starts ADC DMA, and runs the main firmware loop.Core/Src/motor_control.chandles pedal processing, plausibility checks, torque calculation, and inverter CAN messages.Core/Src/prchg.cmanages the precharge request and response flow with timeout handling.Core/Src/cooling.csends cooling control frames.Core/Src/audio.chandles ready-to-drive sound playback over I2S.Core/Src/fdcan.cconfigures FDCAN peripherals and routes received CAN frames.Core/Src/vcu_state.cmanages the VCU state accordingly in case of loss of shutdown power.