HS-7 USB D+ and D- swapped¶
| Severity | Status | Implementation |
|---|---|---|
| error | runs in better_erc | easy, depends on netlist |
Data it needs: graph, part classes, rails.
Looks at. USB data nets with pin names at the PHY and the connector.
What it catches. A USB 2.0 data path where the part's D+ (DP, USBDP) pin reaches the connector's D- pin, or the other way round, through any series resistors, ESD parts and chokes.
Why it matters. USB 2.0 has no polarity inversion (SLLA414 §2.1). With D+ and D- crossed, a full-speed device's pull-up appears on D-, so the host sees a low-speed device and the first full-speed packet fails; a high-speed device never gets past the chirp. A USB-C receptacle adds a trap: A6/A7 and B6/B7 must be joined D+ to D+ and D- to D-.
Example. B153A port 2 (plug to the device under test) and port 4 (USB over SBU) are wired crossed: plug D+ reaches USBDM_DN2, SBU1 reaches USBDM_DN4. The hub can undo it in software (see HS-2), so on B153A this is a warning; the same wiring on an MCU's own USB pins would be a dead port.
How to check. Match pin names on both ends (D+/DP/USBDP vs D-/DM/USBDM, connector pins A6/B6 = D+, A7/B7 = D-), following series two-pin parts with find_chains; analog switches such as a TS3USB221A in the path need signal following (NET-10). Downgrade to a warning when the part has a swap feature (library).
Fix. Cross the traces back (usually a symbol pin-swap on the connector or the ESD array), or set the part's swap register and document it.
References. SLLA414 §2.1; USB251xB §5.1.29; Wikipedia, USB hardware "Pin assignments".
Settings¶
Set them in the project file under [checks."HS-7"], or for one run with --set HS-7.NAME=VALUE.
| Setting | Default | Meaning |
|---|---|---|
HS-7.max_hops |
3 parts | how many series parts (resistors, ferrites, inductors, ties) the path from the connector may pass |
Test schematics¶
Each schematic below is in test_schematics/sources. The block under it is what berc check --only HS-7 reports on it.
hs-7_usb_dp_dm_swapped¶
error HS-7 #1zc USB data crossed between connector J1 and U1: J1.A6 (D+), J1.A7 (D-), J1.B6 (D+) and J1.B7 (D-) reach U1.3 (PA11/USB_DM) and U1.4 (PA12/USB_DP)
net /J1_DM, net /J1_DP, part J1, part U1, pin J1.A6, pin J1.A7, pin J1.B6, pin J1.B7, pin U1.3, pin U1.4
fix: cross the lines back (a pin swap on the connector or the ESD array), or set the part's swap register and document it
HS-7 also fires on the test schematics of other checks: short-12_pair_halves_tied.