ShiboSoftwareDev/am69-cm5

A 55×40 mm 10-layer CM5 carrier board integrating an AM69A98 SoC, 8‑GiB LPDDR4, 32‑GB eMMC, CM5 connectors, clocking, extensive decoupling/EMI filtering, and HDI DDR/ground escape routing.

Version
0.0.7-engineering-draft-20261107-manual-ddr0
License
unset
Stars
0

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone ShiboSoftwareDev/am69-cm5  # download the package files into ./am69-cm5
tsci add ShiboSoftwareDev/am69-cm5    # add it to your project as @tsci/ShiboSoftwareDev.am69-cm5

In a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.

components/shared/control/BootController.tsx

import { STM32G031K6U6 } from "./STM32G031K6U6"
import { mainBootBalls, mcuBootBalls, physicalBootNet } from "./BootConfiguration"
import type { ReferencePowerPlacement } from "../power-stages/ReferencePowerStages"
import {controlResistor0402,controlCapacitor0402} from "../power/ControlPassiveParts"

const controlled = [
  { ball: "H38", net: "net.EC_MCU_BOOT3_OD" },
  { ball: "J34", net: "net.EC_MCU_BOOT4_OD" },
  { ball: "J35", net: "net.EC_BOOT5_PATH" },
  { ball: "M37", net: "net.EC_MAIN_BOOT4_PATH" },
  { ball: "N34", net: "net.EC_MAIN_BOOT6_OD" },
]
export const bootControllerParts = [
  { reference: "U1200", kind: "STM32G031K6U6" },
  ...Array.from({ length: 18 }, (_, i) => ({ reference: `R${1220+i}`, kind: "resistor" })),
  ...Array.from({ length: 5 }, (_, i) => ({ reference: `R${1200+i}`, kind: "resistor" })),
  ...[1240,1241,1242,1243,1244,1245].map(i => ({ reference: `R${i}`, kind: "resistor" })),
  ...[1200,1201,1202,1203].map(i => ({ reference: `C${i}`, kind: "capacitor" })),
  ...Array.from({length:6},(_,i)=>({reference:`TP${1200+i}`,kind:"testpoint"})),
]

/**
 * Always-on controller. Boot GPIOs are OPEN DRAIN with pullups on the CPU's
 * switched domain, and must release after POR sampling before HAT isolation is
 * enabled. The 1.8 V PMIC reset is read by ADC through 10k, not a 3.3 V digital
 * input. Matching firmware owns the run request and long-press/off policy.
 */
