Why do only 4 of my 20 PRU output pins actually work on the BeagleBone AI-64?

I’m running PRU step-generator firmware on a BeagleBone AI-64 (Debian, kernel 6.18.47-arm64-k3-r53, PREEMPT_RT) and have hit a very reproducible asymmetry on ICSSG0 PRU0 direct outputs, verified with an oscilloscope on the header pins.

R30 bits 16-19 work perfectly (P8_12 / P8_11 / P8_15 / P8_16, padconfig mux 0): clean 3.3 V step trains at 5 kHz.

R30 bits 0-15 never reach the header (tested bit 0 → AF28/P9_28, bit 3, others; same mux 0, padconfig = 0x00010000): pins float or sit at a constant level while the same bits demonstrably toggle in R30.

Ruled out before posting: padconfig registers verified by readback, with ball-to-pin mapping cross-checked against the kernel’s gpiochip line names. The same pad muxed to GPIO (mux 7) toggles fine from Linux via gpioset – so the ball, trace, and socket are good; only the PRU (mux 0) path is dead. The firmware writes all 32 bits of R30 (verified in source and in the PRU’s task memory). ICSSG0 GPCFG0/1 read 0x0, MII_RT TXCFG0/1 have TX_ENABLE clear, and there is no ti,pruss-gp-mux-sel in the DT.

Full disclosure: at one point I dropped a scope probe’s ground clip onto the board, which shorted something and caused a reboot – so I can’t 100% rule out damage, and I have a second AI-64 on order to double-check everything on fresh hardware. That said, the failure pattern doesn’t look like damage to me: it’s a clean bit-range split (0-15 vs 16-19) that’s identical across many pins and reboots, and the affected pins all still work fine through the GPIO path.

SPRUJ61 describes CTRLMMR_ICSSG[2:0]_CTRL registers with per-pin GPM_BIDI fields gating each GPO. I can’t inspect them from Linux – reading 0x00104100 via /dev/mem raises a firewall exception (hard-learned!).

My questions:

Q1: Does the AI-64 boot chain (u-boot / SYSFW / board config) set CTRLMMR_ICSSG0_CTRL GPM_BIDI (or anything similar) non-default for GPO0-15?

Q2: What’s the sanctioned way to return those pins to plain R30-driven outputs on a stock image?

Q3: Is there another per-bit gate between PRU R30 and the pad I should check?

I have a scope on the pins and full control of the board – happy to run any diagnostic.

Hey. Looks like you have a great project going. Can you share your device tree?

SOLVED — the pins were fine all along. Two stacked mistakes on my end.

Closing the loop on my own question: all 20 PRU outputs on the AI-64 work. There is no SoC gate, no firewall on the low GPO bits, and CTRLMMR_ICSSG0_CTRL needs no attention — its default of 0 (GPM_BIDI=0) already means “GPO pin driven from R30,” which is exactly what you want for PRU outputs.

What actually bit me, twice:

1. An off-by-one in my pinmux addresses. My setup derived PADCONFIG register offsets arithmetically from GPIO line numbers, and the rule was wrong by one register (4 bytes) for every P9 pin — so I was configuring each pin’s neighbor and concluding the pin was dead. The four P8 pins I’d derived separately happened to be correct, which produced a very convincing (and completely false) “bits 16–19 work, bits 0–15 are gated inside the chip” pattern. Lesson: don’t derive pad offsets — look each one up (the TDA4VM datasheet ball tables or the BeagleBoard device-tree sources have them). For reference, P9_33 (ball AC28, PRG0_PRU0_GPO7, mux mode 0) is PADCONFIG 0x0011C0CC.

2. Scope probe on the wrong socket — because pin 1 isn’t the first hole. Even after fixing the mux, I “confirmed” a dead pin because I was counting socket positions from the physical end of the header strip. On my AI-64 the connector strip has more socket positions than numbered pins (the schematic draws it as a 2×25-position part for the 46 numbered P9 pins), so pin 1 actually starts at the third row of holes — every count from the plastic’s edge was two rows off. Check the silkscreen pin numbers at the header ends before counting.

A trick that saved us: on the AI-64, the P9 analog-cluster pins (P9_33/35/36/37/38/39) are each wired to an MCU ADC channel through a 10K/10K divider — so the board has a built-in voltmeter on those pins. Reading /sys/bus/iio/devices/iio:device0/in_voltage*_raw while touching 3.3 V to a pin tells you exactly which physical pin you’re on (P9_33 = AIN4). Great for validating probe placement.

Now scope-verified with step pulses from ICSSG0 PRU0: bit 5 (P8_04), bit 7 (P9_33), bits 16–19 (P8_12/11/15/16). Low bits included — full R30 access on the headers.

One incidental finding for anyone poking registers: reading 0x00104100 from Linux via /dev/mem hard-crashes the board (firewall), but from the u-boot prompt it reads fine — and reading 0x00104108 throws an SError even there. Not needed for PRU GPIO — just don’t go poking it expecting answers.

Thanks to everyone who read the original post — hopefully this closes it usefully.

Thanks for circling back with the full write-up. This is exactly the kind of “solved” post that saves the next person a day with a scope and a datasheet.

The pinmux-by-neighbor failure mode is especially believable on these boards, because once a few pins work it’s very easy to assume the remaining ones are blocked somewhere deeper in the SoC. Also good catch on the physical header indexing — that has bitten more than one person on AI-64-style headers. The ADC-as-pin-finder trick is a nice practical tip too.

Glad to hear the low R30 bits are confirmed working on the header. I’m marking the topic solved.

This does sound more like a mux/gating issue than random damage, especially since GPIO mode still works and the split is so clean.

A couple of practical things to check while waiting for the second board: make sure nothing in the device tree is claiming those lower PRU outputs for another ICSSG function, and compare the live pinctrl state under /sys/kernel/debug/pinctrl/ if debugfs is enabled. On K3 parts, some CTRLMMR regions are firewalled exactly as you found, so poking them from Linux with /dev/mem is not the right path; changes there generally need to come through board configuration / firmware, U-Boot, or a proper kernel driver path.

I don’t want to guess on the exact AI-64 boot-chain defaults for GPM_BIDI, but your test case is good. If you can post the overlay / DTS fragment you’re using for those pins and the PRU firmware snippet that writes R30, that should make it easier for someone with the TRM/SYSFW side in front of them to confirm whether GPO0–15 are being left in bidirectional/input mode or routed elsewhere.