How therijalsam/stm32u585-spi-benchmark works
This is an embedded Rust benchmark for comparing blocking SPI writes with asynchronous DMA writes on STM32U585. Its principal workflow configures the SPI clock, measures payload transfers across sizes and methods, compares throughput and detects crossover points, while a background task exposes DMA concurrency. The capture utility runs the benchmark and turns its RTT output into CSV, tables, and graphs. The benchmark implementation itself was not excerpted, so links from it to timing primitives are omitted rather than inferred.
Main entry points: main.rs Benchmark runtime · capture_csv.py Output capture · spi.rs SPI transfer adapter · benchmark.rs Benchmark engine
Components 16
Embedded runtime
- Benchmark runtime
src/main.rs - Concurrency worker
src/main.rs
Benchmark measurement
- Benchmark engine
src/benchmark.rs - Method comparison
src/main.rs - Crossover analysis
src/main.rs - DWT cycle counter
src/cycle_counter.rs - Elapsed-time timer
src/timer.rs
SPI hardware
- Transfer interfaces
src/transfer.rs - SPI transfer adapter
src/spi.rs - STM32 SPI1
Result capture
- Output capture
tools/capture_csv.py - Benchmark CSV
results/benchmark.csv - Summary table
results/benchmark_table.txt - Performance graphs
results/graphs - RTT log output
Other components
- Benchmark operator
Connections 15
- Benchmark operator → Output capture: runs capture
tools/capture_csv.py - Output capture → Benchmark runtime: runs benchmark
tools/capture_csv.py - Benchmark runtime → DWT cycle counter: initializes counter
src/main.rs - Benchmark runtime → SPI transfer adapter: configures clock
src/main.rs - Benchmark runtime → Concurrency worker: spawns task
src/main.rs - Benchmark runtime → Benchmark engine: runs measurements
src/main.rs - Benchmark runtime → Method comparison: compares methods
src/main.rs - Benchmark runtime → Crossover analysis: analyzes crossover
src/main.rs - SPI transfer adapter → Transfer interfaces: implements
src/spi.rs - SPI transfer adapter → STM32 SPI1: transfers via
src/spi.rs - Benchmark runtime → RTT log output: logs results
src/main.rs - Output capture → RTT log output: parses output
tools/capture_csv.py - Output capture → Benchmark CSV: writes rows
tools/capture_csv.py - Output capture → Summary table: writes summary
tools/capture_csv.py - Output capture → Performance graphs: generates graphs
tools/capture_csv.py