This project is part of the TDT4295 course at NTNU and focuses on building a flight simulator on custom hardware. This repository contains the source code for the MCU part of the project, utilizing the Silicon Labs EFM32GG chipset.
The flight simulator uses the EFM32GG842F1024 MCU to handle user inputs, updates to the segment displays, and communication with custom hardware components like SPI communication to an FPGA and various control interfaces. The goal is to create a basic flight simulation program using optimized low-level programming.
- Real-time flight simulation with a simple physics simulation.
- Path-following opponents that act as targets for the shooting functionality.
- User inputs using physical components like joystick and buttons to control in-flight functions such as throttle, roll, and pitch.
- Data communication between the MCU and FPGA using a predefined SPI protocol.
- Simplicity Studio by Silicon Labs for development, building, and debugging.
- Silicon Labs Gecko SDK integrated within Simplicity Studio.
The project is built using Silicon Labs Simplicity Studio:
-
Clone the repository to your local machine:
git clone https://github.com/yourusername/flight-sim-hardware.git cd flight-sim-hardware
-
Open Simplicity Studio and import the project:
- Go to
File
>Import
>Simplicity Studio Project
. - Select the cloned repository and open the project.
- Go to
-
Build the project:
- Select the desired build configuration (e.g.,
Debug
). - Click the hammer icon to compile the project.
- The resulting binary will be generated in the output folder as a
.hex
file.
- Select the desired build configuration (e.g.,
- Giant Gecko Development Board to act as a debugger.
- SWO debug header connection to the custom PCB.
-
Connect the Giant Gecko Board to your PC via USB.
-
Connect the custom PCB to the Giant Gecko Board:
- Use the 20-pin connector to link the Giant Gecko to the custom PCB.
- Ensure that the custom PCB is powered on.
-
Configure the Giant Gecko Board in Simplicity Studio:
- In Simplicity Studio, go to the
Debug Adapters
section. - Select the connected Giant Gecko board.
- Set the
Debug Mode
to OUT.
- In Simplicity Studio, go to the
-
Set the target device:
- In Simplicity Studio, ensure that the target part is set to EFM32GG842F1024.
-
Flash the hex file:
- Open the Simplicity Commander tool within Simplicity Studio.
- Select the Giant Gecko board and navigate to the Flash Utility.
- Load the compiled
.hex
file and press Flash.
-
Debugging:
- Open the SWO Terminal in Simplicity Studio.
- Press Start to see debug output from the MCU.