TUFAN-AKS is the Vehicle Control Unit (VCU / AKS) firmware for the TUFAN electric vehicle platform. The project targets ESP32 with ESP-IDF through PlatformIO, uses FreeRTOS for task-based concurrency, and keeps all application code in C++17 without Arduino core dependencies.
- PlatformIO environment:
env:esp32dev - Framework: ESP-IDF
- Language standard: C++17
- Main transport interfaces: CAN, SPI, UART
The current firmware repository is organized around seven runtime nodes / code areas:
-
src/main.cppApplication entry point, task creation, watchdog refresh points, and inter-task queue wiring. -
src/VcuLogic.*Event-driven VCU state machine forINIT,IDLE,READY,DRIVE,EMERGENCY_STOP, andFAULT. -
lib/CanManagerTWAI/CAN transport, motor driver communication, BMS frame parsing, and CAN-originated fault reporting. -
lib/RelayManagerMCP23S17-based active-low relay control for the positive contactor bank. -
lib/DisplayHMINextion HMI UART transport and command handling. -
lib/TelemetryLoRa / telemetry packet formatting and UART uplink support. -
include/SystemConfig.hShared pin map, message IDs, timing constants, LoRa mode defaults, and relay channel definitions.
The active CAN message set is documented in CAN_Message_Table.md.
Implemented frames:
0x100: torque command0x200: motor status0xE000: Lithium Balance BMS config0xE001: Lithium Balance BMS live
The selected E32 startup mode for the next implementation step is normal mode:
M0 = 0M1 = 0
Planned integration notes:
- Configure
LORA_M0_PINandLORA_M1_PINbefore UART traffic starts. - Use
LORA_AUX_PINas a readiness gate before telemetry transmission. - Keep telemetry TX in transparent UART mode unless the protocol contract later requires framed configuration mode access.
All ten relay channels are currently treated as positive contactor outputs. The software channel numbers are fixed, but the final harness-level physical assignments still need to be validated against the wiring package. Until that validation is complete, allOn() and allOff() should be treated as bank-wide operations on the positive contactor group, not as independently named vehicle loads.
Based on current git history, the repository contributors are:
- Sedat Ali Zevit - Seqat
- incubation-0
- Mesalt-f4
- Order
- Nisa Köken - NisaKoken
Contributor workflow and naming rules are documented in CONTRIBUTING.md.