ShiboSoftwareDev/msp-exp430fr5994

This code defines and renders electronic components such as a 4MHz ceramic resonator and various microcontroller chips with their physical pin layouts footprints, 3D models, and associated metadata.

Version
1.0.0
License
unset
Stars
0

index.circuit.tsx

PCBPCB preview for index.circuit.tsx
SchematicSchematic preview for index.circuit.tsx
import { CSTCR4M00G53_R0 } from "./imports/CSTCR4M00G53_R0"
import { MicroXNJ } from "./imports/MicroXNJ"
import { MSP430F5528IRGCR } from "./imports/MSP430F5528IRGCR"
import { MSP430FR5994IPNR } from "./imports/MSP430FR5994IPNR"
import { SC_32S32_768kHz20PPM12_5pF } from "./imports/SC_32S32_768kHz20PPM12_5pF"
import { TS342A2P_WZ } from "./imports/TS342A2P_WZ"
import { USBLC6_2SC6 } from "./imports/USBLC6_2SC6"

const onSheet = <const T extends Record<string, unknown>>(
  schSheetName: string,
  placement: T,
) => ({ schSheetName, ...placement })

const fanout = (x: number, y: number) => [{ x, y }]

const SCH = {
  U_TARGET: onSheet("TARGET", { schX: 0, schY: 0 }),
  C_TARGET_BULK: onSheet("TARGET", { schX: -10, schY: 8, schOrientation: "vertical" }),
  C_TARGET_DVCC1: onSheet("TARGET", { schX: -8, schY: 8, schOrientation: "vertical" }),
  C_TARGET_DVCC2: onSheet("TARGET", { schX: -6, schY: 8, schOrientation: "vertical" }),
  C_TARGET_DVCC3: onSheet("TARGET", { schX: -4, schY: 8, schOrientation: "vertical" }),
  R_DVCC1: onSheet("TARGET", { schX: -8, schY: 5, schOrientation: "horizontal" }),
  R_DVCC2: onSheet("TARGET", { schX: -4, schY: 5, schOrientation: "horizontal" }),
  R_DVCC3: onSheet("TARGET", { schX: 0, schY: 5, schOrientation: "horizontal" }),
  C_TARGET_AVCC: onSheet("TARGET", { schX: -2, schY: 8, schOrientation: "vertical" }),
  R_AVCC: onSheet("TARGET", { schX: 1, schY: 8, schOrientation: "horizontal" }),
  Y_LF: onSheet("TARGET", { schX: 8, schY: 5, schOrientation: "horizontal" }),
  C_LFXIN: onSheet("TARGET", { schX: 6, schY: 2, schOrientation: "vertical" }),
  C_LFXOUT: onSheet("TARGET", { schX: 10, schY: 2, schOrientation: "vertical" }),
  Y_HF: onSheet("TARGET", { schX: 8, schY: -2, schOrientation: "right" }),
  SW_RESET: onSheet("TARGET", { schX: -9, schY: -7, schOrientation: "down" }),
  R_TARGET_RST: onSheet("TARGET", { schX: -5, schY: -6, schOrientation: "horizontal" }),
  C_TARGET_RST: onSheet("TARGET", { schX: -2, schY: -8, schOrientation: "vertical" }),

  J1: onSheet("BOOSTERPACK_UI", { schX: -11, schY: 5 }),
  J3: onSheet("BOOSTERPACK_UI", { schX: -4, schY: 5 }),
  J4: onSheet("BOOSTERPACK_UI", { schX: 4, schY: 5 }),
  J2: onSheet("BOOSTERPACK_UI", { schX: 9, schY: 5 }),
  SW1: onSheet("BOOSTERPACK_UI", { schX: -8, schY: -6, schOrientation: "down" }),
  SW2: onSheet("BOOSTERPACK_UI", { schX: -4, schY: -6, schOrientation: "down" }),
  R_LED1: onSheet("BOOSTERPACK_UI", { schX: 1, schY: -5, schOrientation: "horizontal" }),
  LED1: onSheet("BOOSTERPACK_UI", { schX: 4, schY: -5, schOrientation: "horizontal" }),
  R_LED2: onSheet("BOOSTERPACK_UI", { schX: 7, schY: -7, schOrientation: "horizontal" }),
  LED2: onSheet("BOOSTERPACK_UI", { schX: 10, schY: -7, schOrientation: "horizontal" }),
  J_EXT_3V3: onSheet("BOOSTERPACK_UI", { schX: -7, schY: -9 }),
  J_EXT_5V: onSheet("BOOSTERPACK_UI", { schX: -1, schY: -9 }),

  J_SD: onSheet("STORAGE_SUPERCAP", { schX: -7, schY: 2 }),
  C_SD_BULK: onSheet("STORAGE_SUPERCAP", { schX: -11, schY: -5, schOrientation: "vertical" }),
  C_SD_DECOUPLE: onSheet("STORAGE_SUPERCAP", { schX: -8, schY: -5, schOrientation: "vertical" }),
  R_SD_DETECT: onSheet("STORAGE_SUPERCAP", { schX: -4, schY: -5, schOrientation: "vertical" }),
  R_CAP_CHARGE: onSheet("STORAGE_SUPERCAP", { schX: 3, schY: 4, schOrientation: "horizontal" }),
  J_CAP_MODE: onSheet("STORAGE_SUPERCAP", { schX: 7, schY: 4 }),
  C_SUPER: onSheet("STORAGE_SUPERCAP", { schX: 10, schY: 0, schOrientation: "vertical" }),

  J_PWRSEL: onSheet("TARGET_SUPPLY", { schX: -7, schY: 3 }),
  J_CURRENT: onSheet("TARGET_SUPPLY", { schX: -2, schY: 3 }),
  J_EXT: onSheet("TARGET_SUPPLY", { schX: 3, schY: 3 }),

  J_ISO_TST: onSheet("EZFET_HOST", { schX: -10.5, schY: 10 }),
  J_ISO_RST: onSheet("EZFET_HOST", { schX: -7.5, schY: 10 }),
  J_ISO_RX: onSheet("EZFET_HOST", { schX: -4.5, schY: 10 }),
  J_ISO_TX: onSheet("EZFET_HOST", { schX: -1.5, schY: 10 }),
  J_ISO_RTS: onSheet("EZFET_HOST", { schX: 1.5, schY: 10 }),
  J_ISO_CTS: onSheet("EZFET_HOST", { schX: 4.5, schY: 10 }),
  J_ISO_VCC: onSheet("EZFET_HOST", { schX: 7.5, schY: 10 }),
  J_ISO_GND: onSheet("EZFET_HOST", { schX: 10.5, schY: 10 }),
  J_JTAG: onSheet("EZFET_HOST", { schX: 10, schY: 0 }),

  J_USB: onSheet("USB_POWER", { schX: -10, schY: 3 }),
  U_ESD: onSheet("USB_POWER", { schX: -6, schY: 3, schRotation: 180 }),
  R_USB_DM: onSheet("USB_POWER", { schX: -2, schY: 2.4, schOrientation: "horizontal" }),
  R_USB_DP: onSheet("USB_POWER", { schX: -2, schY: 3.6, schOrientation: "horizontal" }),
  R_USB_PUR: onSheet("USB_POWER", { schX: 2, schY: 1, schOrientation: "horizontal" }),
  R_SHIELD: onSheet("USB_POWER", { schX: -8, schY: -2, schOrientation: "vertical" }),
  C_SHIELD: onSheet("USB_POWER", { schX: -5, schY: -2, schOrientation: "vertical" }),
  U_LDO: onSheet("USB_POWER", { schX: 5, schY: 4 }),
  C_LDO_IN: onSheet("USB_POWER", { schX: 2, schY: -2, schOrientation: "vertical" }),
  C_LDO_OUT: onSheet("USB_POWER", { schX: 8, schY: -2, schOrientation: "vertical" }),
  R_LDO_EN: onSheet("USB_POWER", { schX: 2, schY: 5, schOrientation: "horizontal" }),
  R_PWR: onSheet("USB_POWER", { schX: 10, schY: 2, schOrientation: "horizontal" }),
  LED_PWR: onSheet("USB_POWER", { schX: 12, schY: 2, schOrientation: "horizontal" }),

  U_DBG: onSheet("EZFET_HOST", { schX: 0, schY: 0 }),
  Y_DBG: onSheet("EZFET_HOST", { schX: -8, schY: 2, schOrientation: "right" }),
  C_DBG_VCORE: onSheet("EZFET_HOST", { schX: 8, schY: 7, schOrientation: "vertical" }),
  C_DBG_VUSB: onSheet("EZFET_HOST", { schX: -5, schY: -6, schOrientation: "vertical" }),
  C_DBG_V18: onSheet("EZFET_HOST", { schX: -3, schY: -6, schOrientation: "vertical" }),
  C_DBG_AVCC: onSheet("EZFET_HOST", { schX: 0, schY: -6, schOrientation: "vertical" }),
  C_DBG_DVCC1: onSheet("EZFET_HOST", { schX: 2, schY: -6, schOrientation: "vertical" }),
  C_DBG_DVCC2: onSheet("EZFET_HOST", { schX: 4, schY: -6, schOrientation: "vertical" }),
  C_DBG_BULK: onSheet("EZFET_HOST", { schX: 6, schY: -6, schOrientation: "vertical" }),
  R_DBG_RST: onSheet("EZFET_HOST", { schX: 7, schY: 5, schOrientation: "horizontal" }),
  C_DBG_RST: onSheet("EZFET_HOST", { schX: 10, schY: 5, schOrientation: "vertical" }),
  R_DBG_RED: onSheet("EZFET_HOST", { schX: -7, schY: -7, schOrientation: "horizontal" }),
  LED_DBG_RED: onSheet("EZFET_HOST", { schX: -10, schY: -7, schOrientation: "horizontal" }),
  R_DBG_GREEN: onSheet("EZFET_HOST", { schX: 1, schY: -7, schOrientation: "horizontal" }),
  LED_DBG_GREEN: onSheet("EZFET_HOST", { schX: -2, schY: -7, schOrientation: "horizontal" }),
  J_DBG_PROG: onSheet("EZFET_HOST", { schX: 10, schY: -4, schRotation: 180 }),
} as const

