Skip to the content
2 layers69 × 99.1 mmSmuk, the printed circuit board in 3D

An SMU by kapuki

Size
69 × 99.1 mm
Copper layers
2
Thickness
1.67 mm
Parts
63
Nets
41
Pads
185
Tracks, vias
0, 0
Pours
1
Routed
Not yet
KiCad
KiCad 10.0 (file 20260206)
Created
30 Sep 2026
Updated
22 Oct 2026

Overview

Smuk is an open-source printed circuit board by bodri, from the bodri/smuk repository on GitHub. It is a 2-layer board of 69 × 99.1 mm with 63 parts on 41 nets.

It is built around the OPA2192ID, CD4053BE and MMBT3904, with the IRF3205 and IRF5305PBF among its other parts. Its parts include 24 resistors, 21 capacitors, 4 ICs, 4 transistors and 4 connectors.

Main components

5

README

README.md

🚀 smuk

An SMU by kapuki

This repository is structured as a unified monorepo containing both the physical hardware designs (schematics, PCB, enclosures) and the bare-metal C firmware.


📂 Project Architecture

The workspace is split into isolated modules to decouple hardware revisions from compilation build systems:

text
smuk/
├── firmware/       # Core firmware application, drivers, and build targets
├── hardware/       # Electrical schematics, PCB layout, and production packages
├── AGENTS.md       # Target rules and context for AI assistants (Claude, Codex)
└── README.md       # This file

📐 1. Hardware Module (/hardware)

The electronics are designed using KiCad 10.0 (or your preferred EDA tool), leveraging the high-performance capabilities of the STM32H5 series (Cortex-M33 with TrustZone support).

Key Subdirectories

  • /pcb: Contains the source .kicad_pro, .kicad_sch, and .kicad_pcb files.
  • /mechanical: STEP files for the enclosure, 3D component models, and mounting layouts.
  • /production: Production-ready files. Check this folder if you need to quickly inspect the schematics without installing the full EDA design suite.

Quick Hardware Access


💻 2. Firmware Module (/firmware)

The software environment is built on top of the STM32 Cube Hardware Abstraction Layer (HAL) and configured for cross-compilation using the GNU ARM Embedded Toolchain.

Current Firmware Status

Firmware targets the STM32H503RB. ADS131M03 SPI/DMA acquisition, physical measurement conversion, CALBUS and voltage calibration, and persistent Flash calibration storage are working.

Range control, PA safety, watchdog, and parts of the platform interface still contain placeholders awaiting hardware integration. The App directory is unfinished and is excluded from the firmware source list.

Core Architecture

text
firmware/
├── Core/                 # CubeMX initialization, callbacks, integration loop
├── Drivers/SMU/          # ADC, measurement, calibration and hardware interfaces
├── Platform/STM32H503/   # Board-specific HAL implementations
├── Storage/             # Persistent calibration records and Flash storage
├── App/                 # Unfinished instrument/control implementation
├── tests/               # Host regression tests
└── smuk.ioc              # STM32CubeMX configuration

Drivers also contains the vendor CMSIS, STM32H5 HAL, and board support libraries. Drivers/SMU/ads131m03.h/.c contains both blocking device bring-up and DMA acquisition. Its HAL operations are provided through ads131m03_port.h, implemented in Platform/STM32H503/ads131m03_port_hal.c.

smu_measurement converts raw ADC samples into physical measurements and applies calibration and filtering. smu_calibration manages active coefficients, smu_cal_seq sequences calibration acquisition, and Storage/calibration_store persists calibration records.

⚠️ Crucial Development Rule: In CubeMX-generated files, write custom C code only inside the explicit /* USER CODE BEGIN ... */ and /* USER CODE END ... */ sections. Changes outside these sections may be lost when smuk.ioc is regenerated. This restriction does not apply to handwritten drivers and modules.

Calibration Behavior

Calibration discard and acquisition phases each have a configurable timeout, defaulting to 1,000 ms per phase. The sequencer accounts for elapsed scheduler time, including delayed ticks. On timeout, it opens calibration relays, selects zero CALBUS, requests PA disable and ranges off through the existing hardware interfaces, and latches a fault until sequencer reinitialization. PA and range actions still depend on the placeholder implementations described above.

Applying calibration coefficients preserves measurement ranges, validity/compliance/transition flags, sample count, and filter configuration. Filter history resets to avoid blending values from different calibrations, and cached outputs remain invalid until another frame is processed. Startup still performs full measurement initialization.

Calibration Flash Reservation

Application Flash is limited to 112 KiB, enforced by check_limits.py during the build. Two 8 KiB calibration slots occupy the remaining 16 KiB:

RegionAddress range
Application0x08000000–0x0801BFFF
Calibration A0x0801C000–0x0801DFFF
Calibration B0x0801E000–0x0801FFFF

Saves replace the older or invalid slot and verify the replacement by record validation and byte-for-byte readback. The newest valid calibration is preserved while the replacement is written. Storage initialization does not erase calibration; loading falls back to default coefficients if neither slot is valid.


🛠️ Getting Started (Compilation & Flashing)

For project guidance, see AGENTS.md and the firmware-specific firmware/AGENTS.md.

