Skip to content

crinq/pinout_tool

Repository files navigation

STM32 Pinout Tool

A browser-based tool for automatic STM32 pin assignment using constraint-based solving. Define your peripheral requirements in a simple constraint language, and the solver finds optimal pin assignments across multiple MCU variants.

Features

  • 14 solver algorithms -- backtracking, two-phase, cost-guided, AC-3, dynamic MRV, randomized restarts, diverse instances, priority backtracking, priority two-phase, priority diverse, priority group, MRV group, ratio MRV group, and hybrid
  • Parallel multi-solver -- run multiple solvers simultaneously and merge results
  • Visual package viewer -- interactive canvas with zoom, rotation, pin assignment popup, and signal search
  • Multiple package types -- LQFP, BGA, and WLCSP support with correct ball/pin rendering
  • Cost-optimized solutions -- ranked by pin count, port spread, clustering, proximity, and more
  • Multi-MCU search -- solve across multiple MCU variants with mcu:, package:, ram:, rom: filters
  • Grouped solution browser -- solutions grouped by peripheral assignment, keyboard-navigable
  • Pin group highlighting -- hover/click port names or peripheral instances to highlight pins on the viewer
  • Project management -- save/load projects, store MCU data in browser localStorage
  • DMA stream assignment -- dma() constraints with automatic stream exclusivity checking (STM32F4 fixed mapping + STM32H7 DMAMUX)
  • CubeMX .ioc import -- import pin assignments from STM32CubeMX project files
  • Editable macro library -- customize and extend the standard library macros via Data Manager
  • Custom export functions -- user-defined JavaScript export functions for any output format
  • Interactive tutorial -- guided tour for first-time users
  • Dark mode -- full light/dark theme support

Getting Started

npm install
npm run dev

Open http://localhost:5173 in your browser.

Loading MCU Data

  1. Download MCU XML files from STM32CubeMX (found in the db/mcu/ folder of the CubeMX installation)
  2. Drag and drop the .xml or .ioc file onto the app, or click Import

Writing Constraints

Enter constraints in the editor panel. A minimal example:

port CMD:
  channel TX
  channel RX

  config "UART":
    TX = USART*_TX
    RX = USART*_RX
    require same_instance(TX, RX)

Press Ctrl+Enter or click Solve to find pin assignments.

Signal Search

Use the search field in the package viewer toolbar to find pins by signal pattern:

  • TIM*_CH1 -- all timer channel 1 pins
  • ADC*_IN[1-4] -- ADC inputs 1-4
  • PA0 -- specific pin
  • SPI -- substring match on any SPI signal

Exporting

Click Export in the viewer toolbar to choose a format:

  • PNG -- raster image of the current canvas view
  • SVG -- vector graphic, ideal for documentation and scaling
  • Text -- copy pin assignment table to clipboard
  • JSON -- structured pin assignment data
  • Custom -- user-defined JavaScript export functions (manage via Data Manager)

Documentation

See doc.md for the full constraint language reference, practical examples, and detailed feature documentation.

Tech Stack

  • TypeScript, Vite
  • Canvas 2D rendering
  • Web Workers for parallel solver execution
  • Zero runtime dependencies

Build

npm run build    # production build to dist/
npm run dev      # development server with HMR

About

STM32 pinout tool build with Claude, very alpha

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors