# prusa3d/prusa-firmware-buddy architecture

> Architecture diagram of the GitHub repository prusa3d/prusa-firmware-buddy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prusa3d/prusa-firmware-buddy
- Repository: https://github.com/prusa3d/prusa-firmware-buddy

## Overview

Buddy is embedded firmware for Prusa 32-bit ARM printers. Its broad product workflow is printer operation through firmware, with XL systems additionally coordinating attached “puppy” controllers and optionally flashing their firmware at startup. The tree also shows GUI storage-management, LED control, and an HTTP server. The sampled sources establish only a few concrete calls between these areas; other links are omitted rather than inferred. The firmware entry point and several major subsystems are unsampled, so their internal runtime wiring is not represented.

Main entry points: [`src/leds/led_manager.cpp`](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/leds/led_manager.cpp) (LED manager), [`include/puppies/PuppyModbus.hpp`](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/include/puppies/PuppyModbus.hpp) (Puppy Modbus), [`src/buddy/main.cpp`](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/buddy/main.cpp) (Buddy firmware), [`src/gui/screen/screen_menu_internal_storage.cpp`](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/gui/screen/screen_menu_internal_storage.cpp) (Storage menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Printer firmware"]
  node_buddy_firmware["Buddy firmware<br/>[main.cpp]"]
  node_gui["Printer GUI<br/>[ScreenHandler.cpp]"]
  node_http_server["HTTP server<br/>[server.cpp]"]
  node_cmsis_dsp["DSP library"]
end

subgraph group_peripherals["Peripheral control"]
  node_led_manager["LED manager<br/>[led_manager.cpp]"]
  node_status_leds["Status LEDs"]
  node_side_leds["Side LEDs"]
  node_ac_leds["AC LEDs"]
end

subgraph group_storage["Storage"]
  node_storage_menu["Storage menu"]
  node_filesystem["Internal filesystem"]
  node_storage_driver["EEPROM driver<br/>[eeprom_storage.cpp]"]
end

subgraph group_puppies["Puppy controllers"]
  node_puppy_firmware["Puppy firmware<br/>[main.cpp]"]
  node_puppy_task["Puppy task<br/>[puppy_task.hpp]"]
  node_puppy_modbus["Puppy Modbus<br/>[PuppyModbus.hpp]"]
  node_ac_controller["AC controller<br/>[ac_controller.cpp]"]
end

node_printer_user(("Printer user"))
node_puppy_device{{"Puppy device"}}
node_browser(("HTTP client"))

node_printer_user -.->|"uses"| node_gui
node_storage_menu -->|"checks and formats"| node_filesystem
node_led_manager -->|"updates"| node_status_leds
node_led_manager -->|"updates"| node_side_leds
node_led_manager -->|"updates"| node_ac_leds
node_puppy_task -->|"refreshes through"| node_puppy_modbus
node_ac_controller -->|"refreshes through"| node_puppy_modbus
node_puppy_firmware -.->|"runs on"| node_puppy_device
node_buddy_firmware -->|"may flash at startup"| node_puppy_device
node_browser -.->|"requests"| node_http_server

click node_buddy_firmware "https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/buddy/main.cpp"
click node_gui "https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/gui/ScreenHandler.cpp"
click node_http_server "https://github.com/prusa3d/prusa-firmware-buddy/blob/master/lib/WUI/nhttp/server.cpp"
click node_cmsis_dsp "https://github.com/prusa3d/prusa-firmware-buddy/blob/master/lib/CMSIS-DSP/Include/dsp/controller_functions.h"
click node_storage_menu "https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/gui/screen/screen_menu_internal_storage.cpp"
click node_filesystem "https://github.com/prusa3d/prusa-firmware-buddy/blob/master/include/buddy/filesystem_littlefs_posix.hpp"
click node_storage_driver "https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/persistent_stores/storage_drivers/eeprom_storage.cpp"
click node_led_manager "https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/leds/led_manager.cpp"
click node_status_leds "https://github.com/prusa3d/prusa-firmware-buddy/blob/master/include/leds/status_leds_handler.hpp"
click node_side_leds "https://github.com/prusa3d/prusa-firmware-buddy/blob/master/include/leds/side_strip_handler.hpp"
click node_ac_leds "https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/leds/ac_controller_leds_handler.cpp"
click node_puppy_firmware "https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/puppy/modularbed/main.cpp"
click node_puppy_task "https://github.com/prusa3d/prusa-firmware-buddy/blob/master/include/puppies/puppy_task.hpp"
click node_puppy_modbus "https://github.com/prusa3d/prusa-firmware-buddy/blob/master/include/puppies/PuppyModbus.hpp"
click node_ac_controller "https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/puppies/ac_controller.cpp"

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_buddy_firmware,node_gui,node_http_server,node_cmsis_dsp,node_printer_user,node_browser toneBlue
class node_led_manager,node_status_leds,node_side_leds,node_ac_leds toneAmber
class node_storage_menu,node_filesystem,node_storage_driver toneMint
class node_puppy_firmware,node_puppy_task,node_puppy_modbus,node_ac_controller toneRose
class node_puppy_device toneIndigo
```

## Components

### Printer firmware

- [Buddy firmware](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/buddy/main.cpp): `src/buddy/main.cpp`
- [Printer GUI](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/gui/ScreenHandler.cpp): `src/gui/ScreenHandler.cpp`
- [HTTP server](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/lib/WUI/nhttp/server.cpp): `lib/WUI/nhttp/server.cpp`
- [DSP library](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/lib/CMSIS-DSP/Include/dsp/controller_functions.h): `lib/CMSIS-DSP/Include/dsp/controller_functions.h`

### Peripheral control

- [LED manager](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/leds/led_manager.cpp): `src/leds/led_manager.cpp`
- [Status LEDs](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/include/leds/status_leds_handler.hpp): `include/leds/status_leds_handler.hpp`
- [Side LEDs](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/include/leds/side_strip_handler.hpp): `include/leds/side_strip_handler.hpp`
- [AC LEDs](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/leds/ac_controller_leds_handler.cpp): `src/leds/ac_controller_leds_handler.cpp`

### Storage

- [Storage menu](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/gui/screen/screen_menu_internal_storage.cpp): `src/gui/screen/screen_menu_internal_storage.cpp`
- [Internal filesystem](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/include/buddy/filesystem_littlefs_posix.hpp): `include/buddy/filesystem_littlefs_posix.hpp`
- [EEPROM driver](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/persistent_stores/storage_drivers/eeprom_storage.cpp): `src/persistent_stores/storage_drivers/eeprom_storage.cpp`

### Puppy controllers

- [Puppy firmware](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/puppy/modularbed/main.cpp): `src/puppy/modularbed/main.cpp`
- [Puppy task](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/include/puppies/puppy_task.hpp): `include/puppies/puppy_task.hpp`
- [Puppy Modbus](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/include/puppies/PuppyModbus.hpp): `include/puppies/PuppyModbus.hpp`
- [AC controller](https://github.com/prusa3d/prusa-firmware-buddy/blob/master/src/puppies/ac_controller.cpp): `src/puppies/ac_controller.cpp`

### Other components

- **Printer user**
- **Puppy device**
- **HTTP client**

## Connections

- Printer user → Printer GUI: uses
- Storage menu → Internal filesystem: checks and formats (evidence: `src/gui/screen/screen_menu_internal_storage.cpp`)
- LED manager → Status LEDs: updates (evidence: `src/leds/led_manager.cpp`)
- LED manager → Side LEDs: updates (evidence: `src/leds/led_manager.cpp`)
- LED manager → AC LEDs: updates (evidence: `src/leds/led_manager.cpp`)
- Puppy task → Puppy Modbus: refreshes through
- AC controller → Puppy Modbus: refreshes through
- Puppy firmware → Puppy device: runs on
- Buddy firmware → Puppy device: may flash at startup
- HTTP client → HTTP server: requests
