# stuehler-training/stm32_glitcher_pio architecture

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

- Interactive diagram: https://gitdiagram.com/stuehler-training/stm32_glitcher_pio
- Repository: https://github.com/stuehler-training/stm32_glitcher_pio

## Overview

This is a compact MicroPython PIO experiment for attempting an STM32F401 RDP1 power-glitch bypass. Its top-level delay/width sweep resets the target, sends UART traffic while coordinating a timed glitch, checks the UART response, and sends follow-up commands when it sees the expected acknowledgement. The single source file implements the whole runtime; the README documents the target and bypass goal, but does not describe additional subsystems.

Main entry points: [`glitch.py`](https://github.com/stuehler-training/stm32_glitcher_pio/blob/main/glitch.py) (Glitch sweep)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_operator(("Experiment runner"))
node_sweep["Glitch sweep<br/>[glitch.py]"]
node_reset["Target reset<br/>[glitch.py]"]
node_parity["Parity encoding<br/>[glitch.py]"]
node_uart_tx["PIO UART transmit<br/>[glitch.py]"]
node_glitch_sm["Timed glitch<br/>[glitch.py]"]
node_uart_rx["UART response read<br/>[glitch.py]"]
node_target["STM32F401 target"]

node_operator -->|"runs"| node_sweep
node_sweep -->|"resets target"| node_reset
node_sweep -->|"sets timing"| node_glitch_sm
node_sweep -->|"encodes bytes"| node_parity
node_sweep -->|"queues bytes"| node_uart_tx
node_sweep -->|"reads response"| node_uart_rx
node_reset -->|"pulses reset"| node_target
node_uart_tx -->|"sends UART"| node_target
node_glitch_sm -->|"pulses glitch"| node_target
node_target -->|"returns UART"| node_uart_rx

click node_sweep "https://github.com/stuehler-training/stm32_glitcher_pio/blob/main/glitch.py"
click node_reset "https://github.com/stuehler-training/stm32_glitcher_pio/blob/main/glitch.py"
click node_parity "https://github.com/stuehler-training/stm32_glitcher_pio/blob/main/glitch.py"
click node_uart_tx "https://github.com/stuehler-training/stm32_glitcher_pio/blob/main/glitch.py"
click node_glitch_sm "https://github.com/stuehler-training/stm32_glitcher_pio/blob/main/glitch.py"
click node_uart_rx "https://github.com/stuehler-training/stm32_glitcher_pio/blob/main/glitch.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_operator,node_target toneIndigo
class node_sweep,node_reset,node_parity,node_uart_tx,node_glitch_sm,node_uart_rx toneTeal
```

## Components

### Other components

- **Experiment runner**
- [Glitch sweep](https://github.com/stuehler-training/stm32_glitcher_pio/blob/main/glitch.py): `glitch.py`
- [Target reset](https://github.com/stuehler-training/stm32_glitcher_pio/blob/main/glitch.py): `glitch.py`
- [Parity encoding](https://github.com/stuehler-training/stm32_glitcher_pio/blob/main/glitch.py): `glitch.py`
- [PIO UART transmit](https://github.com/stuehler-training/stm32_glitcher_pio/blob/main/glitch.py): `glitch.py`
- [Timed glitch](https://github.com/stuehler-training/stm32_glitcher_pio/blob/main/glitch.py): `glitch.py`
- [UART response read](https://github.com/stuehler-training/stm32_glitcher_pio/blob/main/glitch.py): `glitch.py`
- **STM32F401 target**

## Connections

- Experiment runner → Glitch sweep: runs
- Glitch sweep → Target reset: resets target (evidence: `glitch.py`)
- Glitch sweep → Timed glitch: sets timing (evidence: `glitch.py`)
- Glitch sweep → Parity encoding: encodes bytes (evidence: `glitch.py`)
- Glitch sweep → PIO UART transmit: queues bytes (evidence: `glitch.py`)
- Glitch sweep → UART response read: reads response (evidence: `glitch.py`)
- Target reset → STM32F401 target: pulses reset (evidence: `glitch.py`)
- PIO UART transmit → STM32F401 target: sends UART (evidence: `glitch.py`)
- Timed glitch → STM32F401 target: pulses glitch (evidence: `glitch.py`)
- STM32F401 target → UART response read: returns UART (evidence: `glitch.py`)
