# oapraprara/ansa-flasher architecture

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

- Interactive diagram: https://gitdiagram.com/oapraprara/ansa-flasher
- Repository: https://github.com/oapraprara/ansa-flasher

## Overview

This is a desktop firmware-flashing application: users choose a board and firmware version, configure options, then download, verify, and flash firmware over DFU or ST-Link, with progress reported in the UI. The graph separates the React workflow, Tauri command/backend services, embedded ANSA firmware, and STM32/CMSIS platform layers. Source excerpts show key UI calls and backend command dispatch; several backend modules and firmware support files were not sampled, so their internal relationships are omitted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/App.tsx) (Workflow UI), [`src-tauri/src/main.rs`](https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/main.rs) (Command gateway), [`src-tauri/src/dfu_wrapper.rs`](https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/dfu_wrapper.rs) (DFU flashing), [`firmware/ANSA/Core/Src/main.c`](https://github.com/oapraprara/ansa-flasher/blob/master/firmware/ANSA/Core/Src/main.c) (ANSA target firmware)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_app["Workflow UI<br/>[App.tsx]"]
  node_board["Board picker<br/>[BoardPicker.tsx]"]
  node_version["Version picker<br/>[VersionPicker.tsx]"]
  node_custom["Customization form"]
  node_confirm["Flash confirmation"]
  node_progressui["Flash progress UI"]
  node_status["Device status"]
  node_success["Success screen<br/>[SuccessScreen.tsx]"]
end

subgraph group_backend["Tauri backend"]
  node_tauri["Command gateway<br/>[main.rs]"]
  node_download["Manifest and downloads<br/>[downloader.rs]"]
  node_verify["Signature verification<br/>[crypto.rs]"]
  node_dfu["DFU flashing<br/>[dfu_wrapper.rs]"]
  node_stlink["ST-Link flashing<br/>[stlink_wrapper.rs]"]
  node_parser["Progress parser<br/>[progress_parser.rs]"]
  node_bridge["Progress bridge<br/>[progress_bridge.rs]"]
  node_usb["USB monitor<br/>[usb_monitor.rs]"]
  node_uart["UART boot check<br/>[uart_listener.rs]"]
end

subgraph group_firmware["ANSA firmware"]
  node_ansa["ANSA target firmware<br/>[main.c]"]
  node_bsp["Board support drivers"]
end

subgraph group_platform["MCU platform"]
  node_hal["STM32 HAL"]
  node_cmsis["CMSIS device and core"]
end

node_user(("User"))
node_remote["Firmware host"]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_board
node_app -->|"renders"| node_version
node_app -->|"renders"| node_custom
node_app -->|"renders"| node_confirm
node_app -->|"renders"| node_progressui
node_app -->|"renders"| node_status
node_app -->|"renders"| node_success
node_app -->|"invokes commands"| node_tauri
node_tauri -->|"dispatches downloads"| node_download
node_tauri -->|"dispatches verification"| node_verify
node_tauri -->|"dispatches flashing"| node_dfu
node_tauri -->|"dispatches flashing"| node_stlink
node_tauri -->|"starts monitor"| node_usb
node_tauri -->|"dispatches boot check"| node_uart
node_download -->|"fetches firmware"| node_remote
node_dfu -->|"uses parser"| node_parser
node_dfu -->|"uses bridge"| node_bridge
node_stlink -->|"uses bridge"| node_bridge
node_ansa -->|"initializes peripherals"| node_hal
node_hal -->|"uses device definitions"| node_cmsis
node_ansa -.->|"uses board drivers"| node_bsp

click node_app "https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/App.tsx"
click node_board "https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/components/BoardPicker.tsx"
click node_version "https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/components/VersionPicker.tsx"
click node_custom "https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/components/CustomizationForm.tsx"
click node_confirm "https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/components/ConfirmationModal.tsx"
click node_progressui "https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/components/FlashingProgress.tsx"
click node_status "https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/components/DeviceStatusBar.tsx"
click node_success "https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/components/SuccessScreen.tsx"
click node_tauri "https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/main.rs"
click node_download "https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/downloader.rs"
click node_verify "https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/crypto.rs"
click node_dfu "https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/dfu_wrapper.rs"
click node_stlink "https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/stlink_wrapper.rs"
click node_parser "https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/progress_parser.rs"
click node_bridge "https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/progress_bridge.rs"
click node_usb "https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/usb_monitor.rs"
click node_uart "https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/uart_listener.rs"
click node_ansa "https://github.com/oapraprara/ansa-flasher/blob/master/firmware/ANSA/Core/Src/main.c"
click node_bsp "https://github.com/oapraprara/ansa-flasher/tree/master/firmware/ANSA/Drivers/ANSA_BSP/Src"
click node_hal "https://github.com/oapraprara/ansa-flasher/tree/master/firmware/ANSA/Drivers/STM32F4xx_HAL_Driver/Inc"
click node_cmsis "https://github.com/oapraprara/ansa-flasher/tree/master/firmware/ANSA/Drivers/CMSIS"

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_app,node_board,node_version,node_custom,node_confirm,node_progressui,node_status,node_success,node_user toneBlue
class node_tauri,node_download,node_verify,node_dfu,node_stlink,node_parser,node_bridge,node_usb,node_uart toneAmber
class node_ansa,node_bsp toneMint
class node_hal,node_cmsis toneRose
class node_remote toneIndigo
```

## Components

### Desktop interface

- [Workflow UI](https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Board picker](https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/components/BoardPicker.tsx): `frontend/src/components/BoardPicker.tsx`
- [Version picker](https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/components/VersionPicker.tsx): `frontend/src/components/VersionPicker.tsx`
- [Customization form](https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/components/CustomizationForm.tsx): `frontend/src/components/CustomizationForm.tsx`
- [Flash confirmation](https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/components/ConfirmationModal.tsx): `frontend/src/components/ConfirmationModal.tsx`
- [Flash progress UI](https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/components/FlashingProgress.tsx): `frontend/src/components/FlashingProgress.tsx`
- [Device status](https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/components/DeviceStatusBar.tsx): `frontend/src/components/DeviceStatusBar.tsx`
- [Success screen](https://github.com/oapraprara/ansa-flasher/blob/master/frontend/src/components/SuccessScreen.tsx): `frontend/src/components/SuccessScreen.tsx`

### Tauri backend

- [Command gateway](https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/main.rs): `src-tauri/src/main.rs`
- [Manifest and downloads](https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/downloader.rs): `src-tauri/src/downloader.rs`
- [Signature verification](https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/crypto.rs): `src-tauri/src/crypto.rs`
- [DFU flashing](https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/dfu_wrapper.rs): `src-tauri/src/dfu_wrapper.rs`
- [ST-Link flashing](https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/stlink_wrapper.rs): `src-tauri/src/stlink_wrapper.rs`
- [Progress parser](https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/progress_parser.rs): `src-tauri/src/progress_parser.rs`
- [Progress bridge](https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/progress_bridge.rs): `src-tauri/src/progress_bridge.rs`
- [USB monitor](https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/usb_monitor.rs): `src-tauri/src/usb_monitor.rs`
- [UART boot check](https://github.com/oapraprara/ansa-flasher/blob/master/src-tauri/src/uart_listener.rs): `src-tauri/src/uart_listener.rs`

### ANSA firmware

- [ANSA target firmware](https://github.com/oapraprara/ansa-flasher/blob/master/firmware/ANSA/Core/Src/main.c): `firmware/ANSA/Core/Src/main.c`
- [Board support drivers](https://github.com/oapraprara/ansa-flasher/tree/master/firmware/ANSA/Drivers/ANSA_BSP/Src): `firmware/ANSA/Drivers/ANSA_BSP/Src`

### MCU platform

- [STM32 HAL](https://github.com/oapraprara/ansa-flasher/tree/master/firmware/ANSA/Drivers/STM32F4xx_HAL_Driver/Inc): `firmware/ANSA/Drivers/STM32F4xx_HAL_Driver/Inc`
- [CMSIS device and core](https://github.com/oapraprara/ansa-flasher/tree/master/firmware/ANSA/Drivers/CMSIS): `firmware/ANSA/Drivers/CMSIS`

### Other components

- **User**
- **Firmware host**

## Connections

- User → Workflow UI: uses
- Workflow UI → Board picker: renders (evidence: `frontend/src/App.tsx`)
- Workflow UI → Version picker: renders (evidence: `frontend/src/App.tsx`)
- Workflow UI → Customization form: renders (evidence: `frontend/src/App.tsx`)
- Workflow UI → Flash confirmation: renders (evidence: `frontend/src/App.tsx`)
- Workflow UI → Flash progress UI: renders (evidence: `frontend/src/App.tsx`)
- Workflow UI → Device status: renders (evidence: `frontend/src/App.tsx`)
- Workflow UI → Success screen: renders (evidence: `frontend/src/App.tsx`)
- Workflow UI → Command gateway: invokes commands (evidence: `frontend/src/App.tsx`)
- Command gateway → Manifest and downloads: dispatches downloads (evidence: `src-tauri/src/main.rs`)
- Command gateway → Signature verification: dispatches verification (evidence: `src-tauri/src/main.rs`)
- Command gateway → DFU flashing: dispatches flashing (evidence: `src-tauri/src/main.rs`)
- Command gateway → ST-Link flashing: dispatches flashing (evidence: `src-tauri/src/main.rs`)
- Command gateway → USB monitor: starts monitor (evidence: `src-tauri/src/main.rs`)
- Command gateway → UART boot check: dispatches boot check (evidence: `src-tauri/src/main.rs`)
- Manifest and downloads → Firmware host: fetches firmware (evidence: `src-tauri/src/downloader.rs`)
- DFU flashing → Progress parser: uses parser (evidence: `src-tauri/src/dfu_wrapper.rs`)
- DFU flashing → Progress bridge: uses bridge (evidence: `src-tauri/src/dfu_wrapper.rs`)
- ST-Link flashing → Progress bridge: uses bridge (evidence: `src-tauri/src/stlink_wrapper.rs`)
- ANSA target firmware → STM32 HAL: initializes peripherals (evidence: `firmware/ANSA/Core/Src/main.c`)
- STM32 HAL → CMSIS device and core: uses device definitions (evidence: `firmware/ANSA/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h`)
- ANSA target firmware → Board support drivers: uses board drivers