const Ldo3V3 = (props: any) => (
  <chip
    {...props}
    manufacturerPartNumber="TLV70033DDCR"
    supplierPartNumbers={{ jlcpcb: ["C11337"] }}
    footprint="sot23_5"
    pinLabels={{ pin1: "IN", pin2: "GND", pin3: "EN", pin4: "NC", pin5: "OUT" }}
    pinAttributes={{
      IN: { requiresPower: true },
      GND: { requiresGround: true },
      EN: { mustBeConnected: true },
      OUT: { providesPower: true },
    }}
  />
)

const Link = ({
  name,
  pcbX,
  pcbY = 8,
  schX,
  schY,
  schSheetName,
}: {
  name: string
  pcbX: number
  pcbY?: number
  schX: number
  schY: number
  schSheetName: string
}) => (
  <jumper
    name={name}
    manufacturerPartNumber="2.54mm removable shunt link"
    footprint={
      <footprint>
        <platedhole shape="circle" portHints={["pin1"]} pcbX="0mm" pcbY="1.27mm" holeDiameter="0.9mm" outerDiameter="1.7mm" />
        <platedhole shape="circle" portHints={["pin2"]} pcbX="0mm" pcbY="-1.27mm" holeDiameter="0.9mm" outerDiameter="1.7mm" />
        <silkscreenrect width="2mm" height="3.4mm" />
      </footprint>
    }
    pinLabels={{ pin1: "HOST", pin2: "TARGET" }}
    schPinArrangement={{ leftSide: ["HOST"], rightSide: ["TARGET"] }}
    schX={schX}
    schY={schY}
    schSheetName={schSheetName}
    pcbX={pcbX}
    pcbY={pcbY}
  />
)

const MicroSdSocket = (props: any) => (
  <connector
    {...props}
    manufacturerPartNumber="DNP - Molex 502702-0831 compatible microSD footprint"
    pinLabels={{
      pin1: "DAT2",
      pin2: "DAT3_CS",
      pin3: "CMD_MOSI",
      pin4: "VDD",
      pin5: "CLK",
      pin6: "VSS",
      pin7: "DAT0_MISO",
      pin8: "DAT1",
      pin9: "DETECT",
      pin10: "SHELL1",
      pin11: "SHELL2",
      pin12: "SHELL3",
      pin13: "SHELL4",
    }}
    pinAttributes={{
      VDD: { requiresPower: true },
      VSS: { requiresGround: true },
      SHELL1: { requiresGround: true },
      SHELL2: { requiresGround: true },
      SHELL3: { requiresGround: true },
      SHELL4: { requiresGround: true },
    }}
    schPinArrangement={{
      leftSide: ["DAT2", "DAT3_CS", "CMD_MOSI", "CLK", "DAT0_MISO", "DAT1", "DETECT"],
      rightSide: ["VDD", "VSS", "SHELL1", "SHELL2", "SHELL3", "SHELL4"],
    }}
    footprint={
      <footprint>
        <smtpad shape="rect" portHints={["pin1"]} pcbX="-3.5mm" pcbY="-6.6mm" width="0.8mm" height="2mm" />
        <smtpad shape="rect" portHints={["pin2"]} pcbX="-2.5mm" pcbY="-6.6mm" width="0.8mm" height="2mm" />
        <smtpad shape="rect" portHints={["pin3"]} pcbX="-1.5mm" pcbY="-6.6mm" width="0.8mm" height="2mm" />
        <smtpad shape="rect" portHints={["pin4"]} pcbX="-0.5mm" pcbY="-6.6mm" width="0.8mm" height="2mm" />
        <smtpad shape="rect" portHints={["pin5"]} pcbX="0.5mm" pcbY="-6.6mm" width="0.8mm" height="2mm" />
        <smtpad shape="rect" portHints={["pin6"]} pcbX="1.5mm" pcbY="-6.6mm" width="0.8mm" height="2mm" />
        <smtpad shape="rect" portHints={["pin7"]} pcbX="2.5mm" pcbY="-6.6mm" width="0.8mm" height="2mm" />
        <smtpad shape="rect" portHints={["pin8"]} pcbX="3.5mm" pcbY="-6.6mm" width="0.8mm" height="2mm" />
        <smtpad shape="rect" portHints={["pin9"]} pcbX="6.4mm" pcbY="2mm" width="1.2mm" height="2.2mm" />
        <smtpad shape="rect" portHints={["pin10"]} pcbX="-6.4mm" pcbY="4.8mm" width="1.8mm" height="2.4mm" />
        <smtpad shape="rect" portHints={["pin11"]} pcbX="6.4mm" pcbY="4.8mm" width="1.8mm" height="2.4mm" />
        <smtpad shape="rect" portHints={["pin12"]} pcbX="-6.4mm" pcbY="-4.8mm" width="1.8mm" height="2.4mm" />
        <smtpad shape="rect" portHints={["pin13"]} pcbX="6.4mm" pcbY="-4.8mm" width="1.8mm" height="2.4mm" />
        <silkscreenrect width="14.5mm" height="15.5mm" />
        <silkscreentext text="microSD DNP" pcbX="0mm" pcbY="0mm" fontSize="0.8mm" />
      </footprint>
    }
  />
)

