CubeSat Flight Software with F Prime

Build the command and data handling brain of a CubeSat using NASA's own framework.

Undergraduate Flight Software 5–7 weeks
Last reviewed: March 2026

Overview

Flight software is the nervous system of every spacecraft — it interprets commands from the ground, manages onboard subsystems, formats and downlinks telemetry, and responds to faults autonomously when the round-trip light time to Earth makes human intervention impossible. For CubeSats, where mass and power constraints preclude redundant processors, the software must be lean, deterministic, and rigorously tested. NASA's F Prime (F´) framework provides a component-based architecture and ground support tool (GDS) designed specifically for these constraints, and it has been flight-proven on Mars Ingenuity Helicopter and several CubeSat missions.

In this project you will implement a representative CubeSat C&DH system in F Prime. The system includes a Command Dispatcher that receives and validates uplink commands, an EPS (Electrical Power System) monitor component that reads simulated battery state-of-charge and raises events when thresholds are crossed, a telemetry database that packetises housekeeping data, and a simple Fault Management component that implements a safe-mode state machine triggered by undervoltage or over-temperature conditions. All components are connected in an F Prime topology and exercised using the GDS command sequencer and telemetry viewer.

CubeSat flight software development is one of the most complete systems engineering exercises available to undergraduates because it integrates software architecture, real-time systems, verification and validation, and space operations procedures. F Prime proficiency is increasingly listed in small satellite job postings at NASA centres, JPL, and commercial new-space companies.

What You'll Learn

  • Understand the F Prime component port architecture and how components communicate via typed ports
  • Implement F Prime components in C++ with command handlers, telemetry channels, and event log entries
  • Define an F Prime topology connecting components and generate the boilerplate using the F Prime build system
  • Implement a fault management state machine that transitions a simulated CubeSat into and out of safe mode
  • Use the F Prime GDS to send commands, monitor telemetry, and verify event logs in a software-in-the-loop test

Step-by-Step Guide

1

Set up F Prime and understand the architecture

Clone the F Prime repository and follow the Getting Started tutorial to build and run the Ref application. Study the component model: understand how FPP (F Prime Prime) definition files declare ports, commands, telemetry channels, events, and parameters. Draw a block diagram of the components you will implement for the CubeSat C&DH before writing any code.

2

Implement the EPS Monitor component

Define an EpsMonitor component in FPP with a rate-group input port, two telemetry channels (battery voltage, state of charge), two events (LOW_BATTERY_WARNING, CRITICAL_UNDERVOLTAGE), and one output port to signal the Fault Manager. Implement the C++ handler that reads from a simulated sensor input, emits telemetry, and raises events when thresholds are crossed. Unit-test with the F Prime unit test framework using injected mock values.

3

Implement the Fault Management state machine

Define a FaultManager component with states NOMINAL, SAFE_MODE, and RECOVERY. The component responds to fault signals from EpsMonitor and a thermal monitor stub. In SAFE_MODE, it commands payload power off via an output port. Implement the state machine using a simple switch-case handler (no external state machine library) and write unit tests for all valid transitions.

4

Define the topology and integrate components

Write the F Prime topology FPP file connecting EpsMonitor, FaultManager, the standard Command Dispatcher, Event Logger, and Telemetry Database components. Add a rate group at 1 Hz driving the EPS monitor. Generate the topology using the F Prime build system (fprime-util generate) and resolve any port type mismatches. Build the full deployment and verify it compiles cleanly.

5

Run end-to-end tests with the GDS

Launch the F Prime GDS and connect it to the software-in-the-loop executable. Send a PING command and verify the response. Inject a simulated low-battery condition by sending a command that overrides the EPS voltage reading. Verify in the GDS telemetry viewer that the LOW_BATTERY_WARNING event fires, followed by the SAFE_MODE transition event, and that the payload power output port activates. Screenshot the GDS session for your report.

6

Write a software design document

Produce a Software Design Document (SDD) following NASA NPR 7150.2 style: include a system overview, component descriptions with port interfaces, state machine diagrams for FaultManager, test results from unit and integration testing, and a requirements traceability matrix linking each requirement to the implementing component and test case.

Go Further

  • Add an AttitudeController component that receives simulated IMU data and commands reaction wheel torque to detumble the CubeSat after deployment.
  • Implement a command sequencer that reads and executes a time-tagged command script, simulating a pre-planned autonomous operations period during a ground contact gap.
  • Cross-compile the F Prime deployment for a Raspberry Pi and run it on hardware, connecting to the GDS over a USB serial link to simulate a real ground station pass.