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.

firmware/boot-controller/README.md

# AM69 always-on boot controller

Engineering firmware for the STM32G031K6U6 in `BootController.tsx`. The TI AM69A98 remains the application processor. Builds and native policy tests pass; this firmware has not been flashed or tested on hardware. GPIO pinmux, PMIC NVM sequencing, ADC thresholds, power discharge, fan polarity and boot sampling must be measured before a bootable-board claim.

`make ARM_PREFIX=/path/to/arm-none-eabi- all test` builds independent CM5 and Pi images. GCC 14.2.1/binutils 2.44 were used. Both images fit the 32 KiB flash/8 KiB RAM device. Native tests use ASan/UBSan; LeakSanitizer is disabled because the managed execution environment uses ptrace. This application allocates no heap memory.

The controller waits for low POR and 100 ms discharge, selects straps, waits 50 ms, enables the power sequence, then requires POR high for 30 ms before disconnecting bootstrap drivers and connecting the UART. USB recovery overrides Pi microSD boot; CM5 defaults to eMMC. TI SPRUJ52E ROM words are eMMC MCU `0x308`/MAIN `0x03`, USB `0x310`/`0x03`, SD `0x300`/`0x43`, at 19.2 MHz with POST bypass `11`. The SD preset requires the separate SD electrical interface and a compatible boot image.

The hardware D flip-flop presets into boot isolation while RUN is low. Firmware releases its open-drain strap GPIOs and explicitly pulses PB7 before selecting UART and fan alternate functions. A real POR loss disconnects UART and triggers a cold sequence with fresh straps. Three rapid POR failures latch off; a carrier-enable edge or power-button press retries. Main 3.3 V stays enabled during the PMIC shutdown sequence through its hardware keep-alive path.

An active-low power-button interrupt goes to AM69 ball L36 (WKUP_GPIO0_7); Linux should implement a normal shutdown. A high signal from AM69 L37 (WKUP_GPIO0_6) requests final power-off through `gpio-poweroff`, after Linux has unmounted storage. Holding the button for four seconds forces off. Carrier enable low dominates all software. ADC monitors the PMIC's 1.8 V POR and calibrated AON supply; input 5 V PG independently gates PMIC enable in hardware. The independent watchdog is fed only after the main loop completes.

PB7 TIM17_CH1N generates 25 kHz open-drain fan PWM through U1202; PB9 counts falling tach edges, assuming two pulses/revolution. The default is full cooling. Host fan commands expire after five seconds. Off-state cooling runs for 30 seconds and stays at full speed if POR still indicates that the processor is powered. Fan power wiring and total thermal capacity remain board requirements.

The CRC16-CCITT UART protocol is 115200 baud, 8N1: `A5 5A command sequence valueLo valueHi crcLo crcHi`; CRC covers the four command/sequence/value bytes, initial `FFFF`, polynomial `1021`. Replies use command OR `80`, or `FF` for rejection. Commands: 1 fan percent, 2 state, 3 immediate off (zero value), 4 cold reboot (zero value), 5 RPM. Off/reboot commands are diagnostic and require storage to be quiescent first. `ec-client.py` intentionally exposes only fan, state and RPM. Its serial device must be supplied after the AM69 device tree enables MCU_UART0 on J37/K38.

Six bare, paste-free pads are provided: TP1200 AON 3.3 V (programmer reference, not an extra supply), TP1201 GND, TP1202 SWDIO, TP1203 SWCLK, TP1204 NRST, TP1205 force USB recovery to ground. Program the appropriate `build/ec-cm5.bin` or `build/ec-pi5.bin` at `0x08000000` using an SWD fixture. No hardware was programmed in this session.

The user's NEMA17 controller was the reference for the original controller workflow and checked register-level ADC/UART patterns and the firmware/build/test workflow. This application, protocol and boot policy are new. CMSIS/STM32 vendor headers retain their included Apache-2.0 licenses. Raw vendor datasheets are not distributed.

The Pi image additionally requires a stable, coherent5V/5A explicit USB-PD contract. It reads STUSB4500 over dedicated PB8/PB3 GPIO I2C, checks its sink profile and negotiated RDO, and drives PC14 power permission. PB1 monitors the hardware sink enable; PB2 is reserved for alert and PB5 drives active-high reset low during normal operation. The 100ms positive qualification rejects lower-current fallback and stale/error/transition states. The G03132-pin package preserves all previous GPIO peripheral assignments; package contact numbers for PB7/PB9 and PA11..PA14/PB6 change and are independently checked in the compiled board. See `../usb-pd/README.md` for per-device NVM programming. No PD negotiation has been bench tested.