# fprime-community/fprime-zephyr architecture

> Architecture diagram of the GitHub repository fprime-community/fprime-zephyr, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fprime-community/fprime-zephyr
- Repository: https://github.com/fprime-community/fprime-zephyr

## Overview

F Prime Zephyr is a platform-support package that adapts F Prime applications to Zephyr RTOS. Its main workflow is to integrate a deployment with Zephyr, then run it using Zephyr-backed drivers, OS services, and memory/filesystem support. An optional host-side flashing workflow touches a board’s serial port to request bootloader entry before flashing. The README documents the deployment and flashing flows; the source excerpts show selected driver, allocator, and touch-reset behavior, so unsampled subsystem links are omitted.

Main entry points: [`cmake/platform/zephyr/Platform`](https://github.com/fprime-community/fprime-zephyr/tree/main/cmake/platform/zephyr/Platform) (Zephyr platform support), [`ci/src/fprime_zephyr/plugins/zephyr_ci.py`](https://github.com/fprime-community/fprime-zephyr/blob/main/ci/src/fprime_zephyr/plugins/zephyr_ci.py) (Zephyr CI plugin), [`ci/src/fprime_zephyr/touch.py`](https://github.com/fprime-community/fprime-zephyr/blob/main/ci/src/fprime_zephyr/touch.py) (Touch and flash tool), [`fprime-zephyr/Fs/FatFilenameAllocator/FprimeZephyrFatFilenameAllocator.cpp`](https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Fs/FatFilenameAllocator/FprimeZephyrFatFilenameAllocator.cpp) (FatFs filename pool)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Platform integration"]
  node_platform["Zephyr platform support"]
  node_ci["Zephyr CI plugin<br/>[zephyr_ci.py]"]
  node_flash["Touch and flash tool<br/>[touch.py]"]
end

subgraph group_drivers["Device drivers"]
  node_adc["ADC driver"]
  node_gpio["GPIO driver"]
  node_i2c["I2C driver"]
  node_spi["SPI driver"]
  node_uart["UART driver"]
  node_rate["Rate driver"]
  node_lora["LoRa driver<br/>[LoRa.cpp]"]
end

subgraph group_os["OS services"]
  node_os["Zephyr OS adapters"]
  node_filesystem["Filesystem adapters<br/>[FileSystem.cpp]"]
end

subgraph group_memory["Memory and files"]
  node_heap["Shared heap allocator"]
  node_fatpool["FatFs filename pool"]
  node_fatconfig["Filename pool config"]
end

subgraph group_operations["Time and operations"]
  node_time["Zephyr time service<br/>[ZephyrTime.cpp]"]
  node_fatal["Fatal handler<br/>[FatalHandler.cpp]"]
  node_touchreset["Touch reset service"]
  node_bootentry["Bootloader entry"]
end

node_developer(("F Prime developer"))
node_deployment["F Prime deployment"]
node_board(("Zephyr board"))

node_developer -->|"configures"| node_deployment
node_deployment -->|"integrates"| node_platform
node_platform -.->|"enables"| node_adc
node_platform -.->|"enables"| node_gpio
node_platform -.->|"enables"| node_i2c
node_platform -.->|"enables"| node_spi
node_platform -.->|"enables"| node_uart
node_platform -.->|"enables"| node_rate
node_platform -.->|"enables"| node_lora
node_platform -.->|"provides adapters"| node_os
node_platform -.->|"provides adapters"| node_filesystem
node_platform -.->|"provides allocator"| node_heap
node_platform -.->|"provides allocator"| node_fatpool
node_platform -.->|"provides service"| node_time
node_platform -.->|"provides handler"| node_fatal
node_fatpool -->|"reads settings"| node_fatconfig
node_ci -->|"calls touch"| node_flash
node_ci -.->|"launches on"| node_board
node_flash -->|"touches and flashes"| node_board
node_board -->|"sends baud touch"| node_touchreset
node_touchreset -->|"invokes entry"| node_bootentry

click node_platform "https://github.com/fprime-community/fprime-zephyr/tree/main/cmake/platform/zephyr/Platform"
click node_adc "https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Drv/ZephyrADCDriver/ZephyrADCDriver.cpp"
click node_gpio "https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Drv/ZephyrGpioDriver/ZephyrGpioDriver.cpp"
click node_i2c "https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Drv/ZephyrI2cDriver/ZephyrI2cDriver.cpp"
click node_spi "https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Drv/ZephyrSpiDriver/ZephyrSpiDriver.cpp"
click node_uart "https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Drv/ZephyrUartDriver/ZephyrUartDriver.cpp"
click node_rate "https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Drv/ZephyrRateDriver/ZephyrRateDriver.cpp"
click node_lora "https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Drv/LoRa/LoRa.cpp"
click node_os "https://github.com/fprime-community/fprime-zephyr/tree/main/fprime-zephyr/Os"
click node_filesystem "https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Os/FileSystem.cpp"
click node_heap "https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Fw/Types/ZephyrSharedMultiHeapAllocator.cpp"
click node_fatpool "https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Fs/FatFilenameAllocator/FprimeZephyrFatFilenameAllocator.cpp"
click node_fatconfig "https://github.com/fprime-community/fprime-zephyr/blob/main/default/zephyr-config/FatFilenameAllocatorCfg.hpp"
click node_time "https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Svc/ZephyrTime/ZephyrTime.cpp"
click node_fatal "https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Svc/FatalHandler/FatalHandler.cpp"
click node_touchreset "https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Svc/ZephyrTouchReset/ZephyrTouchReset.cpp"
click node_bootentry "https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Svc/ZephyrTouchReset/BootloaderEntry.cpp"
click node_ci "https://github.com/fprime-community/fprime-zephyr/blob/main/ci/src/fprime_zephyr/plugins/zephyr_ci.py"
click node_flash "https://github.com/fprime-community/fprime-zephyr/blob/main/ci/src/fprime_zephyr/touch.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_platform,node_ci,node_flash toneBlue
class node_adc,node_gpio,node_i2c,node_spi,node_uart,node_rate,node_lora toneAmber
class node_os,node_filesystem toneMint
class node_heap,node_fatpool,node_fatconfig toneRose
class node_time,node_fatal,node_touchreset,node_bootentry,node_developer,node_deployment,node_board toneIndigo
```

## Components

### Platform integration

- [Zephyr platform support](https://github.com/fprime-community/fprime-zephyr/tree/main/cmake/platform/zephyr/Platform): `cmake/platform/zephyr/Platform`
- [Zephyr CI plugin](https://github.com/fprime-community/fprime-zephyr/blob/main/ci/src/fprime_zephyr/plugins/zephyr_ci.py): `ci/src/fprime_zephyr/plugins/zephyr_ci.py`
- [Touch and flash tool](https://github.com/fprime-community/fprime-zephyr/blob/main/ci/src/fprime_zephyr/touch.py): `ci/src/fprime_zephyr/touch.py`

### Device drivers

- [ADC driver](https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Drv/ZephyrADCDriver/ZephyrADCDriver.cpp): `fprime-zephyr/Drv/ZephyrADCDriver/ZephyrADCDriver.cpp`
- [GPIO driver](https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Drv/ZephyrGpioDriver/ZephyrGpioDriver.cpp): `fprime-zephyr/Drv/ZephyrGpioDriver/ZephyrGpioDriver.cpp`
- [I2C driver](https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Drv/ZephyrI2cDriver/ZephyrI2cDriver.cpp): `fprime-zephyr/Drv/ZephyrI2cDriver/ZephyrI2cDriver.cpp`
- [SPI driver](https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Drv/ZephyrSpiDriver/ZephyrSpiDriver.cpp): `fprime-zephyr/Drv/ZephyrSpiDriver/ZephyrSpiDriver.cpp`
- [UART driver](https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Drv/ZephyrUartDriver/ZephyrUartDriver.cpp): `fprime-zephyr/Drv/ZephyrUartDriver/ZephyrUartDriver.cpp`
- [Rate driver](https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Drv/ZephyrRateDriver/ZephyrRateDriver.cpp): `fprime-zephyr/Drv/ZephyrRateDriver/ZephyrRateDriver.cpp`
- [LoRa driver](https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Drv/LoRa/LoRa.cpp): `fprime-zephyr/Drv/LoRa/LoRa.cpp`

### OS services

- [Zephyr OS adapters](https://github.com/fprime-community/fprime-zephyr/tree/main/fprime-zephyr/Os): `fprime-zephyr/Os`
- [Filesystem adapters](https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Os/FileSystem.cpp): `fprime-zephyr/Os/FileSystem.cpp`

### Memory and files

- [Shared heap allocator](https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Fw/Types/ZephyrSharedMultiHeapAllocator.cpp): `fprime-zephyr/Fw/Types/ZephyrSharedMultiHeapAllocator.cpp`
- [FatFs filename pool](https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Fs/FatFilenameAllocator/FprimeZephyrFatFilenameAllocator.cpp): `fprime-zephyr/Fs/FatFilenameAllocator/FprimeZephyrFatFilenameAllocator.cpp`
- [Filename pool config](https://github.com/fprime-community/fprime-zephyr/blob/main/default/zephyr-config/FatFilenameAllocatorCfg.hpp): `default/zephyr-config/FatFilenameAllocatorCfg.hpp`

### Time and operations

- [Zephyr time service](https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Svc/ZephyrTime/ZephyrTime.cpp): `fprime-zephyr/Svc/ZephyrTime/ZephyrTime.cpp`
- [Fatal handler](https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Svc/FatalHandler/FatalHandler.cpp): `fprime-zephyr/Svc/FatalHandler/FatalHandler.cpp`
- [Touch reset service](https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Svc/ZephyrTouchReset/ZephyrTouchReset.cpp): `fprime-zephyr/Svc/ZephyrTouchReset/ZephyrTouchReset.cpp`
- [Bootloader entry](https://github.com/fprime-community/fprime-zephyr/blob/main/fprime-zephyr/Svc/ZephyrTouchReset/BootloaderEntry.cpp): `fprime-zephyr/Svc/ZephyrTouchReset/BootloaderEntry.cpp`

### Other components

- **F Prime developer**
- **F Prime deployment**
- **Zephyr board**

## Connections

- F Prime developer → F Prime deployment: configures (evidence: `README.md`)
- F Prime deployment → Zephyr platform support: integrates (evidence: `README.md`)
- Zephyr platform support → ADC driver: enables
- Zephyr platform support → GPIO driver: enables
- Zephyr platform support → I2C driver: enables
- Zephyr platform support → SPI driver: enables
- Zephyr platform support → UART driver: enables
- Zephyr platform support → Rate driver: enables
- Zephyr platform support → LoRa driver: enables
- Zephyr platform support → Zephyr OS adapters: provides adapters
- Zephyr platform support → Filesystem adapters: provides adapters
- Zephyr platform support → Shared heap allocator: provides allocator
- Zephyr platform support → FatFs filename pool: provides allocator
- Zephyr platform support → Zephyr time service: provides service
- Zephyr platform support → Fatal handler: provides handler
- FatFs filename pool → Filename pool config: reads settings (evidence: `fprime-zephyr/Fs/FatFilenameAllocator/FprimeZephyrFatFilenameAllocator.cpp`)
- Zephyr CI plugin → Touch and flash tool: calls touch (evidence: `ci/src/fprime_zephyr/plugins/zephyr_ci.py`)
- Zephyr CI plugin → Zephyr board: launches on
- Touch and flash tool → Zephyr board: touches and flashes (evidence: `README.md`)
- Zephyr board → Touch reset service: sends baud touch (evidence: `README.md`)
- Touch reset service → Bootloader entry: invokes entry (evidence: `fprime-zephyr/Svc/ZephyrTouchReset/ZephyrTouchReset.cpp`)