export function BootController({ placements = {}, references, cpuConnections = {}, board }: {
  placements?: Partial<Record<string, ReferencePowerPlacement>>
  references?: readonly string[]
  cpuConnections?: Record<string, string>
  board: "cm5" | "pi5"
}) {
  const wanted = (name: string) => !references || references.includes(name)
  const p = (name: string) => placements[name] ?? {}
  const straps = [
    ...mcuBootBalls.map((ball, i) => ({ ball, rail: i >= 3 && i <= 5 || i >= 8 ? "net.V_3V3" : "net.GND" })),
    ...mainBootBalls.map((ball, i) => ({ ball, rail: i <= 1 ? "net.VDD_IO_1V8" : [4,6].includes(i) ? "net.V_3V3" : "net.GND" })),
  ]
  const r = (name: string, resistance: string, a: string, b: string) => wanted(name) && <resistor key={name}
    name={name} resistance={resistance} manufacturerPartNumber={controlResistor0402[resistance]} footprint="0402" {...p(name)} connections={{ pin1: a, pin2: b }} />
  return <>
    {[
      ["TP1200","AON 3V3","net.V3V3_AON_INTERFACE"], ["TP1201","GND","net.GND"],
      ["TP1202","SWDIO","net.EC_SWDIO"], ["TP1203","SWCLK","net.EC_SWCLK"],
      ["TP1204","NRST","net.EC_RESET_N"], ["TP1205","USB RECOVERY",board==="cm5"?"net.CM5_nRPIBOOT":"net.FORCE_USB_BOOT_N"],
    ].filter(([name])=>wanted(name)).map(([name,displayName,net])=><testpoint key={name}
      name={name} displayName={displayName} footprintVariant="pad" padShape="circle" padDiameter={1}
      cadModel={null} doNotPlace {...p(name)} footprint={<footprint>
        <smtpad portHints={["pin1"]} shape="circle" radius={.5} pcbX={0} pcbY={0}
          noSolderPaste solderMaskMargin={.05} />
        <courtyardrect width={1.3} height={1.3} />
      </footprint>} connections={{pin1:net}} />)}
    {wanted("U1200") && <STM32G031K6U6 name="U1200" {...p("U1200")}
      noConnect={["PA8","PA9","PC6","PA10","PA15","PB4",...(board==="cm5"?["PC14","PB1","PB2","PB3","PB5","PB8"]:[])]}
      connections={{
      PB7: "net.EC_FAN_PWM_INTERNAL", PB9: "net.EC_FAN_TACH_3V3",
      PC15: "net.SD_CARD_DETECT_N", VDD_VDDA: "net.V3V3_AON_INTERFACE", VSS_VSSA: "net.GND", EP_GND:"net.GND", NRST: "net.EC_RESET_N",
      PA0: "net.EC_MCU_BOOT3_DRIVE", PA1: "net.EC_MCU_BOOT4_DRIVE", PA2: "net.EC_SHARED_PA2",
      PA3: "net.EC_SHARED_PA3", PA4: "net.EC_MAIN_BOOT6_DRIVE", PA5: "net.EC_RUN_REQUEST",
      PA6: "net.PWR_BUTTON_N_3V3", PA7: "net.EC_PORZ_ADC", PB0: "net.CARRIER_RUN_REQUEST",
      PA11: "net.EC_FORCE_USB_N", PA12: "net.EC_HOST_KEY_IRQ_N", PA13: "net.EC_SWDIO",
      PA14_BOOT0: "net.EC_SWCLK", PB6: "net.EC_HOST_POWER_OFF",
      ...(board==="pi5"?{PB8:"net.PD_SCL",PB3:"net.PD_SDA",PB1:"net.PD_VBUS_EN_N",PB2:"net.PD_ALERT_N",PB5:"net.PD_RESET",PC14:"net.PD_POWER_ALLOWED"}:{}),
    }} />}
    {straps.map(({ball,rail}, i) => r(`R${1220+i}`, "10k", physicalBootNet(ball,cpuConnections), rail))}
    {controlled.map(({ball,net}, i) => r(`R${1200+i}`, "1k", net, physicalBootNet(ball,cpuConnections)))}
    {r("R1240", "10k", "net.EC_RESET_N", "net.V3V3_AON_INTERFACE")}
    {r("R1241", "10k", "net.H_MCU_PORz", "net.EC_PORZ_ADC")}
    {r("R1242", "100k", "net.EC_HOST_POWER_OFF", "net.GND")}
    {r("R1243", "10k", "net.EC_HOST_KEY_IRQ_N", "net.V3V3_INTERFACE")}
    {r("R1244", "10k", "net.SD_CARD_DETECT_N", "net.V3V3_AON_INTERFACE")}
    {r("R1245", "10k", "net.EC_FORCE_USB_N", "net.V3V3_AON_INTERFACE")}
    {[
      ["C1200","100nF","net.V3V3_AON_INTERFACE"], ["C1201","1uF","net.V3V3_AON_INTERFACE"],
      ["C1202","100nF","net.EC_RESET_N"], ["C1203","1nF","net.EC_PORZ_ADC"],
    ].filter(([name])=>wanted(name)).map(([name,capacitance,rail])=><capacitor key={name} name={name}
      capacitance={capacitance} {...controlCapacitor0402(capacitance)} footprint="0402" schRotation={-90} {...p(name)}
      connections={{ pin1:rail, pin2:"net.GND" }} />)}
  </>
}