const SuperCap = (props: any) => (
  <capacitor
    {...props}
    capacitance="220mF"
    manufacturerPartNumber="0.22F 5.5V radial supercapacitor"
    footprint={
      <footprint>
        <platedhole shape="circle" portHints={["pin1"]} pcbX="-1.75mm" pcbY="0mm" holeDiameter="0.9mm" outerDiameter="1.8mm" />
        <platedhole shape="circle" portHints={["pin2"]} pcbX="1.75mm" pcbY="0mm" holeDiameter="0.9mm" outerDiameter="1.8mm" />
        <silkscreencircle radius="4mm" />
        <silkscreentext text="+" pcbX="-2.8mm" pcbY="0mm" fontSize="1mm" />
      </footprint>
    }
  />
)

export default () => (
  <board
    title="MSP-EXP430FR5994 LaunchPad - tscircuit edition"
    width="54mm"
    height="86mm"
    layers={4}
    borderRadius="2mm"
    minTraceWidth="0.15mm"
    minViaHoleDiameter="0.3mm"
    minViaPadDiameter="0.45mm"
    pcbStyle={{ viaHoleDiameter: "0.3mm", viaPadDiameter: "0.45mm" }}
  >
    <schematicsheet name="OVERVIEW" displayName="System Overview" sheetIndex={0}>
      <schematictext text="MSP-EXP430FR5994 System Overview" schX={-10} schY={8} fontSize={0.8} anchor="left" />
      <schematictext text="MSP430FR5994 target MCU" schX={-3} schY={2} fontSize={0.65} anchor="left" />
      <schematictext text="eZ-FET, USB, and target supply" schX={-3} schY={6} fontSize={0.5} anchor="left" />
      <schematictext text="40-pin BoosterPack, buttons, and LEDs" schX={4} schY={2} fontSize={0.5} anchor="left" />
      <schematictext text="microSD DNP footprint and 0.22 F supercapacitor" schX={-10} schY={-3} fontSize={0.5} anchor="left" />
      <schematictext text="Seven-sheet organization follows TI SLAU678C." schX={-10} schY={-7} fontSize={0.4} anchor="left" />
    </schematicsheet>
    <schematicsheet name="TARGET" displayName="Target MSP430FR5994 MCU" sheetIndex={1}>
      <schematictext text="MSP430FR5994 Target MCU, Power, Reset, and Crystals" schX={-12} schY={10} fontSize={0.7} anchor="left" />
      <schematictext text="Exact 80-pin PN package and pin mapping from TI SLAU678C sheet 2." schX={-12} schY={-10} fontSize={0.35} anchor="left" />
    </schematicsheet>
    <schematicsheet name="BOOSTERPACK_UI" displayName="BoosterPack, Buttons, and LEDs" sheetIndex={2}>
      <schematictext text="40-pin BoosterPack Interface, External Rails, Pushbuttons, and LEDs" schX={-12} schY={10} fontSize={0.7} anchor="left" />
    </schematicsheet>
    <schematicsheet name="STORAGE_SUPERCAP" displayName="microSD and Supercapacitor" sheetIndex={3}>
      <schematictext text="microSD Interface and 0.22 F Supercapacitor" schX={-12} schY={9} fontSize={0.7} anchor="left" />
      <schematictext text="The microSD connector is an intentional DNP footprint because TI removed the EOL socket from current boards." schX={-12} schY={-9} fontSize={0.35} anchor="left" />
    </schematicsheet>
    <schematicsheet name="TARGET_SUPPLY" displayName="Target Supply Implementation" sheetIndex={4}>
      <schematictext text="Conventional 3.3 V Target Supply Implementation" schX={-10} schY={5} fontSize={0.7} anchor="left" />
      <schematictext text="The TI patented EnergyTrace DCDC is intentionally replaced by a fixed LDO and removable power links." schX={-10} schY={1} fontSize={0.45} anchor="left" />
      <schematictext text="Programming, UART, 40-pin BoosterPack I/O, external power, and supercapacitor operation remain usable." schX={-10} schY={-2} fontSize={0.45} anchor="left" />
      <schematictext text="EnergyTrace profiling is not implemented on this recreation." schX={-10} schY={-5} fontSize={0.45} anchor="left" />
    </schematicsheet>
    <schematicsheet name="EZFET_HOST" displayName="eZ-FET Host MCU" sheetIndex={5}>
      <schematictext text="MSP430F5528 eZ-FET Host, Isolation Links, Clock, and Status LEDs" schX={-12} schY={12} fontSize={0.7} anchor="left" />
    </schematicsheet>
    <schematicsheet name="USB_POWER" displayName="USB Interface and 3.3 V Supply" sheetIndex={6}>
      <schematictext text="Protected Micro-USB Interface and 3.3 V eZ-FET Supply" schX={-11} schY={8} fontSize={0.7} anchor="left" />
    </schematicsheet>

    <hole name="H1" diameter="3.2mm" pcbX={-23} pcbY={38} />
    <hole name="H2" diameter="3.2mm" pcbX={23} pcbY={38} />
    <hole name="H3" diameter="3.2mm" pcbX={-19.5} pcbY={-40} />
    <hole name="H4" diameter="3.2mm" pcbX={19.5} pcbY={-40} />
    <fiducial name="FID1" padDiameter="1mm" soldermaskPullback="1mm" pcbX={-20} pcbY={34} />
    <fiducial name="FID2" padDiameter="1mm" soldermaskPullback="1mm" pcbX={-20} pcbY={-34} />
    <silkscreentext text="MSP-EXP430FR5994" fontSize="1.1mm" pcbX={0} pcbY={-40.5} />
    <silkscreentext text="eZ-FET / USB" fontSize="0.9mm" pcbX={0} pcbY={11.5} />
    <silkscreentext text="TARGET" fontSize="0.9mm" pcbX={0} pcbY={1.8} />

    <MicroXNJ name="J_USB" {...SCH.J_USB} pcbX={0} pcbY={39.2} pcbRotation={90} noConnect={["ID"]} />
    <USBLC6_2SC6
      name="U_ESD"
      {...SCH.U_ESD}
      pcbX={0}
      pcbY={32.5}
      pcbRotation={90}
      pinAttributes={{ VBUS: { requiresPower: true }, GND: { requiresGround: true } }}
    />
    <resistor name="R_USB_DM" {...SCH.R_USB_DM} resistance="27ohm" footprint="0402" pcbX={-7} pcbY={21.75} />
    <resistor name="R_USB_DP" {...SCH.R_USB_DP} resistance="27ohm" footprint="0402" pcbX={-7} pcbY={22.75} />
    <resistor name="R_USB_PUR" {...SCH.R_USB_PUR} resistance="1.4kohm" footprint="0402" layer="bottom" pcbX={-11} pcbY={23.5} />
    <resistor name="R_SHIELD" {...SCH.R_SHIELD} resistance="1Mohm" footprint="0603" pcbX={7.2} pcbY={36.7} />
    <capacitor name="C_SHIELD" {...SCH.C_SHIELD} capacitance="1nF" footprint="0603" pcbX={7.2} pcbY={34.7} />
    <Ldo3V3 name="U_LDO" {...SCH.U_LDO} pcbX={-14.5} pcbY={32} pcbRotation={180} />
    <capacitor name="C_LDO_IN" {...SCH.C_LDO_IN} capacitance="1uF" maxDecouplingTraceLength="80mm" footprint="0603" pcbX={-18.5} pcbY={32} />
    <capacitor name="C_LDO_OUT" {...SCH.C_LDO_OUT} capacitance="1uF" maxDecouplingTraceLength="80mm" footprint="0603" pcbX={-10.5} pcbY={32} />
    <resistor name="R_LDO_EN" {...SCH.R_LDO_EN} resistance="10kohm" footprint="0402" pcbX={-10.5} pcbY={35} />
    <resistor name="R_PWR" {...SCH.R_PWR} resistance="1kohm" footprint="0603" pcbX={-17} pcbY={27.5} />
    <led name="LED_PWR" {...SCH.LED_PWR} color="green" footprint="0603" pcbX={-13.5} pcbY={27.5} />

    <MSP430F5528IRGCR
      name="U_DBG"
      {...SCH.U_DBG}
      schWidth="6mm"
      schHeight="9mm"
      pcbX={0}
      pcbY={19.5}
      pinAttributes={{
        AVCC1: { requiresPower: true },
        AVSS1: { requiresGround: true },
        DVCC1: { requiresPower: true },
        DVSS1: { requiresGround: true },
        DVCC2: { requiresPower: true },
        DVSS2: { requiresGround: true },
        AVSS2: { requiresGround: true },
        VSSU: { requiresGround: true },
        GND_EP: { requiresGround: true },
        VBUS: { requiresPower: true },
      }}
    />
    <CSTCR4M00G53_R0 name="Y_DBG" {...SCH.Y_DBG} pcbX={-13} pcbY={17} pcbRotation={90} pinAttributes={{ GND: { requiresGround: true } }} />
    <capacitor name="C_DBG_VCORE" {...SCH.C_DBG_VCORE} capacitance="470nF" maxDecouplingTraceLength="25mm" footprint="0402" layer="bottom" pcbX={5.7} pcbY={16.26} pcbRotation={270} />
    <capacitor name="C_DBG_VUSB" {...SCH.C_DBG_VUSB} capacitance="220nF" maxDecouplingTraceLength="25mm" footprint="0402" layer="bottom" pcbX={-5.2} pcbY={21.6} pcbRotation={270} />
    <capacitor name="C_DBG_V18" {...SCH.C_DBG_V18} capacitance="220nF" maxDecouplingTraceLength="25mm" footprint="0402" layer="bottom" pcbX={-5.2} pcbY={17} pcbRotation={90} />
    <capacitor name="C_DBG_AVCC" {...SCH.C_DBG_AVCC} capacitance="100nF" maxDecouplingTraceLength="80mm" footprint="0402" pcbX={0} pcbY={13.2} />
    <capacitor name="C_DBG_DVCC1" {...SCH.C_DBG_DVCC1} capacitance="100nF" maxDecouplingTraceLength="80mm" footprint="0402" pcbX={2.2} pcbY={13.2} />
    <capacitor name="C_DBG_DVCC2" {...SCH.C_DBG_DVCC2} capacitance="100nF" maxDecouplingTraceLength="80mm" footprint="0402" pcbX={4.4} pcbY={13.2} />
    <capacitor name="C_DBG_BULK" {...SCH.C_DBG_BULK} capacitance="10uF" maxDecouplingTraceLength="80mm" footprint="0805" pcbX={-4} pcbY={12.4} />
    <resistor name="R_DBG_RST" {...SCH.R_DBG_RST} resistance="47kohm" footprint="0402" pcbX={-7.5} pcbY={14} />
    <capacitor name="C_DBG_RST" {...SCH.C_DBG_RST} capacitance="1nF" footprint="0402" pcbX={-9.5} pcbY={14} />
    <led name="LED_DBG_RED" {...SCH.LED_DBG_RED} color="red" footprint="0603" pcbX={8.5} pcbY={29} />
    <resistor name="R_DBG_RED" {...SCH.R_DBG_RED} resistance="470ohm" footprint="0603" pcbX={12.5} pcbY={29} />
    <led name="LED_DBG_GREEN" {...SCH.LED_DBG_GREEN} color="green" footprint="0603" pcbX={8.5} pcbY={26} />
    <resistor name="R_DBG_GREEN" {...SCH.R_DBG_GREEN} resistance="390ohm" footprint="0603" pcbX={12.5} pcbY={26} />
    <pinheader
      name="J_DBG_PROG"
      {...SCH.J_DBG_PROG}
      pinCount={7}
      gender="male"
      pitch="2.54mm"
      footprint="pinrow7_p2.54mm"
      pinLabels={["TEST", "TDO", "TDI", "TMS", "TCK", "RST", "GND"]}
      showSilkscreenPinLabels={true}
      pcbX={-21.5}
      pcbY={20}
      pcbRotation={270}
    />

    <Link name="J_ISO_TST" pcbX={-10} {...SCH.J_ISO_TST} />
    <Link name="J_ISO_RST" pcbX={-6} {...SCH.J_ISO_RST} />
    <Link name="J_ISO_RX" pcbX={-2} {...SCH.J_ISO_RX} />
    <Link name="J_ISO_TX" pcbX={2} {...SCH.J_ISO_TX} />
    <Link name="J_ISO_VCC" pcbX={6} {...SCH.J_ISO_VCC} />
    <Link name="J_ISO_GND" pcbX={10} {...SCH.J_ISO_GND} />
    <silkscreentext text="TST RST RX TX VCC GND" fontSize="0.5mm" pcbX={0} pcbY={10.2} />

    <MSP430FR5994IPNR
      name="U_TARGET"
      {...SCH.U_TARGET}
      schWidth="8mm"
      schHeight="16mm"
      schPinArrangement={{
        leftSide: [1, 2, 3, 16, 17, 18, 51, 52, 41, 42, 43, 63, 64, 35, 36, 62, 4, 5, 6, 7, 47, 48, 49, 50, 31, 32, 33, 34, 57, 58, 59, 12, 53, 54, 55, 56, 65, 66, 67, 68],
        rightSide: [80, 79, 76, 73, 61, 60, 20, 19, 40, 39, 77, 78, 74, 75, 38, 37, 21, 22, 23, 24, 13, 14, 25, 26, 27, 28, 29, 30, 15, 44, 45, 46, 8, 9, 10, 11, 69, 70, 71, 72],
      }}
      pcbX={0}
      pcbY={-14}
      pinAttributes={{
        DVCC1: { requiresPower: true },
        DVCC2: { requiresPower: true },
        DVCC3: { requiresPower: true },
        AVCC1: { requiresPower: true },
        DVSS1: { requiresGround: true },
        DVSS2: { requiresGround: true },
        DVSS3: { requiresGround: true },
        AVSS1: { requiresGround: true },
        AVSS2: { requiresGround: true },
        AVSS3: { requiresGround: true },
      } as any}
    />
    <capacitor name="C_TARGET_BULK" {...SCH.C_TARGET_BULK} capacitance="10uF" maxDecouplingTraceLength="80mm" footprint="0805" pcbX={-10} pcbY={-15} />
    <capacitor name="C_TARGET_DVCC1" {...SCH.C_TARGET_DVCC1} capacitance="100nF" maxDecouplingTraceLength="80mm" footprint="0402" pcbX={-9.5} pcbY={-8} />
    <capacitor name="C_TARGET_DVCC2" {...SCH.C_TARGET_DVCC2} capacitance="100nF" maxDecouplingTraceLength="80mm" footprint="0402" pcbX={6} pcbY={-23} />
    <capacitor name="C_TARGET_DVCC3" {...SCH.C_TARGET_DVCC3} capacitance="100nF" maxDecouplingTraceLength="80mm" footprint="0402" pcbX={10} pcbY={-9.5} />
    <resistor name="R_DVCC1" {...SCH.R_DVCC1} resistance="0ohm" footprint="0402" pcbX={-10} pcbY={-11} />
    <resistor name="R_DVCC2" {...SCH.R_DVCC2} resistance="0ohm" footprint="0402" pcbX={8} pcbY={-24} />
    <resistor name="R_DVCC3" {...SCH.R_DVCC3} resistance="0ohm" footprint="0402" pcbX={10} pcbY={-15} />
    <capacitor name="C_TARGET_AVCC" {...SCH.C_TARGET_AVCC} capacitance="100nF" maxDecouplingTraceLength="80mm" footprint="0402" pcbX={-10} pcbY={-19} />
    <resistor name="R_AVCC" {...SCH.R_AVCC} resistance="0ohm" footprint="0402" pcbX={-10} pcbY={-22} />
    <SC_32S32_768kHz20PPM12_5pF name="Y_LF" {...SCH.Y_LF} pcbX={-5} pcbY={-24} />
    <capacitor name="C_LFXIN" {...SCH.C_LFXIN} capacitance="22pF" footprint="0402" pcbX={-8.5} pcbY={-24} />
    <capacitor name="C_LFXOUT" {...SCH.C_LFXOUT} capacitance="22pF" footprint="0402" pcbX={-5} pcbY={-27} />
    <CSTCR4M00G53_R0 name="Y_HF" {...SCH.Y_HF} pcbX={3} pcbY={-25} pcbRotation={90} pinAttributes={{ GND: { requiresGround: true } }} />
    <TS342A2P_WZ name="SW1" {...SCH.SW1} pcbX={-13} pcbY={-29} />
    <TS342A2P_WZ name="SW2" {...SCH.SW2} pcbX={-13} pcbY={-35} />
    <TS342A2P_WZ name="SW_RESET" {...SCH.SW_RESET} pcbX={13} pcbY={-27.5} />
    <resistor name="R_TARGET_RST" {...SCH.R_TARGET_RST} resistance="47kohm" footprint="0402" pcbX={13} pcbY={-6} />
    <capacitor name="C_TARGET_RST" {...SCH.C_TARGET_RST} capacitance="1nF" footprint="0402" pcbX={13} pcbY={-3} />
    <resistor name="R_LED1" {...SCH.R_LED1} resistance="470ohm" footprint="0603" pcbX={10.5} pcbY={-18} />
    <led name="LED1" {...SCH.LED1} color="red" footprint="0603" pcbX={13.5} pcbY={-18} />
    <resistor name="R_LED2" {...SCH.R_LED2} resistance="390ohm" footprint="0603" pcbX={10.5} pcbY={-21} />
    <led name="LED2" {...SCH.LED2} color="green" footprint="0603" pcbX={13.5} pcbY={-21} />

    <pinheader
      name="J1"
      {...SCH.J1}
      pinCount={10}
      gender="female"
      pitch="2.54mm"
      footprint="pinrow10_p2.54mm"
      pinLabels={["VCC", "P1_2_A2", "P6_1_UART_RX", "P6_0_UART_TX", "P6_2_IO", "P1_3_A3", "P5_2_SPI_CLK", "P6_3_IO", "P7_1_I2C_SCL", "P7_0_I2C_SDA"]}
      schPinArrangement={{ leftSide: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }}
      showSilkscreenPinLabels={true}
      pcbX={-23}
      pcbY={-14}
      pcbRotation={90}
    />
    <pinheader
      name="J3"
      {...SCH.J3}
      pinCount={10}
      gender="female"
      pitch="2.54mm"
      footprint="pinrow10_p2.54mm"
      pinLabels={["VBUS_5V", "GND", "P3_0_A12", "P3_1_A13", "P3_2_A14", "P3_3_A15", "P3_4_PWM", "P1_5_A5", "P4_7_IO", "P8_0_IO"]}
      schPinArrangement={{ leftSide: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }}
      showSilkscreenPinLabels={true}
      pcbX={-18}
      pcbY={-14}
      pcbRotation={90}
    />
    <pinheader
      name="J4"
      {...SCH.J4}
      pinCount={10}
      gender="female"
      pitch="2.54mm"
      footprint="pinrow10_p2.54mm"
      pinLabels={["P3_7_PWM", "P3_6_PWM", "P3_5_PWM", "P3_4_PWM", "P7_3_CAPTURE", "P2_6_CAPTURE", "P2_5_IO", "P4_3_IO", "P4_2_IO", "P4_1_IO"]}
      schPinArrangement={{ rightSide: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }}
      showSilkscreenPinLabels={true}
      pcbX={23}
      pcbY={-14}
      pcbRotation={90}
    />
    <pinheader
      name="J2"
      {...SCH.J2}
      pinCount={10}
      gender="female"
      pitch="2.54mm"
      footprint="pinrow10_p2.54mm"
      pinLabels={["GND", "P5_7_PWM", "P4_4_IO", "P5_3_IO", "RST", "P5_0_SPI_MOSI", "P5_1_SPI_MISO", "P8_3_SPI_CS", "P8_2_SPI_CS", "P8_1_IO"]}
      schPinArrangement={{ rightSide: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }}
      showSilkscreenPinLabels={true}
      pcbX={18}
      pcbY={-14}
      pcbRotation={90}
    />

    <pinheader
      name="J_PWRSEL"
      {...SCH.J_PWRSEL}
      pinCount={3}
      gender="male"
      pitch="2.54mm"
      footprint="pinrow3_p2.54mm"
      pinLabels={["DEBUG", "TARGET", "EXTERNAL"]}
      showSilkscreenPinLabels={true}
      pcbX={-8}
      pcbY={3.5}
    />
    <Link name="J_CURRENT" pcbX={-3} pcbY={3.5} {...SCH.J_CURRENT} />
    <pinheader
      name="J_EXT"
      {...SCH.J_EXT}
      pinCount={2}
      gender="male"
      pitch="2.54mm"
      footprint="pinrow2_p2.54mm"
      pinLabels={["VCC", "GND"]}
      showSilkscreenPinLabels={true}
      pcbX={3}
      pcbY={3.5}
    />
    <pinheader name="J_EXT_3V3" {...SCH.J_EXT_3V3} pinCount={3} gender="male" pitch="2.54mm" footprint="pinrow3_p2.54mm" pinLabels={["VCC", "GND1", "GND2"]} pcbX={20} pcbY={34} />
    <pinheader name="J_EXT_5V" {...SCH.J_EXT_5V} pinCount={3} gender="male" pitch="2.54mm" footprint="pinrow3_p2.54mm" pinLabels={["VBUS", "GND1", "GND2"]} pcbX={20} pcbY={26} />
    <MicroSdSocket name="J_SD" {...SCH.J_SD} layer="bottom" pcbX={0} pcbY={-33} noConnect={["DAT2", "DAT1"]} />
    <capacitor name="C_SD_BULK" {...SCH.C_SD_BULK} capacitance="1uF" footprint="0603" layer="bottom" pcbX={9.5} pcbY={-28.5} />
    <capacitor name="C_SD_DECOUPLE" {...SCH.C_SD_DECOUPLE} capacitance="100nF" footprint="0402" layer="bottom" pcbX={9.5} pcbY={-31} />
    <resistor name="R_SD_DETECT" {...SCH.R_SD_DETECT} resistance="100kohm" footprint="0402" layer="bottom" pcbX={9.5} pcbY={-37} />
    <resistor name="R_CAP_CHARGE" {...SCH.R_CAP_CHARGE} resistance="22ohm" footprint="0603" pcbX={7.5} pcbY={-28.5} />
    <pinheader
      name="J_CAP_MODE"
      {...SCH.J_CAP_MODE}
      pinCount={3}
      gender="male"
      pitch="2.54mm"
      footprint="pinrow3_p2.54mm"
      pinLabels={["USE", "CAP", "CHARGE"]}
      showSilkscreenPinLabels={true}
      pcbX={12}
      pcbY={-33}
    />
    <SuperCap name="C_SUPER" {...SCH.C_SUPER} pcbX={18} pcbY={-35} />

    <trace from="J_USB.VBUS" to="net.VBUS_USB" thickness="0.3mm" />
    <trace from="J_USB.GND" to="net.GND" thickness="0.3mm" />
    <trace from="J_USB.SH1" to="net.USB_SHIELD" />
    <trace from="J_USB.SH2" to="net.USB_SHIELD" />
    <trace from="J_USB.SH3" to="net.USB_SHIELD" />
    <trace from="J_USB.SH4" to="net.USB_SHIELD" />
    <trace from="R_SHIELD.pin1" to="net.USB_SHIELD" />
    <trace from="R_SHIELD.pin2" to="net.GND" />
    <trace from="C_SHIELD.pin1" to="net.USB_SHIELD" />
    <trace from="C_SHIELD.pin2" to="net.GND" />
    <trace from="J_USB.D_NEG" to="U_ESD.DM_CONNECTOR" thickness="0.22mm" />
    <trace from="J_USB.D_POS" to="U_ESD.DP_CONNECTOR" thickness="0.22mm" />
    <trace from="U_ESD.DM_MCU" to="R_USB_DM.pin1" thickness="0.22mm" />
    <trace from="U_ESD.DP_MCU" to="R_USB_DP.pin1" thickness="0.22mm" />
    <trace from="U_ESD.VBUS" to="net.VBUS_USB" thickness="0.3mm" />
    <trace from="U_ESD.GND" to="net.GND" />
    <trace from="R_USB_DM.pin2" to="U_DBG.USB_DM" thickness="0.22mm" />
    <trace from="R_USB_DP.pin2" to="U_DBG.USB_DP" thickness="0.22mm" />
    <trace from="U_DBG.PUR" to="R_USB_PUR.pin1" />
    <trace from="R_USB_PUR.pin2" to="net.EZ_3V3" />
    <trace from="U_DBG.VBUS" to="net.VBUS_USB" thickness="0.3mm" pcbRouteHints={fanout(-5.8, 21.25)} />

    <trace from="U_LDO.IN" to="net.VBUS_USB" thickness="0.3mm" />
    <trace from="U_LDO.EN" to="R_LDO_EN.pin1" />
    <trace from="R_LDO_EN.pin2" to="net.VBUS_USB" />
    <trace from="U_LDO.GND" to="net.GND" thickness="0.3mm" />
    <trace from="U_LDO.OUT" to="net.EZ_3V3" thickness="0.3mm" />
    <trace from="C_LDO_IN.pin1" to="net.VBUS_USB" thickness="0.3mm" />
    <trace from="C_LDO_IN.pin2" to="net.GND" />
    <trace from="C_LDO_OUT.pin1" to="net.EZ_3V3" thickness="0.3mm" />
    <trace from="C_LDO_OUT.pin2" to="net.GND" />
    <trace from="R_PWR.pin1" to="net.EZ_3V3" />
    <trace from="R_PWR.pin2" to="LED_PWR.anode" />
    <trace from="LED_PWR.cathode" to="net.GND" />

    <trace from="U_DBG.AVCC1" to="net.EZ_3V3" thickness="0.3mm" />
    <trace from="U_DBG.DVCC1" to="net.EZ_3V3" thickness="0.3mm" />
    <trace from="U_DBG.DVCC2" to="net.EZ_3V3" thickness="0.3mm" />
    <trace from="U_DBG.AVSS1" to="net.GND" />
    <trace from="U_DBG.DVSS1" to="net.GND" />
    <trace from="U_DBG.DVSS2" to="net.GND" />
    <trace from="U_DBG.AVSS2" to="net.GND" />
    <trace from="U_DBG.VSSU" to="net.GND" />
    <trace from="U_DBG.GND_EP" to="net.GND" thickness="0.3mm" />
    <trace from="U_DBG.VCORE" to="C_DBG_VCORE.pin1" />
    <trace from="C_DBG_VCORE.pin2" to="net.GND" />
    <trace from="U_DBG.VUSB" to="C_DBG_VUSB.pin1" />
    <trace from="C_DBG_VUSB.pin2" to="net.GND" />
    <trace from="U_DBG.V18" to="C_DBG_V18.pin1" />
    <trace from="C_DBG_V18.pin2" to="net.GND" />
    <trace from="C_DBG_AVCC.pin1" to="net.EZ_3V3" />
    <trace from="C_DBG_AVCC.pin2" to="net.GND" />
    <trace from="C_DBG_DVCC1.pin1" to="net.EZ_3V3" />
    <trace from="C_DBG_DVCC1.pin2" to="net.GND" />
    <trace from="C_DBG_DVCC2.pin1" to="net.EZ_3V3" />
    <trace from="C_DBG_DVCC2.pin2" to="net.GND" />
    <trace from="C_DBG_BULK.pin1" to="net.EZ_3V3" thickness="0.3mm" />
    <trace from="C_DBG_BULK.pin2" to="net.GND" />
    <trace from="U_DBG.RST" to="net.DBG_RST" />
    <trace from="R_DBG_RST.pin1" to="net.DBG_RST" />
    <trace from="R_DBG_RST.pin2" to="net.EZ_3V3" />
    <trace from="C_DBG_RST.pin1" to="net.DBG_RST" />
    <trace from="C_DBG_RST.pin2" to="net.GND" />
    <trace from="Y_DBG.pin1" to="U_DBG.XT2OUT" />
    <trace from="Y_DBG.pin3" to="U_DBG.XT2IN" />
    <trace from="Y_DBG.pin2" to="net.GND" />
    <trace from="U_DBG.LED0" to="R_DBG_RED.pin1" />
    <trace from="R_DBG_RED.pin2" to="LED_DBG_RED.anode" />
    <trace from="LED_DBG_RED.cathode" to="net.GND" />
    <trace from="U_DBG.LED1" to="R_DBG_GREEN.pin1" />
    <trace from="R_DBG_GREEN.pin2" to="LED_DBG_GREEN.anode" />
    <trace from="LED_DBG_GREEN.cathode" to="net.GND" />
    <trace from="J_DBG_PROG.pin1" to="U_DBG.TEST" />
    <trace from="J_DBG_PROG.pin2" to="U_DBG.TDO" />
    <trace from="J_DBG_PROG.pin3" to="U_DBG.TDI" />
    <trace from="J_DBG_PROG.pin4" to="U_DBG.TMS" />
    <trace from="J_DBG_PROG.pin5" to="U_DBG.TCK" />
    <trace from="J_DBG_PROG.pin6" to="net.DBG_RST" />
    <trace from="J_DBG_PROG.pin7" to="net.GND" />

    <trace from="U_DBG.TARGET_SBWTCK" to="J_ISO_TST.HOST" />
    <trace from="J_ISO_TST.TARGET" to="U_TARGET.TEST" pcbRouteHints={fanout(8.5, -10.75)} />
    <trace from="U_DBG.TARGET_SBWTDIO" to="J_ISO_RST.HOST" />
    <trace from="J_ISO_RST.TARGET" to="net.TARGET_RST" />
    <trace from="U_DBG.UART_TXD" to="J_ISO_RX.HOST" />
    <trace from="J_ISO_RX.TARGET" to="U_TARGET.P2_1" pcbRouteHints={fanout(4.25, -5.3)} />
    <trace from="U_DBG.UART_RXD" to="J_ISO_TX.HOST" />
    <trace from="J_ISO_TX.TARGET" to="U_TARGET.P2_0" pcbRouteHints={fanout(4.75, -5.9)} />
    <trace from="J_ISO_VCC.HOST" to="net.EZ_3V3" thickness="0.3mm" />
    <trace from="J_ISO_VCC.TARGET" to="net.TARGET_3V3" thickness="0.3mm" />
    <trace from="J_ISO_GND.HOST" to="net.GND" thickness="0.3mm" />
    <trace from="J_ISO_GND.TARGET" to="net.GND" thickness="0.3mm" />

    <trace from="U_TARGET.AVCC1" to="R_AVCC.pin1" thickness="0.3mm" />
    <trace from="R_AVCC.pin2" to="net.TARGET_VCC" thickness="0.3mm" />
    <trace from="U_TARGET.DVSS1" to="net.GND" thickness="0.3mm" />
    <trace from="U_TARGET.DVSS2" to="net.GND" thickness="0.3mm" />
    <trace from="U_TARGET.DVSS3" to="net.GND" thickness="0.3mm" />
    <trace from="U_TARGET.AVSS1" to="net.GND" />
    <trace from="U_TARGET.AVSS2" to="net.GND" />
    <trace from="U_TARGET.AVSS3" to="net.GND" />
    <trace from="C_TARGET_BULK.pin1" to="net.TARGET_VCC" thickness="0.3mm" />
    <trace from="C_TARGET_BULK.pin2" to="net.GND" />
    <trace from="C_TARGET_DVCC1.pin1" to="U_TARGET.DVCC1" />
    <trace from="C_TARGET_DVCC1.pin2" to="net.GND" />
    <trace from="R_DVCC1.pin1" to="U_TARGET.DVCC1" />
    <trace from="R_DVCC1.pin2" to="net.TARGET_VCC" thickness="0.3mm" />
    <trace from="C_TARGET_DVCC2.pin1" to="U_TARGET.DVCC2" />
    <trace from="C_TARGET_DVCC2.pin2" to="net.GND" />
    <trace from="R_DVCC2.pin1" to="U_TARGET.DVCC2" />
    <trace from="R_DVCC2.pin2" to="net.TARGET_VCC" thickness="0.3mm" />
    <trace from="C_TARGET_DVCC3.pin1" to="U_TARGET.DVCC3" />
    <trace from="C_TARGET_DVCC3.pin2" to="net.GND" />
    <trace from="R_DVCC3.pin1" to="U_TARGET.DVCC3" />
    <trace from="R_DVCC3.pin2" to="net.TARGET_VCC" thickness="0.3mm" />
    <trace from="C_TARGET_AVCC.pin1" to="U_TARGET.AVCC1" />
    <trace from="C_TARGET_AVCC.pin2" to="net.GND" />
    <trace from="U_TARGET.PJ_4" to="Y_LF.pin1" />
    <trace from="Y_LF.pin1" to="C_LFXIN.pin1" />
    <trace from="C_LFXIN.pin2" to="net.GND" />
    <trace from="U_TARGET.PJ_5" to="Y_LF.pin2" />
    <trace from="Y_LF.pin2" to="C_LFXOUT.pin1" />
    <trace from="C_LFXOUT.pin2" to="net.GND" />
    <trace from="U_TARGET.PJ_6" to="Y_HF.pin1" />
    <trace from="U_TARGET.PJ_7" to="Y_HF.pin3" />
    <trace from="Y_HF.pin2" to="net.GND" />
    <trace from="U_TARGET.P5_6" to="SW1.pin1" schDisplayLabel="S1 / P5.6" pcbRouteHints={fanout(-9, -12.25)} />
    <trace from="SW1.pin2" to="net.GND" />
    <trace from="U_TARGET.P5_5" to="SW2.pin1" schDisplayLabel="S2 / P5.5" pcbRouteHints={fanout(-8.4, -11.75)} />
    <trace from="SW2.pin2" to="net.GND" />
    <trace from="U_TARGET.P1_0" to="R_LED1.pin1" schDisplayLabel="LED1 / P1.0" pcbRouteHints={fanout(-4.75, -22.3)} />
    <trace from="R_LED1.pin2" to="LED1.anode" />
    <trace from="LED1.cathode" to="net.GND" />
    <trace from="U_TARGET.P1_1" to="R_LED2.pin1" schDisplayLabel="LED2 / P1.1" pcbRouteHints={fanout(-4.25, -22.9)} />
    <trace from="R_LED2.pin2" to="LED2.anode" />
    <trace from="LED2.cathode" to="net.GND" />

    <trace from="J1.pin1" to="net.TARGET_VCC" thickness="0.3mm" />
    <trace from="J1.pin2" to="U_TARGET.P1_2" pcbRouteHints={fanout(-3.75, -22.3)} />
    <trace from="J1.pin3" to="U_TARGET.P6_1" pcbRouteHints={fanout(-0.75, -22.3)} />
    <trace from="J1.pin4" to="U_TARGET.P6_0" pcbRouteHints={fanout(-1.25, -22.9)} />
    <trace from="J1.pin5" to="U_TARGET.P6_2" pcbRouteHints={fanout(-0.25, -22.9)} />
    <trace from="J1.pin6" to="U_TARGET.P1_3" pcbRouteHints={fanout(2.75, -22.9)} />
    <trace from="J1.pin7" to="U_TARGET.P5_2" pcbRouteHints={fanout(-2.25, -5.9)} />
    <trace from="J1.pin8" to="U_TARGET.P6_3" pcbRouteHints={fanout(0.25, -22.3)} />
    <trace from="J1.pin9" to="U_TARGET.P7_1" pcbRouteHints={fanout(1.75, -22.9)} />
    <trace from="J1.pin10" to="U_TARGET.P7_0" pcbRouteHints={fanout(1.25, -22.3)} />
    <trace from="J3.pin1" to="net.VBUS_USB" thickness="0.3mm" />
    <trace from="J3.pin2" to="net.GND" thickness="0.3mm" />
    <trace from="J3.pin3" to="U_TARGET.P3_0" pcbRouteHints={fanout(-3.25, -22.9)} />
    <trace from="J3.pin4" to="U_TARGET.P3_1" pcbRouteHints={fanout(-2.75, -22.3)} />
    <trace from="J3.pin5" to="U_TARGET.P3_2" pcbRouteHints={fanout(-2.25, -22.9)} />
    <trace from="J3.pin6" to="U_TARGET.P3_3" pcbRouteHints={fanout(-1.75, -22.3)} />
    <trace from="J3.pin7" to="U_TARGET.P3_4" pcbRouteHints={fanout(1.75, -5.3)} />
    <trace from="J3.pin8" to="U_TARGET.P1_5" pcbRouteHints={fanout(3.75, -22.3)} />
    <trace from="J3.pin9" to="U_TARGET.P4_7" pcbRouteHints={fanout(0.75, -22.9)} />
    <trace from="J3.pin10" to="U_TARGET.P8_0" pcbRouteHints={fanout(2.25, -22.3)} />
    <trace from="J4.pin1" to="U_TARGET.P3_7" pcbRouteHints={fanout(0.25, -5.9)} />
    <trace from="J4.pin2" to="U_TARGET.P3_6" pcbRouteHints={fanout(0.75, -5.3)} />
    <trace from="J4.pin3" to="U_TARGET.P3_5" pcbRouteHints={fanout(1.25, -5.9)} />
    <trace from="J4.pin4" to="U_TARGET.P3_4" />
    <trace from="J4.pin5" to="U_TARGET.P7_3" pcbRouteHints={fanout(8.4, -15.75)} />
    <trace from="J4.pin6" to="U_TARGET.P2_6" pcbRouteHints={fanout(8.9, -13.75)} />
    <trace from="J4.pin7" to="U_TARGET.P2_5" pcbRouteHints={fanout(8.4, -13.25)} />
    <trace from="J4.pin8" to="U_TARGET.P4_3" pcbRouteHints={fanout(8.9, -12.25)} />
    <trace from="J4.pin9" to="U_TARGET.P4_2" pcbRouteHints={fanout(8.4, -11.75)} />
    <trace from="J4.pin10" to="U_TARGET.P4_1" pcbRouteHints={fanout(8.9, -11.25)} />
    <trace from="J2.pin1" to="net.GND" thickness="0.3mm" />
    <trace from="J2.pin2" to="U_TARGET.P5_7" pcbRouteHints={fanout(-8.4, -12.75)} />
    <trace from="J2.pin3" to="U_TARGET.P4_4" pcbRouteHints={fanout(-3.25, -5.3)} />
    <trace from="J2.pin4" to="U_TARGET.P5_3" pcbRouteHints={fanout(-2.75, -5.3)} />
    <trace from="J2.pin5" to="net.TARGET_RST" />
    <trace from="J2.pin6" to="U_TARGET.P5_0" pcbRouteHints={fanout(-1.25, -5.9)} />
    <trace from="J2.pin7" to="U_TARGET.P5_1" pcbRouteHints={fanout(-1.75, -5.3)} />
    <trace from="J2.pin8" to="U_TARGET.P8_3" pcbRouteHints={fanout(2.25, -5.9)} />
    <trace from="J2.pin9" to="U_TARGET.P8_2" pcbRouteHints={fanout(2.75, -5.3)} />
    <trace from="J2.pin10" to="U_TARGET.P8_1" pcbRouteHints={fanout(3.25, -5.9)} />

    <trace from="U_TARGET.RST" to="net.TARGET_RST" />
    <trace from="R_TARGET_RST.pin1" to="net.TARGET_RST" />
    <trace from="R_TARGET_RST.pin2" to="net.TARGET_VCC" />
    <trace from="C_TARGET_RST.pin1" to="net.TARGET_RST" />
    <trace from="C_TARGET_RST.pin2" to="net.GND" />
    <trace from="SW_RESET.pin1" to="net.TARGET_RST" />
    <trace from="SW_RESET.pin2" to="net.GND" />
    <trace from="J_PWRSEL.pin1" to="net.EZ_3V3" thickness="0.3mm" />
    <trace from="J_PWRSEL.pin2" to="net.TARGET_3V3" thickness="0.3mm" />
    <trace from="J_PWRSEL.pin3" to="net.EXT_3V3" thickness="0.3mm" />
    <trace from="J_CURRENT.HOST" to="net.TARGET_3V3" thickness="0.3mm" />
    <trace from="J_CURRENT.TARGET" to="net.TARGET_VCC" thickness="0.3mm" />
    <trace from="J_EXT.pin1" to="net.EXT_3V3" thickness="0.3mm" />
    <trace from="J_EXT.pin2" to="net.GND" thickness="0.3mm" />
    <trace from="J_EXT_3V3.pin1" to="net.TARGET_VCC" thickness="0.3mm" />
    <trace from="J_EXT_3V3.pin2" to="net.GND" />
    <trace from="J_EXT_3V3.pin3" to="net.GND" />
    <trace from="J_EXT_5V.pin1" to="net.VBUS_USB" thickness="0.3mm" />
    <trace from="J_EXT_5V.pin2" to="net.GND" />
    <trace from="J_EXT_5V.pin3" to="net.GND" />

    <trace from="J_SD.DAT3_CS" to="U_TARGET.P4_0" pcbRouteHints={fanout(8.4, -10.75)} />
    <trace from="J_SD.CMD_MOSI" to="U_TARGET.P1_6" pcbRouteHints={fanout(-0.25, -5.3)} />
    <trace from="J_SD.VDD" to="net.TARGET_VCC" thickness="0.3mm" />
    <trace from="J_SD.CLK" to="U_TARGET.P2_2" pcbRouteHints={fanout(3.75, -5.3)} />
    <trace from="J_SD.VSS" to="net.GND" thickness="0.3mm" />
    <trace from="J_SD.SHELL1" to="net.GND" thickness="0.3mm" />
    <trace from="J_SD.SHELL2" to="net.GND" thickness="0.3mm" />
    <trace from="J_SD.SHELL3" to="net.GND" thickness="0.3mm" />
    <trace from="J_SD.SHELL4" to="net.GND" thickness="0.3mm" />
    <trace from="J_SD.DAT0_MISO" to="U_TARGET.P1_7" pcbRouteHints={fanout(-0.75, -5.9)} />
    <trace from="J_SD.DETECT" to="U_TARGET.P7_2" pcbRouteHints={fanout(8.9, -16.25)} />
    <trace from="C_SD_BULK.pin1" to="net.TARGET_VCC" />
    <trace from="C_SD_BULK.pin2" to="net.GND" />
    <trace from="C_SD_DECOUPLE.pin1" to="net.TARGET_VCC" />
    <trace from="C_SD_DECOUPLE.pin2" to="net.GND" />
    <trace from="R_SD_DETECT.pin1" to="net.TARGET_VCC" />
    <trace from="R_SD_DETECT.pin2" to="J_SD.DETECT" />

    <trace from="R_CAP_CHARGE.pin1" to="net.TARGET_3V3" />
    <trace from="R_CAP_CHARGE.pin2" to="J_CAP_MODE.pin3" />
    <trace from="J_CAP_MODE.pin2" to="net.SUPERCAP_POS" />
    <trace from="J_CAP_MODE.pin1" to="net.TARGET_VCC" />
    <trace from="C_SUPER.pin1" to="net.SUPERCAP_POS" thickness="0.3mm" />
    <trace from="C_SUPER.pin2" to="net.GND" thickness="0.3mm" />

    <copperpour name="GND_INNER1" connectsTo="net.GND" layer="inner1" clearance="0.18mm" boardEdgeMargin="0.25mm" />
  </board>
)