Skip to content

Repository files navigation

mini-cFS: Lightweight Core Flight System for CubeSats

A modular, hardware-agnostic framework for CubeSat flight software using C++20 coroutines and libhal.

Features

  • Lightweight: Optimized for resource-constrained CubeSats
  • Hardware-Agnostic: Complete hardware independence through libhal abstractions
  • Coroutine-Based: Efficient multitasking without a heavy RTOS
  • Modular: Plug-and-play application architecture
  • Message-Driven: Publish/subscribe communication between components

Core Components

  • Software Bus: Coroutine-based message passing system
  • Scheduler: Efficient task scheduling using C++20 coroutines
  • Executive Services: Application lifecycle management
  • Time Service: Hardware-agnostic timing utilities

Getting Started

Before using mini-cFS, follow the libhal Getting Started guide.

Installing Platform Profiles

For ARM MCU profiles:

conan config install -sf conan/profiles/v1 -tf profiles https://github.com/libhal/libhal-arm-mcu.git

micromod profiles:

conan config install -sf conan/profiles/v1 -tf profiles https://github.com/libhal/libhal-micromod.git

Building the Framework

conan build . -pr <target_name> -pr <compiler>

For example, for the lpc4078:

conan build . -pr lpc4078 -pr arm-gcc-12.3

For the STM32F103 MicroMod V4:

conan build . -pr mod-stm32f1-v4 -pr arm-gcc-12.3

CubeSat Application Demo

The framework includes a complete CubeSat application in the demos/applications directory that demonstrates a full satellite software system with the following subsystems:

  • Housekeeping
  • Command & Data Handling
  • Power Management
  • Thermal Control
  • Attitude Determination and Control
  • Telemetry

Build and run:

conan build . -pr <target_name> -pr <compiler>

Supported Platforms

  • lpc4078
  • lpc4074
  • stm32f103c8
  • micromod
    • lpc4078 MicroMod V5
    • stm32f103c8 MicroMod V4

Creating Applications

mini-cFS applications are C++ classes that inherit from the hal::mini_cfs::Application base class:

class MyApplication : public hal::mini_cfs::Application {
public:
  MyApplication(const std::string& name, hal::mini_cfs::AppId id, hal::mini_cfs::ResourceList resources)
    : Application(name, id, std::move(resources)) {}
  
  hal::mini_cfs::Task initialize() override {
    // Initialize application
    co_return;
  }
  
  hal::mini_cfs::Task execute() override {
    // Main application logic
    co_await delay(1000); // Example non-blocking delay
  }
  
  hal::mini_cfs::Task cleanup() override {
    // Clean up resources
    co_return;
  }
};

Hardware Integration

mini-cFS uses libhal to abstract hardware details:

  1. Create a platform-specific initialization file in platforms/
  2. Initialize hardware resources using libhal drivers
  3. Applications access hardware through libhal interfaces

See platforms/lpc4078.cpp for an example.

Understanding the Architecture

See ARCHITECTURE.md for detailed information about:

  • Core components and their relationships
  • How C++20 coroutines are leveraged
  • Message passing system design
  • Hardware abstraction approach
  • Application lifecycle management

License

Licensed under the Apache License, Version 2.0.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

Generated from libhal/libhal-starter