Detailed CLI usage, ULP workflow, and integration patterns.
python -m tools.pinmapgen.cli \
--csv hardware/exports/sample_netlist.csv \
--mcu rp2040 \
--mcu-ref U1 \
--out-root .python -m tools.pinmapgen.cli [OPTIONS]
Required:
--sch PATH | --csv PATH Input schematic or CSV file
--mcu NAME MCU profile (13 built-in — use --list-mcus)
--mcu-ref TEXT Reference designator (e.g., U1)
Optional:
--out-root PATH Output directory (default: current dir)
--mermaid Also generate Mermaid diagram
--verbose, -v Print normalization summary
--strict Exit non-zero on validation errors or
dropped pins (recommended for CI)
--profile-dir PATH Additional directory with custom TOML profiles
--reproducible Fixed timestamps for reproducible builds# RP2040
python -m tools.pinmapgen.cli --csv hardware/exports/sample_netlist.csv --mcu rp2040 --mcu-ref U1 --out-root . --mermaid -v
# STM32G0
python -m tools.pinmapgen.cli --csv hardware/exports/stm32g0_netlist.csv --mcu stm32g0 --mcu-ref U1 --out-root .
# ESP32
python -m tools.pinmapgen.cli --csv hardware/exports/esp32_netlist.csv --mcu esp32 --mcu-ref U1 --out-root . --mermaidpython -m tools.pinmapgen.cli --sch hardware/exports/sample_schematic.sch --mcu rp2040 --mcu-ref U1 --out-root .The watcher polls a directory for CSV changes and regenerates outputs automatically.
python -m tools.pinmapgen.watch hardware/exports/ --interval 1.0 --mermaidThe watcher accepts the same --mcu names as the CLI (all 13 built-in
profiles) plus --profile-dir for custom TOML profiles. A single watcher
run uses one MCU profile for every file it watches — if a directory mixes
netlists for different MCUs, point the watcher at a single file instead:
python -m tools.pinmapgen.watch hardware/exports/sample_netlist.csv --mcu rp2040Useful during active schematic iteration or in classroom labs where students save CSV files to a shared folder.
Copy PinmapGen.ulp to Fusion's ULP directory:
Copy-Item fusion_addin/PinmapGen.ulp "$env:APPDATA\Autodesk\Autodesk Fusion 360\API\ULPs\"- Open your schematic in the Electronics workspace.
- Automation → Run ULP → PinmapGen.
- Set project name, MCU type, MCU reference, and output directory.
- Click Generate Pinmaps.
The ULP reads the schematic object model directly — no manual CSV export is needed. It writes a temporary CSV, invokes the CLI, and opens the output folder.
Click Preview before generating to see a summary of detected components, nets, and which files will be created.
The ULP remembers your last-used MCU type, output directory, and format selections between runs.
See ULP_GUIDE.md for screenshots and troubleshooting.
Three tasks are configured in .vscode/tasks.json:
| Task | What it does |
|---|---|
| Generate Pinmap | Runs CLI on hardware/exports/sample_netlist.csv with RP2040 |
| Watch Pinmap | Starts the file watcher on hardware/exports/ |
| Test PinmapGen CLI | Runs --help to verify the CLI is available |
Launch via Ctrl+Shift+P → Tasks: Run Task.
- Designer exports or generates pinmaps (ULP or CLI).
- Package
pinmaps/andfirmware/into the repo or a ZIP. - Include any validation warnings from the CLI output.
- Firmware engineer imports the generated constants into their project.
Maintain one CSV per board variant and generate into separate output directories:
python -m tools.pinmapgen.cli --csv boards/rev_a/netlist.csv --mcu rp2040 --mcu-ref U1 --out-root build/rev_a
python -m tools.pinmapgen.cli --csv boards/rev_b/netlist.csv --mcu rp2040 --mcu-ref U1 --out-root build/rev_bFirmware can use #ifdef or build-system variables to select the right header.
Hardware reviewer:
- Semantic net names used (not bare
GP0,GPIO1) - Differential pairs correctly wired
- Power/ground nets excluded from GPIO
- Pin capabilities match signal requirements
Firmware reviewer:
- Generated constants compile without errors
- Pin changes don't break existing drivers
- Tested on hardware
- Prepare template CSVs for each exercise.
- Start the watcher in a terminal so students get instant feedback.
- Provide printed excerpts from
firmware/docs/PINOUT.mdfor wiring checks.
- Semantic naming (descriptive vs generic)
- Pin capability matching (ADC for sensors, PWM for LEDs)
- Proper differential pair usage
- Documentation completeness
name: Validate Pinmaps
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: pip install -e .
- run: python -m tools.pinmapgen.cli --csv hardware/exports/sample_netlist.csv --mcu rp2040 --mcu-ref U1 --out-root .
- run: git diff --exit-code pinmaps/ firmware/bash .githooks/install-hooks.sh # Linux/macOS
pwsh -File .githooks/install-hooks.ps1 # WindowsThe hook regenerates pinmaps when files in hardware/exports/ change and
stages the updated outputs automatically.
Add the generated Arduino header to your include path:
[env:rp2040]
platform = raspberrypi
board = pico
framework = arduino
build_flags = -I firmware/includeThen #include "pinmap_arduino.h" in your source files.
- Use descriptive names:
TEMP_SENSOR,I2C0_SDA,LED_STATUS - Avoid autogenerated labels:
N$1,NetR1_1 - Keep bus members consistent:
UART0_TX/UART0_RX
- Standardize across your team (always
U1for the main MCU, for example). - Update the schematic if Fusion defaults to
IC1orU?.
project/
├── hardware/exports/netlist.csv
├── firmware/
│ ├── include/pinmap_arduino.h
│ ├── micropython/pinmap_micropython.py
│ └── docs/
│ ├── PINOUT.md
│ └── pinout.mmd
└── pinmaps/pinmap.json
Commit generated files if your team expects firmware developers to track diffs. Use separate output folders per board revision when managing variants.