From 6bc456a36af70eb7d7e0bca68953dbe8d12bea21 Mon Sep 17 00:00:00 2001 From: Jessica Janiuk Date: Mon, 9 Nov 2026 20:16:38 -0800 Subject: [PATCH] Update Stackup to 0.3.0 and exclude hand parts from BOM and placement Stackup 0.3.0 exports `hand=#true` placements with a `Stackup Hand` property, and its KiCad plugin's sync turns that into the footprint's "Exclude from position files" and "Exclude from BOM" attributes. Bump the Cargo-locked CLI, the manifest and the CI plugin checkout to 0.3.0 and resync the board: J1-J8 (WAGO terminals, JST-XH connectors and the TERM, VIO and FTDI headers) now carry both attributes, so `kicad-cli pcb export pos` leaves them out with no hand filtering and KiCad-based assembly BOMs no longer list them. The regenerated position file and purchasing BOM are unchanged. Also add AGENTS.md, matching CLAUDE.md, for agents other than Claude. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 2 +- AGENTS.md | 59 ++++++++++++++++++++ CLAUDE.md | 9 ++- PCB/DroidCANBridge.kicad_pcb | 104 ++++++++++++++++++++++++++++++++--- PCB/README.md | 9 ++- ci/stackup/Cargo.lock | 22 ++++---- ci/stackup/Cargo.toml | 2 +- manifest.kdl | 2 +- 8 files changed, 181 insertions(+), 28 deletions(-) create mode 100644 AGENTS.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e65579..047c319 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: uses: actions/checkout@v7 with: repository: stackup-eda/stackup - ref: v0.2.0 + ref: v0.3.0 path: stackup-tool - name: Install Rust 1.96 diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..c4a7733 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,59 @@ +# DroidCANBridge — Claude Notes + +## Design principles + +This device makes CANBus much easier for droid builders: a very small, cheap CAN-to-UART bridge that gives a +device without CAN support its own CANBus endpoint, translating CAN to a plain UART and back. + +Requirements and the decisions behind them are recorded in [PCB/README.md](PCB/README.md). Read it +before changing the hardware, and add to it rather than re-deciding something already settled there. + +## Repository layout + +- `PCB/` — hardware. `PCB/stackup/` holds the Stackup design, `PCB/datasheets/` the manufacturer + datasheets (fetched with the `pcb-design` skill's `datasheet.py`), and the KiCad project + (`DroidCANBridge.*`) lives beside them. +- `ci/` — the Cargo-locked Stackup CLI (`ci/stackup/`) and the PCB sync check (`check_pcb_sync.py`). +- `src/`, `include/`, `test/` — firmware (PlatformIO, STM32C092). Not started yet. + +## Git workflow + +**All changes go through pull requests — never push directly to `main`.** History is linear: rebase, +never merge. Land PRs with `gh pr merge --rebase`. The remote is `thePunderWoman`. + +Because PRs land by rebase, `git branch -d` and `--merged` won't recognize a landed branch. Confirm +via `git log --oneline` or `gh pr view --json state`, then `git branch -D `. + +## Hardware design (Stackup) + +The electrical design is Stackup KDL — `PCB/stackup/board.kdl` and `PCB/stackup/parts.kdl` — not +KiCad schematics (there are none). Hardware work follows the `pcb-design` skill. + +- Check the design with `stackup check PCB/stackup/board.kdl --locked` (CLI 0.3.0; the Cargo-locked + copy in `ci/stackup/` is the reference version). The parts library is pinned by commit in + `manifest.kdl`. +- After any change to the KDL, sync `PCB/DroidCANBridge.kicad_pcb` from it with the Stackup KiCad + plugin (never edit footprint nets by hand) and commit the PCB with the KDL. Footprints record their + `board.kdl` line, so even reordering lines needs a resync. +- Logos are KiCad `board_only` footprints; the sync leaves them alone. Mounting holes are KDL + placements whose stock footprint already excludes itself from the BOM and position files. +- SMD parts (including the boot button) are assembled by JLCPCB; connectors, WAGO terminals and + headers are through-hole and hand-soldered. Give every hand-soldered part `hand=#true` in + `board.kdl`: the sync then sets its *Exclude from position files* and *Exclude from BOM* + attributes, so the KiCad exports leave it out. Don't set those attributes by hand. +- CI (`.github/workflows/ci.yml`) runs the Stackup check and the PCB sync check on PCB changes. The + only required check on `main` should be `CI Result`; add any new job to its `needs` list. + +## Firmware (once it exists) + +**Test coverage** +- All new logic gets unit tests in `test/`, running on the native PlatformIO environment + (`pio test -e native`) with no hardware. Do not add test dependencies that need Arduino or + physical hardware. +- Keep hardware-touching code (FDCAN/UART HAL wrappers) thin; put the bridging and framing logic in + plain, hardware-agnostic code that is compiled and covered natively. +- Every bug fix gets a regression test that would have caught it. + +**Build verification** +- Verify the real firmware build locally (`pio run`) before pushing. Fix a broken build before + opening or merging a PR. diff --git a/CLAUDE.md b/CLAUDE.md index d50fad5..c4a7733 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -29,15 +29,18 @@ via `git log --oneline` or `gh pr view --json state`, then `git branch The electrical design is Stackup KDL — `PCB/stackup/board.kdl` and `PCB/stackup/parts.kdl` — not KiCad schematics (there are none). Hardware work follows the `pcb-design` skill. -- Check the design with `stackup check PCB/stackup/board.kdl --locked` (CLI 0.2.0; the Cargo-locked +- Check the design with `stackup check PCB/stackup/board.kdl --locked` (CLI 0.3.0; the Cargo-locked copy in `ci/stackup/` is the reference version). The parts library is pinned by commit in `manifest.kdl`. - After any change to the KDL, sync `PCB/DroidCANBridge.kicad_pcb` from it with the Stackup KiCad plugin (never edit footprint nets by hand) and commit the PCB with the KDL. Footprints record their `board.kdl` line, so even reordering lines needs a resync. -- Mounting holes and logos are KiCad `board_only` footprints; the sync leaves them alone. +- Logos are KiCad `board_only` footprints; the sync leaves them alone. Mounting holes are KDL + placements whose stock footprint already excludes itself from the BOM and position files. - SMD parts (including the boot button) are assembled by JLCPCB; connectors, WAGO terminals and - headers are through-hole and hand-soldered. + headers are through-hole and hand-soldered. Give every hand-soldered part `hand=#true` in + `board.kdl`: the sync then sets its *Exclude from position files* and *Exclude from BOM* + attributes, so the KiCad exports leave it out. Don't set those attributes by hand. - CI (`.github/workflows/ci.yml`) runs the Stackup check and the PCB sync check on PCB changes. The only required check on `main` should be `CI Result`; add any new job to its `needs` list. diff --git a/PCB/DroidCANBridge.kicad_pcb b/PCB/DroidCANBridge.kicad_pcb index a7898c8..c6a740c 100644 --- a/PCB/DroidCANBridge.kicad_pcb +++ b/PCB/DroidCANBridge.kicad_pcb @@ -2582,8 +2582,19 @@ ) ) ) + (property "Stackup Hand Excluded" "exclude_from_bom exclude_from_pos_files" + (at -2 0 0) + (layer "F.SilkS") + (hide yes) + (uuid "e4347a70-e173-4894-9ca4-58968e83b845") + (effects + (font + (size 1.27 1.27) + ) + ) + ) (path "/85c3c99a-4404-50f5-9583-e113b3aa22db") - (attr through_hole) + (attr through_hole exclude_from_pos_files exclude_from_bom) (duplicate_pad_numbers_are_jumpers no) (fp_line (start 6.18 -9.27) @@ -4659,8 +4670,19 @@ ) ) ) + (property "Stackup Hand Excluded" "exclude_from_bom exclude_from_pos_files" + (at -2 0 0) + (layer "F.SilkS") + (hide yes) + (uuid "56350952-72b1-4bc6-939f-8e016ba0e8e9") + (effects + (font + (size 1.27 1.27) + ) + ) + ) (path "/58b2c568-5130-5c18-89f8-46b4dadade4a") - (attr through_hole) + (attr through_hole exclude_from_pos_files exclude_from_bom) (duplicate_pad_numbers_are_jumpers no) (fp_line (start -1.6 -2.75) @@ -4995,8 +5017,19 @@ ) ) ) + (property "Stackup Hand Excluded" "exclude_from_bom exclude_from_pos_files" + (at 0 -2 0) + (layer "F.SilkS") + (hide yes) + (uuid "e4a5714e-a3f9-47e6-a139-a91629716966") + (effects + (font + (size 1.27 1.27) + ) + ) + ) (path "/4adcd872-3ed7-5a2c-9ee4-2161c3eadb31") - (attr through_hole) + (attr through_hole exclude_from_pos_files exclude_from_bom) (duplicate_pad_numbers_are_jumpers no) (fp_line (start 1.38 1.27) @@ -5285,8 +5318,19 @@ ) ) ) + (property "Stackup Hand Excluded" "exclude_from_bom exclude_from_pos_files" + (at -2 0 0) + (layer "F.SilkS") + (hide yes) + (uuid "41c1fa32-be40-42e4-935d-1695b94f8013") + (effects + (font + (size 1.27 1.27) + ) + ) + ) (path "/be3033cc-9178-59c3-a4e7-c42c6ee72584") - (attr through_hole) + (attr through_hole exclude_from_pos_files exclude_from_bom) (duplicate_pad_numbers_are_jumpers no) (fp_line (start -1.38 -1.38) @@ -5584,8 +5628,19 @@ ) ) ) + (property "Stackup Hand Excluded" "exclude_from_bom exclude_from_pos_files" + (at -2 0 0) + (layer "F.SilkS") + (hide yes) + (uuid "76e88f8e-dad7-4cea-88bc-ab2bca3b1208") + (effects + (font + (size 1.27 1.27) + ) + ) + ) (path "/f6ada194-88aa-54da-9101-29e8ecb8c0ee") - (attr through_hole) + (attr through_hole exclude_from_pos_files exclude_from_bom) (duplicate_pad_numbers_are_jumpers no) (fp_line (start -1.38 -1.38) @@ -5922,8 +5977,19 @@ ) ) ) + (property "Stackup Hand Excluded" "exclude_from_bom exclude_from_pos_files" + (at 2 0 0) + (layer "F.SilkS") + (hide yes) + (uuid "4ca095d0-e067-416b-ab45-b19405d0b1aa") + (effects + (font + (size 1.27 1.27) + ) + ) + ) (path "/33dcdc17-416c-5a32-a49f-4c46c1c0b3e0") - (attr through_hole) + (attr through_hole exclude_from_pos_files exclude_from_bom) (duplicate_pad_numbers_are_jumpers no) (fp_line (start -1.8 2.75) @@ -7479,8 +7545,19 @@ ) ) ) + (property "Stackup Hand Excluded" "exclude_from_bom exclude_from_pos_files" + (at 2 0 0) + (layer "F.SilkS") + (hide yes) + (uuid "67e8d7e6-c85e-428c-a619-2c9ea92d4aff") + (effects + (font + (size 1.27 1.27) + ) + ) + ) (path "/cc8fdc49-3927-591b-b918-b904255b52aa") - (attr through_hole) + (attr through_hole exclude_from_pos_files exclude_from_bom) (duplicate_pad_numbers_are_jumpers no) (fp_line (start -1.8 2.75) @@ -8649,8 +8726,19 @@ ) ) ) + (property "Stackup Hand Excluded" "exclude_from_bom exclude_from_pos_files" + (at 2 0 0) + (layer "F.SilkS") + (hide yes) + (uuid "0da77dc7-124a-4177-a1b2-6557f2b8b12a") + (effects + (font + (size 1.27 1.27) + ) + ) + ) (path "/1a6c01f9-957a-5f59-ab55-d3d7239d792b") - (attr through_hole) + (attr through_hole exclude_from_pos_files exclude_from_bom) (duplicate_pad_numbers_are_jumpers no) (fp_line (start -2.56 5.47) diff --git a/PCB/README.md b/PCB/README.md index d9b3cb1..287ee6c 100644 --- a/PCB/README.md +++ b/PCB/README.md @@ -252,8 +252,10 @@ Accepted findings: [`production/`](production/) holds the Gerbers and job file (2 layers, 1.6 mm) and the PTH/NPTH drills with maps in `production/gerbers/`, and the purchasing BOM (`stackup bom`, with LCSC numbers for JLCPCB) and the placement file in `production/bom/`. The placement file lists only the 20 -JLCPCB-placed parts: the BOM's hand-soldered connectors and headers (J1-J8, marked Hand/DNP) are -left out. Check JLCPCB's placement preview for rotation and pin 1 on U1-U3, Q1, D1-D3 and SW1. +JLCPCB-placed parts: the hand-soldered connectors and headers (J1-J8) are `hand=#true` in the KDL, +which marks them Hand/DNP in the BOM and, from Stackup 0.3.0, makes the PCB sync give their +footprints KiCad's *Exclude from position files* and *Exclude from BOM* attributes. The mounting +holes' stock footprint carries both attributes itself. Check JLCPCB's placement preview for rotation and pin 1 on U1-U3, Q1, D1-D3 and SW1. Regenerate everything after any board change. Refill and save the pours first, because the exporters plot the fills stored in the board file: @@ -268,7 +270,8 @@ stackup bom PCB/stackup/board.kdl --locked -o PCB/production/bom/DroidCANBridge- ``` `stackup bom` exits 1 because H1/H2 have no MPN (see accepted findings) but still writes the CSV. -Then drop the BOM's Hand/DNP references from the placement file. +The placement file needs no hand editing: the footprint attributes already keep J1-J8 and H1/H2 +out of it. ## Bench checklist (first board) diff --git a/ci/stackup/Cargo.lock b/ci/stackup/Cargo.lock index b2616c4..57471b1 100644 --- a/ci/stackup/Cargo.lock +++ b/ci/stackup/Cargo.lock @@ -2,13 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "droidcanbridge-stackup-check" -version = "0.0.0" -dependencies = [ - "stackup-eda", -] - [[package]] name = "autocfg" version = "1.5.1" @@ -32,6 +25,13 @@ dependencies = [ "syn", ] +[[package]] +name = "droidcanbridge-stackup-check" +version = "0.0.0" +dependencies = [ + "stackup-eda", +] + [[package]] name = "icu_collections" version = "2.3.0" @@ -243,9 +243,9 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "stackup-eda" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a6b8652668d21b6683d266d22d10a0f5c975aab0d70e17aa447525e36d7172" +checksum = "b8ba42c75bb8c8f64b3b09200a9bf0c37471caa23adda7f2a6840842384e0d1d" dependencies = [ "miette", "stackup-eda-parser", @@ -253,9 +253,9 @@ dependencies = [ [[package]] name = "stackup-eda-parser" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75b7ab62576796cf3c81ea908e232aaba1b72cd43430594f0bd449922ee0360" +checksum = "c89806694b8254286093635f029a3c20fd475e5d10d8c3cde5c4fac410d92562" dependencies = [ "kdl", "miette", diff --git a/ci/stackup/Cargo.toml b/ci/stackup/Cargo.toml index c28aa0d..f473e65 100644 --- a/ci/stackup/Cargo.toml +++ b/ci/stackup/Cargo.toml @@ -5,4 +5,4 @@ edition = "2024" publish = false [dependencies] -stackup = { package = "stackup-eda", version = "=0.2.0" } +stackup = { package = "stackup-eda", version = "=0.3.0" } diff --git a/manifest.kdl b/manifest.kdl index f7b93df..f864740 100644 --- a/manifest.kdl +++ b/manifest.kdl @@ -1,2 +1,2 @@ -stackup "0.2" +stackup "0.3" library stackup git="https://github.com/stackup-eda/library" rev="9cf54c63f7f95b711e30edf5992a9bd28932d78d"