Skip to content

04 stm32f103_min

Reference: ST AN2586 "Getting started with STM32F10xxx hardware development" and the STM32F103x8 datasheet. From memory of those documents, not re-read: 100 nF per VDD/VSS pair plus one 4.7 uF, VDDA 10 nF + 1 uF, 100 nF on NRST, BOOT0 pulled down, 1.5k pull-up on USB D+ (the F103 has none inside), 22R USB series resistors, HSE load caps from C = 2 x (CL - Cstray). Chosen here: blue-pill header order, AP2112K regulator, USB-C, an 8 MHz crystal with CL = 10 pF (12 pF load caps), VBAT and VDDA tied to VDD.

Read later (AN2586 Rev 8, 2026-11-15): VDDA takes 100 nF + 1 uF, not 10 nF + 1 uF; C6 is now 100 nF here and on 06. AN2586 does not cover USB, so the D+ pull-up and series resistors are not from it. Details in references.md.

Stresses: 0.5 mm LQFP-48 with 33 signals to two headers, decoupling on the bottom, a crystal, USB. The first board built with REVIEW limits from the start.

What broke 1. Routed 100% on the first try, and every decoupler orientation was wrong: VDD pads sat beside VSS pins. Only the pads dump showed it. 2. The review failed a board DRC passed: crystal trace 12.7 mm, USB D+ 7.6 mm longer than D-. 3. Both numbers were partly false. Hand-routed segments came back twice from SES import, doubling their measured length. 4. PA11/PA12 went to the header as on a blue pill. The header stubs made the pair unmatched by construction. 5. Autorouted USB from the connector to the MCU: 39.6 mm against 64.3 mm. 6. My first bottom-layer pair crossed itself (same mistake as on 05). 7. Two tactile switches did not fit between headers 22.86 mm apart. 8. Starved thermal reliefs on GND pads, different pads on every run. 9. Dangling track stubs and a dangling via left by the autorouter.

Tool changes - Segment de-duplication, dangling via and stub removal after routing. - min_resolved_spokes defaults to 1: GND is routed as traces before the pour exists, so pour spokes are extra copper, not the only connection. - FR_MARGIN (router clearance margin) exists but is off by default; at 10 um it made the RP2040 QFN unroutable.

Method that worked: USB series resistors beside the MCU pins with a mirrored hand-routed pair; the long run from the ESD part hand-routed on the bottom under the switches; OSC_OUT hand-routed between the crystal's pads instead of round it; PA11/PA12 removed from the header. Headers moved to 25.4 mm apart.

Second pass: getting the ground plane back

The first passing version had a bottom GND pour covering 36% of the board in nine pieces. Measured cause: with no cost file Freerouting put 798 mm of track on the bottom and 590 mm on top.

  • verify now prints the coverage of every whole-board pour and REVIEW can set a floor ("coverage": {"B.Cu": 0.65}).
  • FR_BOTTOM_COST = 20 writes a Freerouting rules file. Bottom track fell to 195 mm with every net routed; the pour is 77% and one piece.
  • Getting there took four failed attempts, each leaving two different header signals unrouted. The cause was my rules file, not the cost: it set the top layer's against-direction cost to 1.0. At 2.5 everything routes. Cost 60 abandons seven nets. The fanout, via and rip-up lines in a rules file are ignored by Freerouting 2.5.
  • A second "completion" routing pass was tried and removed: it could not place the abandoned nets either.
  • Steering the router off the bottom made the autorouted USB section at the connector wander (15 mm of skew). That section is now hand-routed too: A6 and A7 run down the 0.95 mm channel between the ESD part's pad columns.
  • My own cleanup deleted a hand-placed via that sat mid-track. Hand-placed vias are now never removed, and a hand track is split where a via lands.
  • gen reports only nets nobody hand-routed as unrouted, and keeps the schematic-side gate outputs when the schematic did not change.

Left open - The top GND pour is 38% in twenty pieces. It is fill, not a plane. - The skew figure is total copper per net, so it counts the 5.6 mm link from the second D- connector pad. It is not a path-length comparison. - The USB skew limit is 5 mm, justified for full speed only. - No LSE crystal; PC14/PC15 go to the header. - BOOT1 (PB2) is pulled down and not on the header. - Decouplers are 0402 on the bottom side: two-sided assembly. - Not built.