# rit-launch-initiative/fsw architecture

> Architecture diagram of the GitHub repository rit-launch-initiative/fsw, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rit-launch-initiative/fsw
- Repository: https://github.com/rit-launch-initiative/fsw

## Overview

##### Project type and purpose
- This is an embedded flight-software framework (“Launch Flight Software”) built on Zephyr RTOS.
- It targets modular custom hardware (“backplane” with power, sensor, radio, deployment modules), plus ground-station components (receiver module, TFTP server), payload software, and host-side tooling.
- It includes drivers, board descriptions, common libraries (f_core, launch_core_classic), application folders under app/, sample projects, and developer tools.

##### File structure
- Top-level build scripts: CMakeLists.txt, Makefile, west.yml, GitHub workflows under .github.
- app/ – Zephyr applications, grouped by flight hardware (backplane modules), ground station, payload, samples, tests.
- boards/ – DTS, overlays, board-specific configs for each module.
- drivers/ – low-level sensor and ADC drivers.
- / & lib/ – common API headers (.h) and implementations (.cpp/.c) for f_core (OS abstractions, messaging, networking, radio, utils) and launch_core_classic layers.
- tools/ – Python scripts for code generation (autocoders), data-log checking, payload sending, test harness.
- data/ & snippets/ – input YAML, CSV, code templates for simulations and configuration.

##### Additional insights from README
- Build and simulation workflows: make <app> or west build <app> -b <BOARD>.
- Simulation support via native_sim, with simulated sensors, networking (eth_posix), flash persistence.
- Hardware flashing via west flash to real boards.

##### Essential details
- Dependencies: apps link to f_core & launch_core_classic → link to drivers → interact with board.
- Simulation vs real hardware paths: native_sim network interface, flash.bin vs real flash.
- CI/CD build step (GitHub Actions) feeding into boards.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Host Tooling"
        CI["GitHub Actions"]:::host
        WestCmd["West Commands"]:::host
        Tools["Python Scripts"]:::host
    end

    subgraph "Zephyr RTOS"
        Kernel["Zephyr Kernel"]:::core

        subgraph "Common Libraries"
            fcore_hdr["f_core (headers)"]:::lib
            fcore_impl["f_core (implementation)"]:::lib
            lcc_hdr["launch_core_classic (headers)"]:::lib
            lcc_impl["launch_core_classic (implementation)"]:::lib
        end

        subgraph "Drivers"
            ADC["ADC Drivers"]:::drv
            SensorDrv["Sensor Drivers"]:::drv
        end

        subgraph "Board Support"
            BS_Deployment["Deployment Module BSP"]:::hw
            BS_Power["Power Module BSP"]:::hw
            BS_Radio["Radio Module BSP"]:::hw
            BS_Sensor["Sensor Module BSP"]:::hw
        end

        subgraph "Application Tenants"
            DepApp["Deployment Module App"]:::app
            PowApp["Power Module App"]:::app
            RadApp["Radio Module App"]:::app
            SenApp["Sensor Module App"]:::app
            TFTPClient["TFTP Client Tenant"]:::app
        end
    end

    subgraph "Network Boundary"
        LoRaAPI["LoRa API (headers)"]:::net
        LoRaImpl["LoRa API (implementation)"]:::net
        UDP["UDP Interface"]:::net
    end

    subgraph "Ground Station"
        GRApp["Ground Receiver Module App"]:::gp
        TFTPServer["Ground TFTP Server App"]:::gp
    end

    CI -->|triggers build| Kernel
    WestCmd -->|extends west| Kernel
    Tools -->|generates code| Kernel

    Kernel --> fcore_hdr
    Kernel --> lcc_hdr
    fcore_hdr --> fcore_impl
    lcc_hdr --> lcc_impl

    fcore_impl --> ADC
    fcore_impl --> SensorDrv
    lcc_impl --> ADC
    lcc_impl --> SensorDrv

    ADC --> BS_Deployment
    ADC --> BS_Power
    SensorDrv --> BS_Sensor
    SensorDrv --> BS_Radio

    BS_Deployment --> DepApp
    BS_Power --> PowApp
    BS_Radio --> RadApp
    BS_Sensor --> SenApp

    DepApp -->|uses messaging| Kernel
    PowApp -->|uses messaging| Kernel
    SenApp -->|provides data| RadApp
    RadApp -->|LoRa Packets| LoRaAPI
    LoRaAPI --> LoRaImpl
    LoRaImpl --> GRApp
    RadApp -->|UDP Packets| UDP
    UDP --> GRApp
    GRApp -->|invokes update| TFTPServer
    TFTPClient -->|in-field update| DepApp

    classDef host fill:#D8BFD8,stroke:#9932CC,color:#000
    classDef core fill:#98FB98,stroke:#228B22,color:#000
    classDef lib fill:#90EE90,stroke:#2E8B57,color:#000
    classDef drv fill:#ADD8E6,stroke:#1E90FF,color:#000
    classDef hw fill:#D3D3D3,stroke:#696969,color:#000
    classDef app fill:#FFA500,stroke:#FF8C00,color:#000
    classDef net fill:#FFFACD,stroke:#DAA520,color:#000
    classDef gp fill:#D8BFD8,stroke:#9932CC,color:#000

    click DepApp "https://github.com/rit-launch-initiative/fsw/tree/main/app/backplane/deployment_module"
    click PowApp "https://github.com/rit-launch-initiative/fsw/tree/main/app/backplane/power_module"
    click RadApp "https://github.com/rit-launch-initiative/fsw/tree/main/app/backplane/radio_module"
    click SenApp "https://github.com/rit-launch-initiative/fsw/tree/main/app/backplane/sensor_module"
    click GRApp "https://github.com/rit-launch-initiative/fsw/tree/main/app/ground/receiver_module"
    click TFTPServer "https://github.com/rit-launch-initiative/fsw/tree/main/app/ground/tftp_server"
    click Kernel "https://github.com/rit-launch-initiative/fsw/blob/main/zephyr/module.yml"
    click fcore_hdr "https://github.com/rit-launch-initiative/fsw/tree/main/include/f_core"
    click fcore_impl "https://github.com/rit-launch-initiative/fsw/tree/main/lib/f_core"
    click lcc_hdr "https://github.com/rit-launch-initiative/fsw/tree/main/include/launch_core_classic"
    click lcc_impl "https://github.com/rit-launch-initiative/fsw/tree/main/lib/launch_core_classic"
    click ADC "https://github.com/rit-launch-initiative/fsw/tree/main/drivers/adc"
    click SensorDrv "https://github.com/rit-launch-initiative/fsw/tree/main/drivers/sensor"
    click LoRaAPI "https://github.com/rit-launch-initiative/fsw/blob/main/include/launch_core_classic/net/lora.h"
    click LoRaImpl "https://github.com/rit-launch-initiative/fsw/blob/main/lib/launch_core_classic/net/lora.c"
    click BS_Deployment "https://github.com/rit-launch-initiative/fsw/tree/main/boards/arm/deployment_module"
    click BS_Power "https://github.com/rit-launch-initiative/fsw/tree/main/boards/arm/power_module"
    click BS_Radio "https://github.com/rit-launch-initiative/fsw/tree/main/boards/arm/radio_module"
    click BS_Sensor "https://github.com/rit-launch-initiative/fsw/tree/main/boards/arm/sensor_module"
    click Tools "https://github.com/rit-launch-initiative/fsw/tree/main/tools/"
    click CI "https://github.com/rit-launch-initiative/fsw/tree/main/.github/workflows"
    click WestCmd "https://github.com/rit-launch-initiative/fsw/blob/main/scripts/west-commands.yml"
```
