This repository provides a hardware-less execution environment for the Team Phantom Vehicle Control Unit (VCU). By emulating the FreeRTOS kernel on Windows and Linux, it enables developers to execute, test, and modify the VCU firmware codebase in a virtualized environment.
The VCU SIL (Software-in-the-Loop) framework decouples software logic from the physical microcontroller, allowing for rapid debugging and the foundation of an automated CI/CD pipeline without the need for physical hardware for the Formula SAE rules
Architecture of Integrated Repos
This repository acts as a central hub that orchestrates the following components:
-
VCU Firmware Logic: Utilizes production logic while abstracting the hardware abstraction layer (HAL) from the main VCU repositories:
1. vcu-fw — Core VCU control logic.
2. hercules-phantom-lib — Driver and utility libraries. -
Real-Time Execution: Emulates the FreeRTOS Kernel (Windows/Linux Port) to provide deterministic task scheduling and multi-threading on a standard PC.
-
Downstream Target: This repositroy functions as the execution target for the Python Testing Framework. It receives millisecond-interval sensor data via IPC pipes and returns real-time state logs.
- macOS 10.15+ or Linux (Ubuntu 20.04+, or similar)
- GCC or Clang compiler (usually pre-installed on Mac/Linux)
- Make utility
- pthread library (usually included with the system)
-
Clone the Repository (with submodules):
git clone --recurse-submodules <repository_url>
This automatically initializes and updates all submodules, including checking out the correct branch (SIL-testing for hercules-phantom-lib).
Alternative (if you already cloned without the flag):
git clone <repository_url> cd VCU-SIL-Framework-Setup git submodule update --init --recursive
- Open the project in Visual Studio 2022 with administrator priveledges
-
Ensure that Visual Studio 2022 is set up correctly for C++ development.
-
Click on the local Windows debugger to compile and execute the project.
-
The application should start running if the setup is done correctly.
The project includes a Makefile that uses the FreeRTOS Posix port, allowing compilation on Mac and Linux systems.
-
Compile the project:
make
This will create the executable at
build/VCU-firmware-local -
Run the application:
make run
Or directly:
./build/VCU-firmware-local
-
Clean build artifacts:
make clean
Note: The Makefile uses the FreeRTOS Posix port (FreeRTOS/Source/portable/ThirdParty/GCC/Posix) instead of the Windows MSVC-MingW port, providing the same functionality on Unix-like systems.
- This setup does not require any VCU hardware.
- Windows: Ensure that Visual Studio 2022 is properly configured for C++ development with desktop development extension installed.
- Mac/Linux: The project uses the FreeRTOS Posix port for Unix-like systems. Ensure GCC/Clang and Make are installed.
- Initializing submodules is crucial for the proper functioning of the framework.
- The project can be compiled on Windows (Visual Studio 2022), Mac, or Linux using the provided build systems.
If you encounter any issues during setup or execution, please refer to the documentation in the Team Phantom Google Drive or contact @kevinl03
This framework is built upon various open-source libraries and tools including freeRTOS kernel https://www.freertos.org/FAQWhat.html We acknowledge the contributions of the developers and maintainers of these projects.
