abse/am3354-cm4-module
A six-layer AM3354-based compute module with DDR3L, dual 100-pin CM4 connectors, PMIC/buck power regulation, clocks, boot/pull-up support, USB/SD/GPIO interfaces, dense decoupling, and fully routed/verified multilayer copper.
- Version
- 0.1.4
- License
- unset
- Stars
- 0
Use with the tscircuit CLI
tsci is the tscircuit CLI. Install it with npm install -g tscircuit.
tsci clone abse/am3354-cm4-module # download the package files into ./am3354-cm4-module
tsci add abse/am3354-cm4-module # add it to your project as @tsci/abse.am3354-cm4-moduleIn 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.
source/design/netlist.ts
// The CM4 module's circuit beyond the routed DDR block: CM4 connector pin map, processor pin assignment,
// power (TPS65217D + two SY8089 bucks), boot straps, pull-ups. No Ethernet: networking is over USB0.
// Sources: CM4 datasheet (pin table, section 2), AM3354 datasheet SPRS717 (ball/mux table), AM335x TRM SPRUH73
// Table 26-7 (SYSBOOT), TPS65217 datasheet SLVSB64I (pins, section 9.2.2.2 case 2: 5 V on AC, no battery),
/** CM4 connector pin -> module net ("" = not connected). Pins 1-100 on J1, 101-200 on J2. */
export const CM4: Record<number, string> = {}
const GND = [1, 2, 7, 8, 13, 14, 22, 23, 32, 33, 42, 43, 52, 53, 59, 60, 65, 66, 71, 74, 98, 107, 108, 113, 114, 119, 120, 125, 126, 131, 132, 137, 138, 144, 150, 155, 156, 161, 162, 167, 168, 173, 174, 179, 180, 185, 186, 191, 192, 197, 198]
for (let p = 1; p <= 200; p++) CM4[p] = ""
for (const p of GND) CM4[p] = "GND"
for (const p of [77, 79, 81, 83, 85, 87]) CM4[p] = "VIN5"
for (const p of [84, 86]) CM4[p] = "VDD_3V3"
for (const p of [88, 90]) CM4[p] = "VDD_1V8"
/** signals: net -> processor ball, pinmux mode, CM4 pin (if any), what it is */
export type Sig = { net: string; ball: string; mode: number; fn: string; cm4?: number }
export const SIGNALS: Sig[] = [
// 40-pin header functions (Raspberry Pi numbering) on the processor's matching peripherals
{ net: "GPIO2_SDA1", ball: "D18", mode: 3, fn: "I2C2_SDA", cm4: 58 },
{ net: "GPIO3_SCL1", ball: "D17", mode: 3, fn: "I2C2_SCL", cm4: 56 },
{ net: "ID_SD", ball: "E18", mode: 3, fn: "I2C1_SDA (UART0_CTSn pad)", cm4: 36 },
{ net: "ID_SC", ball: "E17", mode: 3, fn: "I2C1_SCL (UART0_RTSn pad)", cm4: 35 },
{ net: "GPIO14_TXD", ball: "E16", mode: 0, fn: "UART0_TXD (boot console)", cm4: 55 },
{ net: "GPIO15_RXD", ball: "E15", mode: 0, fn: "UART0_RXD (boot console)", cm4: 51 },
{ net: "GPIO11_SCLK", ball: "A17", mode: 0, fn: "SPI0_SCLK", cm4: 38 },
{ net: "GPIO10_MOSI", ball: "B16", mode: 0, fn: "SPI0_D1", cm4: 44 },
{ net: "GPIO9_MISO", ball: "B17", mode: 0, fn: "SPI0_D0", cm4: 40 },
{ net: "GPIO8_CE0", ball: "A16", mode: 0, fn: "SPI0_CS0", cm4: 39 },
{ net: "GPIO7_CE1", ball: "C15", mode: 0, fn: "SPI0_CS1", cm4: 37 },
{ net: "GPIO18_PCM_CLK", ball: "A13", mode: 0, fn: "MCASP0_ACLKX", cm4: 49 },
{ net: "GPIO19_PCM_FS", ball: "B13", mode: 0, fn: "MCASP0_FSX", cm4: 26 },
{ net: "GPIO20_PCM_DIN", ball: "B12", mode: 2, fn: "MCASP0_AXR2 (MCASP0_ACLKR pad)", cm4: 27 },
{ net: "GPIO21_PCM_DOUT", ball: "A14", mode: 2, fn: "MCASP0_AXR3 (MCASP0_AHCLKX pad)", cm4: 25 },
{ net: "GPIO12_PWM0", ball: "U14", mode: 6, fn: "EHRPWM1A", cm4: 31 },
{ net: "GPIO13_PWM1", ball: "T14", mode: 6, fn: "EHRPWM1B", cm4: 28 },
// SD card on the carrier (CM4 Lite pins), MMC0, the boot device
{ net: "SD_CLK", ball: "G17", mode: 0, fn: "MMC0_CLK", cm4: 57 },
{ net: "SD_CMD", ball: "G18", mode: 0, fn: "MMC0_CMD", cm4: 62 },
{ net: "SD_DAT0", ball: "G16", mode: 0, fn: "MMC0_DAT0", cm4: 63 },
{ net: "SD_DAT1", ball: "G15", mode: 0, fn: "MMC0_DAT1", cm4: 67 },
{ net: "SD_DAT2", ball: "F18", mode: 0, fn: "MMC0_DAT2", cm4: 69 },
{ net: "SD_DAT3", ball: "F17", mode: 0, fn: "MMC0_DAT3", cm4: 61 },
// I2C0: PMIC, and the CM4's SDA0/SCL0 carrier bus
{ net: "I2C0_SDA", ball: "C17", mode: 0, fn: "I2C0_SDA", cm4: 82 },
{ net: "I2C0_SCL", ball: "C16", mode: 0, fn: "I2C0_SCL", cm4: 80 },
// USB 2.0 OTG
{ net: "USB0_DP", ball: "N17", mode: 0, fn: "USB0_DP", cm4: 105 },
{ net: "USB0_DM", ball: "N18", mode: 0, fn: "USB0_DM", cm4: 103 },
// USB0_ID (P16) is left open: it is rated 2.1 V max while CM4 USB_OTG_ID (pin 101) is a 3.3 V signal. The role is set in
// software (USB mode register / Linux dr_mode); pin 101 is read on a 3.3 V GPIO instead (USB_OTG_ID below).
{ net: "USB0_VBUS", ball: "P15", mode: 0, fn: "USB0_VBUS (from the module's 5 V through R_VBUS)" },
// reset and PMIC control
{ net: "PWRONRSTn", ball: "B15", mode: 0, fn: "power-on reset from PMIC PGOOD (1 kOhm); CM4 RUN_PG through Q_RUN_PG" },
{ net: "RTC_PWRONRSTn", ball: "B5", mode: 0, fn: "from PMIC LDO_PGOOD" },
{ net: "PMIC_POWER_EN", ball: "C6", mode: 0, fn: "to PMIC PWR_EN" },
{ net: "EXT_WAKEUP", ball: "C5", mode: 0, fn: "from PMIC nWAKEUP" },
{ net: "NMIn", ball: "B18", mode: 0, fn: "EXTINTn, from PMIC nINT" },
// boot straps: LCD_DATA[15:0] = SYSBOOT[15:0]
...Array.from({ length: 16 }, (_, i) => ({ net: `SYSBOOT${i}`, ball: ["R1", "R2", "R3", "R4", "T1", "T2", "T3", "T4", "U1", "U2", "U3", "U4", "V2", "V3", "V4", "T5"][i], mode: 0, fn: `LCD_DATA${i} (SYSBOOT${i}), strap` })),
]
/** plain GPIOs (mode 7): CM4 pins whose ball is chosen by plan.ts from POOL (shortest assignment) */
export const GPIO_PINS: Record<string, number> = {
GPIO4: 54, GPIO5: 34, GPIO6: 30, GPIO16: 29, GPIO17: 50, GPIO22: 46, GPIO23: 47, GPIO24: 45, GPIO25: 41, GPIO26: 24, GPIO27: 48,
LED_nACT: 21, LED_nPWR: 95, CAM_GPIO: 97, SD_PWR_ON: 75, nEXTRST: 100, USB_OTG_ID: 101,
}
/** GPIO-capable balls left free by the functions above (mode 7 = gpio) */
export const POOL = ["H18", "H17", "J15", "J16", "K17", "K16", "M16", "L15", "M17", "M18", "A15", "C12", "C13", "C18", "D14", "F15", "F16", "H16", "J17", "J18", "K15", "K18", "L16", "L17", "L18", "R13", "V14", "R14", "V15", "U15", "T15", "V16", "U16", "T16", "V17", "U18", "T13", "V12"]
/** a GPIO that is not a CM4 pin */
export const EXTRA_GPIO: string[] = []
for (const s of SIGNALS) if (s.cm4) CM4[s.cm4] = s.net
for (const [n, p] of Object.entries(GPIO_PINS)) CM4[p] = n
// No Ethernet on this module (networking over USB0): the CM4 Ethernet pins and LED pins are left unconnected.
Object.assign(CM4, { 92: "RUN_PG", 93: "nRPIBOOT", 99: "GLOBAL_EN" })
/** two-pin passives and ICs: ref -> part type, pin -> net */
export type Part = { ref: string; part: string; nets: Record<string, string>; note?: string }
export const PARTS: Part[] = []
const P = (ref: string, part: string, nets: Record<string, string>, note?: string) => PARTS.push({ ref, part, nets, note })
const two = (ref: string, part: string, a: string, b: string, note?: string) => P(ref, part, { pin1: a, pin2: b }, note)
// ---- TPS65217D (5 V on AC, battery pins tied and open, TS open; datasheet 9.2.2.2 case 2) ----
P("U_PMIC", "PMIC", {
pin1: "LDO2_OUT", pin2: "SYS", pin3: "VDDS_RTC", pin4: "PMIC_BAT", pin5: "PMIC_BAT", pin6: "PMIC_BAT", pin7: "SYS", pin8: "SYS", pin9: "PMIC_POWER_EN", pin10: "VIN5", pin11: "", pin12: "GND",
pin13: "EXT_WAKEUP", pin14: "", pin15: "", pin16: "", pin17: "", pin18: "VDDS_RTC", pin19: "VDDS_DDR", pin20: "LX1", pin21: "SYS", pin22: "SYS", pin23: "LX2", pin24: "VDD_MPU",
pin25: "PMIC_PB", pin26: "PMIC_PGOOD", pin27: "I2C0_SDA", pin28: "I2C0_SCL", pin29: "VDD_CORE", pin30: "GND", pin31: "LX3", pin32: "SYS", pin33: "", pin34: "", pin35: "", pin36: "",
pin37: "", pin38: "", pin39: "SYS", pin40: "LDO3_OUT", pin41: "GND", pin42: "SYS", pin43: "LDO4_OUT", pin44: "GLOBAL_EN", pin45: "NMIn", pin46: "RTC_PWRONRSTn", pin47: "PMIC_BYPASS", pin48: "PMIC_INTLDO", pin49: "GND",
}, "TPS65217D: DCDC1 1.35 V VDDS_DDR, DCDC2 1.1 V VDD_MPU, DCDC3 1.1 V VDD_CORE, LDO1 1.8 V VDDS_RTC; LDO3/LDO4 switch the 1.8 V/3.3 V bucks on in their sequence slots")
two("L_DCDC1", "IND", "LX1", "VDDS_DDR"); two("L_DCDC2", "IND", "LX2", "VDD_MPU"); two("L_DCDC3", "IND", "LX3", "VDD_CORE")
two("C_DCDC1", "C22U_0603", "VDDS_DDR", "GND"); two("C_DCDC2", "C22U_0603", "VDD_MPU", "GND"); two("C_DCDC3", "C22U_0603", "VDD_CORE", "GND")
two("C_SYS", "C22U_0805", "SYS", "GND"); two("C_VIN12", "C10U_0603", "SYS", "GND"); two("C_VIN3", "C10U_0603", "SYS", "GND"); two("C_VINLDO", "C4U7_0402", "SYS", "GND")
two("C_AC", "C4U7_0603", "VIN5", "GND"); two("C_LDO1", "C2U2_0402", "VDDS_RTC", "GND"); two("C_LDO2", "C2U2_0402", "LDO2_OUT", "GND")
two("C_LDO3", "C2U2_0402", "LDO3_OUT", "GND"); two("C_LDO4", "C2U2_0402", "LDO4_OUT", "GND")
two("C_INTLDO", "C100N_0402", "PMIC_INTLDO", "GND"); two("C_BYPASS", "C10U_0402", "PMIC_BYPASS", "GND")
two("R_PB", "R100K", "PMIC_PB", "SYS", "PB_IN high: no push-button (the AC input wakes the PMIC)")
two("R_GLOBAL_EN", "R100K", "GLOBAL_EN", "SYS", "nRESET pull-up; the carrier pulls GLOBAL_EN low to power off (CM4: 100 k to +5 V)")
two("R_WAKE", "R100K", "EXT_WAKEUP", "VDDS_RTC"); two("R_INT", "R10K", "NMIn", "VDD_3V3")
// CM4 RUN_PG (pin 92) is a 3.3 V signal with a 10 kOhm pull-up on a real CM4: high = running, the carrier pulls it low
// (through 220 Ohm) to reset. PWRONRSTn here is driven by the PMIC's PGOOD, which goes only to VIO (VDDS_RTC, 1.8 V).
// A bidirectional N-MOSFET level shifter (gate on 1.8 V, source on PWRONRSTn, drain on RUN_PG) gives the carrier the
// CM4's 3.3 V levels and passes its low through to PWRONRSTn. Si2302CDS: VGS(th) 0.40-0.85 V.
P("Q_RUN_PG", "NFET", { pin1: "VDDS_RTC", pin2: "PWRONRSTn", pin3: "RUN_PG" }, "RUN_PG level shifter")
two("R_RUN_PG", "R10K", "RUN_PG", "VDD_3V3", "RUN_PG pull-up (CM4: 10 kOhm to 3.3 V)")
two("R_PGOOD", "R1K", "PMIC_PGOOD", "PWRONRSTn", "lets the carrier pull RUN_PG low (CM4: through 220 ohm) against the push-pull PGOOD")
two("R_SDA0", "R2K2", "I2C0_SDA", "VDD_3V3"); two("R_SCL0", "R2K2", "I2C0_SCL", "VDD_3V3")
// ---- 3.3 V and 1.8 V bucks from 5 V, switched on by the PMIC's LDO4 / LDO3 outputs ----
for (const [b, en, out, rt, rb] of [["3V3", "LDO4_OUT", "VDD_3V3", "R100K", "R22K"], ["1V8", "LDO3_OUT", "VDD_1V8", "R200K", "R100K"]]) {
P(`U_${b}`, "BUCK", { pin1: en, pin2: "GND", pin3: `LX_${b}`, pin4: "VIN5", pin5: `FB_${b}` }, `SY8089A1AAC ${b}`)
two(`L_${b}`, "IND", `LX_${b}`, out); two(`C_IN_${b}`, "C10U_0603", "VIN5", "GND"); two(`C_OUT_${b}`, "C22U_0603", out, "GND")
two(`R_FBT_${b}`, rt, out, `FB_${b}`); two(`R_FBB_${b}`, rb, `FB_${b}`, "GND")
}
// ---- boot straps: SYSBOOT = 0x4017 (24 MHz; MMC0, SPI0, UART0, USB0); nRPIBOOT low clears bits 2 and 0: 10010b = NAND, NANDI2C, USB0, UART0 ----
const WORD = 0x4017
for (let i = 0; i < 16; i++) two(`R_SB${i}`, "R10K", `SYSBOOT${i}`, WORD & (1 << i) ? "VDD_3V3" : "GND")
two("R_RPB0", "R1K", "SYSBOOT0", "nRPIBOOT"); two("R_RPB2", "R1K", "SYSBOOT2", "nRPIBOOT")
// ---- pull-ups ----
for (const n of ["SD_CMD", "SD_DAT0", "SD_DAT1", "SD_DAT2", "SD_DAT3"]) two(`R_${n}`, "R10K", n, "VDD_3V3")
two("R_OTG_ID", "R10K", "USB_OTG_ID", "VDD_3V3", "CM4: USB_OTG_ID is pulled up on the module; the carrier grounds it for host mode")
two("R_SD_PWR_ON", "R10K", "SD_PWR_ON", "VDD_3V3", "CM4: pull-up so the carrier's SD power switch defaults to on")
two("R_SDA2", "R2K2", "GPIO2_SDA1", "VDD_3V3"); two("R_SCL2", "R2K2", "GPIO3_SCL1", "VDD_3V3")
two("R_ID_SD", "R4K7", "ID_SD", "VDD_3V3"); two("R_ID_SC", "R4K7", "ID_SC", "VDD_3V3")
// USB0_VBUS: abs. max and recommended max are both 5.25 V (AM335x datasheet), the CM4's +5 V input may be 4.75-5.25 V:
// no margin, so 1 kOhm in series limits the current into the comparator input during an overshoot. The pin draws only
// the comparator's bias (USB OTG: >= 40 kOhm), so it still sees > 4.6 V at a 4.75 V input (VBUS valid: 4.4 V).
two("R_VBUS", "R1K", "VIN5", "USB0_VBUS", "USB0 VBUS sense from the module's 5 V through 1 kOhm (CM4 carriers do not bring VBUS to the module)")
export const PLANE_NETS = ["GND", "VDDS_DDR", "VDD_CORE", "VDD_MPU", "VDD_3V3", "VDD_1V8", "VDDS_RTC", "DDR_VREF", "VIN5", "SYS"]