# petteriaimonen/owon-xdm2041-info architecture

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

- Interactive diagram: https://gitdiagram.com/petteriaimonen/owon-xdm2041-info
- Repository: https://github.com/petteriaimonen/owon-xdm2041-info

## Overview

This is a hardware reverse-engineering repository for the Owon XDM2041, intended to gather evidence for future open-source firmware. The principal workflow is to interact with the meter over serial/SCPI, capture its behavior across measurement modes, and annotate protocol traffic; separate tools inspect firmware and calibration bootloader operations. Board schematics, MCU notes, original-firmware material, and boot-recovery notes provide complementary hardware evidence. The source excerpts establish the serial tools and capture annotators, while several broader research areas are represented by their documented directories; edges without direct evidence are omitted.

Main entry points: [`bootloader/xdm2041_bootloader.py`](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/bootloader/xdm2041_bootloader.py) (Firmware updater), [`bootloader/xdm2041_load_calibration.py`](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/bootloader/xdm2041_load_calibration.py) (Calibration loader), [`spi_captures/activate_modes.py`](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/spi_captures/activate_modes.py) (Mode activation), [`bootloader/backup_calibration.py`](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/bootloader/backup_calibration.py) (Calibration backup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_instrument["Instrument interface"]
  node_scpi["SCPI command findings<br/>[README.md]"]
  node_mode_driver["Mode activation<br/>[activate_modes.py]"]
end

subgraph group_firmware["Firmware and calibration"]
  node_bootloader["Firmware updater"]
  node_cal_backup["Calibration backup"]
  node_cal_loader["Calibration loader"]
  node_boot_assets["Bootloader assets"]
end

subgraph group_protocol["Protocol research"]
  node_spi_records["SPI capture records<br/>[all_modes.pvs]"]
  node_mode_notes["Measurement mode notes"]
  node_spi_annotator["SPI annotator<br/>[annotate.py]"]
  node_uart_annotator["UART annotator<br/>[annotate_uart.py]"]
  node_annotated_modes["Annotated mode log<br/>[all_modes.txt]"]
  node_annotated_uart["UART annotations"]
end

subgraph group_hardware["Hardware evidence"]
  node_adc_board["ADC board design<br/>[adc_board.sch]"]
  node_mcu_notes["MCU board notes<br/>[README.md]"]
  node_original_fw["Original firmware evidence"]
  node_boot_recovery["Boot recovery notes<br/>[README.md]"]
end

node_researcher(("Researcher"))
node_meter["XDM2041 meter"]

node_researcher -->|"runs modes"| node_mode_driver
node_mode_driver -->|"sends SCPI"| node_meter
node_researcher -->|"runs updater"| node_bootloader
node_bootloader -->|"programs firmware"| node_meter
node_bootloader -->|"uses firmware files"| node_boot_assets
node_researcher -->|"runs backup"| node_cal_backup
node_cal_backup -->|"queries calibration"| node_meter
node_researcher -->|"runs loader"| node_cal_loader
node_cal_loader -->|"writes calibration"| node_meter
node_cal_loader -->|"loads binary data"| node_boot_assets
node_researcher -->|"annotates traffic"| node_spi_annotator
node_spi_annotator -->|"produces annotations"| node_annotated_modes
node_researcher -->|"annotates traffic"| node_uart_annotator
node_uart_annotator -->|"prints annotations"| node_annotated_uart
node_researcher -->|"examines captures"| node_spi_records
node_researcher -->|"consults notes"| node_mode_notes
node_researcher -->|"consults commands"| node_scpi
node_meter -->|"supports commands"| node_scpi

click node_scpi "https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/README.md"
click node_mode_driver "https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/spi_captures/activate_modes.py"
click node_bootloader "https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/bootloader/xdm2041_bootloader.py"
click node_cal_backup "https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/bootloader/backup_calibration.py"
click node_cal_loader "https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/bootloader/xdm2041_load_calibration.py"
click node_boot_assets "https://github.com/petteriaimonen/owon-xdm2041-info/tree/main/bootloader"
click node_spi_records "https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/spi_captures/all_modes.pvs"
click node_mode_notes "https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/spi_captures/measurement_modes.md"
click node_spi_annotator "https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/spi_captures/annotate.py"
click node_uart_annotator "https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/spi_captures/annotate_uart.py"
click node_annotated_modes "https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/spi_captures/all_modes.txt"
click node_annotated_uart "https://github.com/petteriaimonen/owon-xdm2041-info/tree/main/spi_captures"
click node_adc_board "https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/adc_board/adc_board.sch"
click node_mcu_notes "https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/mcu_board/README.md"
click node_original_fw "https://github.com/petteriaimonen/owon-xdm2041-info/tree/main/orig_firmware"
click node_boot_recovery "https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/fix_boot_problems/README.md"

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_scpi,node_mode_driver toneBlue
class node_bootloader,node_cal_backup,node_cal_loader,node_boot_assets toneAmber
class node_spi_records,node_mode_notes,node_spi_annotator,node_uart_annotator,node_annotated_modes,node_annotated_uart toneMint
class node_adc_board,node_mcu_notes,node_original_fw,node_boot_recovery toneRose
class node_researcher,node_meter toneIndigo
```

## Components

### Instrument interface

- [SCPI command findings](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/README.md): `README.md`
- [Mode activation](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/spi_captures/activate_modes.py): `spi_captures/activate_modes.py`

### Firmware and calibration

- [Firmware updater](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/bootloader/xdm2041_bootloader.py): `bootloader/xdm2041_bootloader.py`
- [Calibration backup](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/bootloader/backup_calibration.py): `bootloader/backup_calibration.py`
- [Calibration loader](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/bootloader/xdm2041_load_calibration.py): `bootloader/xdm2041_load_calibration.py`
- [Bootloader assets](https://github.com/petteriaimonen/owon-xdm2041-info/tree/main/bootloader): `bootloader`

### Protocol research

- [SPI capture records](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/spi_captures/all_modes.pvs): `spi_captures/all_modes.pvs`
- [Measurement mode notes](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/spi_captures/measurement_modes.md): `spi_captures/measurement_modes.md`
- [SPI annotator](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/spi_captures/annotate.py): `spi_captures/annotate.py`
- [UART annotator](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/spi_captures/annotate_uart.py): `spi_captures/annotate_uart.py`
- [Annotated mode log](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/spi_captures/all_modes.txt): `spi_captures/all_modes.txt`
- [UART annotations](https://github.com/petteriaimonen/owon-xdm2041-info/tree/main/spi_captures): `spi_captures`

### Hardware evidence

- [ADC board design](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/adc_board/adc_board.sch): `adc_board/adc_board.sch`
- [MCU board notes](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/mcu_board/README.md): `mcu_board/README.md`
- [Original firmware evidence](https://github.com/petteriaimonen/owon-xdm2041-info/tree/main/orig_firmware): `orig_firmware`
- [Boot recovery notes](https://github.com/petteriaimonen/owon-xdm2041-info/blob/main/fix_boot_problems/README.md): `fix_boot_problems/README.md`

### Other components

- **Researcher**
- **XDM2041 meter**

## Connections

- Researcher → Mode activation: runs modes (evidence: `spi_captures/activate_modes.py`)
- Mode activation → XDM2041 meter: sends SCPI (evidence: `spi_captures/activate_modes.py`)
- Researcher → Firmware updater: runs updater (evidence: `bootloader/xdm2041_bootloader.py`)
- Firmware updater → XDM2041 meter: programs firmware (evidence: `bootloader/xdm2041_bootloader.py`)
- Firmware updater → Bootloader assets: uses firmware files (evidence: `bootloader/xdm2041_bootloader.py`)
- Researcher → Calibration backup: runs backup (evidence: `bootloader/backup_calibration.py`)
- Calibration backup → XDM2041 meter: queries calibration (evidence: `bootloader/backup_calibration.py`)
- Researcher → Calibration loader: runs loader (evidence: `bootloader/xdm2041_load_calibration.py`)
- Calibration loader → XDM2041 meter: writes calibration (evidence: `bootloader/xdm2041_load_calibration.py`)
- Calibration loader → Bootloader assets: loads binary data (evidence: `bootloader/xdm2041_load_calibration.py`)
- Researcher → SPI annotator: annotates traffic (evidence: `spi_captures/annotate.py`)
- SPI annotator → Annotated mode log: produces annotations (evidence: `spi_captures/annotate.py`)
- Researcher → UART annotator: annotates traffic (evidence: `spi_captures/annotate_uart.py`)
- UART annotator → UART annotations: prints annotations (evidence: `spi_captures/annotate_uart.py`)
- Researcher → SPI capture records: examines captures
- Researcher → Measurement mode notes: consults notes
- Researcher → SCPI command findings: consults commands (evidence: `README.md`)
- XDM2041 meter → SCPI command findings: supports commands (evidence: `README.md`)