Prerequisites

Install these dependencies and make them available on PATH:

  1. ARM GCC toolchain and binutils (arm-none-eabi-gcc, arm-none-eabi-size, arm-none-eabi-objcopy)
  2. CMake 3.22+ and Ninja
  3. Python 3 for the Flash footprint check
  4. A host C compiler (cc, or set CC) for host regression tests

clang-format and cppcheck are optional. When installed, the build script automatically formats C source and header files under Core/Src, Core/Inc, Platform, Drivers/SMU, and Storage, and runs static analysis on Core, Platform, Drivers/SMU, and Storage. These steps are skipped with a warning if the tools are unavailable.

The supplied flashing and debugging helpers currently require STM32CubeIDE installed under /Applications on macOS, including its STM32CubeProgrammer and ST-LINK GDB server bundles.

Build and Test

From the repository root:

bash
cd firmware
./build.sh
sh tests/run_calibration_state.sh

The build uses the ARM toolchain through CMake and Ninja, generates build/smuk.elf, build/smuk.hex, and build/smuk.bin, and checks the 112 KiB application Flash limit.

The host regression tests cover calibration timeouts and cleanup, successful acquisition, zero-CALBUS offset capture, and measurement state preservation when applying coefficients. They run without a connected board and do not replace hardware verification.

In Zed, use STM32H5: Build Firmware or the configured build shortcut (cmd-b / ctrl-b). The STM32H5: Clean & Rebuild Firmware task currently passes --clean, but build.sh does not implement special handling for that argument. Each normal build clears the CMake cache and configuration directory; for a complete clean build, remove firmware/build before running the script.

Hardware Flashing

Connect the board through an ST-LINK debugger, build the firmware, then run from firmware:

bash
./flash.sh

The helper programs build/smuk.elf using STM32CubeProgrammer over SWD in under-reset mode, verifies the image, and resets the target. The equivalent Zed task is STM32H5: Flash Firmware.

Serial Communication and Manual Calibration

The ST-LINK USB connection provides a USART3 Virtual COM Port at 115200 baud, 8N1, no flow control. The firmware console supports measurement/raw queries, range selection, and manual calibration from externally applied references. Start with HELP or PING. Select precision windows with INTEGRATION 1MS|8MS|20MS|50MS|100MS; precision readings become valid after the window fills. CAL:SHOW? reports calibration provenance, and captures report noise/drift. ACQ? reports acquisition health; measurement queries report freshness, settling, precision readiness, and channel clipping. Stale acquisition invalidates readings, and persistent failures latch an ADC fault. Current and voltage autorange are controlled independently with AUTORANGE:I and AUTORANGE:V; current autorange defaults ON and voltage autorange defaults OFF. Input loading defaults to HIGHZ, keeping MV_ON LOW; use IMPEDANCE 10M to connect the 10 MΩ resistor. Voltage starts fixed at 15 V, keeping VRANGE LOW. When explicitly enabled, voltage autorange switches up at 6.2 V magnitude and down at 5.0 V after 100 ms. Disable both autoranges during manual calibration.

See Serial console and manual calibration for the command list, terminal setup, calibration capture/fit/save workflow, and host tests.

Debug Server

From firmware, run:

bash
./debug_server.sh

This starts the ST-LINK GDB server on port 61234. Connect a GDB client configured for the ARM target and build/smuk.elf. The equivalent Zed task is STM32H5: Start GDB Debug Server.


🏷️ Versioning Strategy

This project adheres to Semantic Versioning (v2.0.0). Due to the monorepo nature, git tags tie firmware releases directly to specific physical board iterations:

  • v1.0.0-HW1: Initial hardware board spin layout.
  • v1.0.1-FW: Firmware patch fixing a register timing error specifically for the HW1 board revision.

The measurement firmware now uses a nominal 2-second independent watchdog. Foreground processing owns refresh; handled faults stay latched for diagnosis. See the watchdog and CubeMX setup instructions for regeneration settings, reset reporting, and bench checks.

Desktop measurement console

The desktop application provides live measurements, observed statistics, range/autorange controls, integration and impedance selection, and serial diagnostics on macOS. It uses the existing console protocol; firmware and hardware remain separate projects.

Parts

63
QtyValueFootprintReferences
810KResistor_SMD:R_0603_1608MetricR2, R5, R9, R12, R16, R19, R20, R21
6100nFCapacitor_SMD:C_0603_1608MetricC4, C5, C6, C7, C18, C21
31K5Resistor_SMD:R_0603_1608MetricR22, R23, R24
3Conn_01x03Connector_Molex:Molex_KK-396_A-41791-0003_1x03_P3.96mm_VerticalJ1, J2, J4
3LEDLED_SMD:LED_0603_1608MetricD1, D2, D3
2100Resistor_SMD:R_0603_1608MetricR15, R18
2100nCapacitor_SMD:C_0603_1608MetricC13, C14
2100uCapacitor_SMD:C_Elec_10x10.2C15, C16
210uCapacitor_Tantalum_SMD:CP_EIA-6032-28_Kemet-CC2, C3
210uCapacitor_SMD:C_0603_1608MetricC17, C20
2150Resistor_SMD:R_0603_1608MetricR13, R14
21nFCapacitor_SMD:C_0603_1608MetricC11, C12
22KResistor_SMD:R_0603_1608MetricR10, R11
2MMBT3904Package_TO_SOT_SMD:SOT-323_SC-70Q3, Q4
1100KResistor_SMD:R_0603_1608MetricR7
110nFCapacitor_SMD:C_0603_1608MetricC19
1150pCapacitor_SMD:C_0603_1608MetricC1
115KResistor_SMD:R_0603_1608MetricR3
1220pCapacitor_SMD:C_0603_1608MetricC9
122K1Resistor_SMD:R_0603_1608MetricR6
124K9Resistor_SMD:R_0603_1608MetricR4
1274Resistor_SMD:R_0603_1608MetricR17
12K74Resistor_SMD:R_0603_1608MetricR1
1330pCapacitor_SMD:C_0603_1608MetricC10
147pCapacitor_SMD:C_0603_1608MetricC8
150KResistor_SMD:R_0603_1608MetricR8
1CD4053BPackage_SO:TSSOP-16_4.4x5mm_P0.65mmU3
1Conn_01x09_PinConnector_PinHeader_2.54mm:PinHeader_1x09_P2.54mm_HorizontalJ3
1FORCETestPoint:TestPoint_Loop_D1.80mm_Drill1.0mm_BeadedTP1
1GNDTestPoint:TestPoint_Loop_D1.80mm_Drill1.0mm_BeadedTP2
1Heatsink_Padmiscellaneous:Heatsink_Fischer_SK96-84SA_2FixationsHS1
1IRF3205Package_TO_SOT_THT:TO-220-3_VerticalQ2
1IRF5305Package_TO_SOT_THT:TO-220-3_VerticalQ1
1LT1970miscellaneous:LT1970U4
1OPA2192Package_SO:VSSOP-8_3x3mm_P0.65mmU2
1TL431DBZPackage_TO_SOT_SMD:SOT-23U1

More from bodri/smuk

2
  • 4 layers70 × 53 mmSense, the printed circuit board in 3D

    Sense

    bodri/smuk

    An SMU by kapuki

    87 parts
  • 2 layers69 × 99.1 mmSmuk, the printed circuit board in 3D

    Smuk

    bodri/smuk

    An SMU by kapuki

    62 parts

Similar boards

  • 4 layers111 × 110 mmComplex vco ranged, the printed circuit board in 3D

    Complex vco ranged

    lennartquerter/euro-rack-synth

    Lenimal Github for DIY for a Eurorack Synth

    234 parts13
  • 4 layers48.5 × 56 mmDigirig icom, the printed circuit board in 3D

    Digirig icom

    1vers1on/digirig_icom

    A custom hardware controller for the ICOM IC-2730 radio, featuring digital audio processing and USB connectivity.

    70 parts1
  • 2 layers65 × 45 mmInput, the printed circuit board in 3D

    Input

    phooky/Flat-SIP

    An attempt to make a flat, relatively low-cost recreation of the Sandin Image Processor.

    48 parts
  • 2 layers80 × 130 mmProyectoFinalCarrito2, the printed circuit board in 3D

    ProyectoFinalCarrito2

    Carlos-Santos-prog/rc-car-esp32

    Vehículo RC de combate con seguidor de línea basado en ESP32. Diseño electrónico completo en KiCad 10.

    93 partsMIT
  • 2 layers50 × 50 mmTdstatv3, the printed circuit board in 3D

    Tdstatv3

    thomasdob/tdstatv3

    A USB-controlled potentiostat/galvanostat for thin-film battery characterization

    71 parts23GPL-3.0
  • 2 layers37.5 × 24 mmVectorScopeMusicAddon, the printed circuit board in 3D

    VectorScopeMusicAddon

    davedarko/VectorScopeMusicAddon

    A small add-on for the Hackaday Supercon 2023 / Europe 2024 event badge that allows displaying oscilloscope music

    16 parts2CC0-1.0
  • 4 layers138.4 × 138.3 mmGRBL board, the printed circuit board in 3D

    GRBL board

    ephemeridis/GRBL_board

    This is a PCB designed to run GRBL, an open source CNC control software that is designed and optimised for Arduino.

    287 parts2GPL-3.0
  • 4 layers43.2 × 36.8 mmPi pico dds, the printed circuit board in 3D

    Pi pico dds

    gabeak2/RP2040_PIO_DAC

    RP2040 PCB with a 12-bit R-2R DAC

    77 parts2

Questions

How big is the Smuk PCB?

It measures 69 × 99.1 mm and has 2 copper layers, 1.67 mm thick.

What parts does the Smuk use?

63 parts, built around the OPA2192ID, CD4053BE, MMBT3904 and IRF3205. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Smuk KiCad files?

From the bodri/smuk repository on GitHub, at the commit this page was made from: the board is hardware/lt1970a/smuk.kicad_pcb and its schematic hardware/lt1970a/amplifier.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Smuk design in my own project?

Its repository states no licence, so its author keeps all rights: ask bodri before reusing the design.