Why I Built This Table

A few posts back I walked through resolving a single header pin (P9_12) to its gpiochip/line number with gpioinfo. That workflow is great when you already know which pin you're chasing. What it doesn't give you is the bird's-eye view — every pin on both 46-pin headers, in one place, so you can pick a free GPIO for a project without flipping between the datasheet, the System Reference Manual, and a terminal. This post is that bird's-eye view.

How to Read This Table

  • Header/Pin — the silkscreen label printed on the board (e.g. P9_12).
  • GPIO Bank_Offset — the AM335x GPIO bank (0–3) and offset within that bank (0–31), e.g. GPIO1_28.
  • Linux GPIO # — the flattened number the classic sysfs interface (/sys/class/gpio) and most tutorials use, computed as bank × 32 + offset.
  • Default Function — the pin's most commonly-used alternate (non-GPIO) mux mode on the stock device tree, if it has one.

One caveat worth repeating from the earlier post: gpiochip numbers reported by gpioinfo aren't guaranteed to line up 1:1 with bank numbers — that depends on device tree probe order on your specific kernel. The GPIO bank_offset and the flattened Linux GPIO number below are the stable, hardware-defined values; always confirm the live gpiochip/line with gpioinfo before wiring anything up.

P9 Header (46 pins)

Pin GPIO Bank_Offset Linux GPIO # Default Function
P9_1GND
P9_2GND
P9_3DC_3.3V (fixed rail)
P9_4DC_3.3V (fixed rail)
P9_5VDD_5V
P9_6VDD_5V
P9_7SYS_5V
P9_8SYS_5V
P9_9PWR_BUT (active low)
P9_10SYS_RESETn (active low)
P9_11GPIO0_30gpio30UART4_RXD
P9_12GPIO1_28gpio60
P9_13GPIO0_31gpio31UART4_TXD
P9_14GPIO1_18gpio50EHRPWM1A
P9_15GPIO1_16gpio48
P9_16GPIO1_19gpio51EHRPWM1B
P9_17GPIO0_5gpio5SPI0_CS0 / I2C1_SCL
P9_18GPIO0_4gpio4SPI0_D1 / I2C1_SDA
P9_19GPIO0_13gpio13I2C2_SCL / SPI1_CS1
P9_20GPIO0_12gpio12I2C2_SDA
P9_21GPIO0_3gpio3SPI0_D0 / UART2_TXD
P9_22GPIO0_2gpio2SPI0_SCLK / UART2_RXD
P9_23GPIO1_17gpio49
P9_24GPIO0_15gpio15UART1_TXD
P9_25GPIO3_21gpio117McASP0_AHCLKX
P9_26GPIO0_14gpio14UART1_RXD
P9_27GPIO3_19gpio115McASP0_FSR
P9_28GPIO3_17gpio113SPI1_CS0 / McASP0_AHCLKR
P9_29GPIO3_15gpio111SPI1_D0 / McASP0_FSX
P9_30GPIO3_16gpio112SPI1_D1
P9_31GPIO3_14gpio110SPI1_SCLK / McASP0_AXR0
P9_32VADC (1.8V analog ref)
P9_33AIN4 (analog in)
P9_34AGND
P9_35AIN6 (analog in)
P9_36AIN5 (analog in)
P9_37AIN2 (analog in)
P9_38AIN3 (analog in)
P9_39AIN0 (analog in)
P9_40AIN1 (analog in)
P9_41GPIO0_20gpio20CLKOUT2
P9_42GPIO0_7gpio7ECAPPWM0 / SPI1_CS1
P9_43GND
P9_44GND
P9_45GND
P9_46GND

P8 Header (46 pins)

Pin GPIO Bank_Offset Linux GPIO # Default Function
P8_1GND
P8_2GND
P8_3GPIO1_6gpio38MMC1_DAT3 — shared with eMMC, see note below
P8_4GPIO1_7gpio39MMC1_DAT2 — shared with eMMC, see note below
P8_5GPIO1_2gpio34MMC1_DAT1 — shared with eMMC, see note below
P8_6GPIO1_3gpio35MMC1_DAT0 — shared with eMMC, see note below
P8_7GPIO2_2gpio66TIMER4
P8_8GPIO2_3gpio67TIMER7
P8_9GPIO2_5gpio69TIMER5
P8_10GPIO2_4gpio68TIMER6
P8_11GPIO1_13gpio45
P8_12GPIO1_12gpio44
P8_13GPIO0_23gpio23EHRPWM2B
P8_14GPIO0_26gpio26
P8_15GPIO1_15gpio47
P8_16GPIO1_14gpio46
P8_17GPIO0_27gpio27
P8_18GPIO2_1gpio65
P8_19GPIO0_22gpio22EHRPWM2A
P8_20GPIO1_31gpio63
P8_21GPIO1_30gpio62
P8_22GPIO1_5gpio37
P8_23GPIO1_4gpio36
P8_24GPIO1_1gpio33
P8_25GPIO1_0gpio32
P8_26GPIO1_29gpio61
P8_27GPIO2_22gpio86LCD_VSYNC — reserved for HDMI by default, see note below
P8_28GPIO2_24gpio88LCD_PCLK — reserved for HDMI by default, see note below
P8_29GPIO2_23gpio87LCD_HSYNC — reserved for HDMI by default, see note below
P8_30GPIO2_25gpio89LCD_AC_BIAS_EN — reserved for HDMI by default, see note below
P8_31GPIO0_10gpio10UART5_CTSn / LCD_DATA14 — reserved for HDMI by default
P8_32GPIO0_11gpio11UART5_RTSn / LCD_DATA15 — reserved for HDMI by default
P8_33GPIO0_9gpio9UART4_RTSn / LCD_DATA13 — reserved for HDMI by default
P8_34GPIO2_17gpio81UART3_RTSn / LCD_DATA11 — reserved for HDMI by default
P8_35GPIO0_8gpio8UART4_CTSn / LCD_DATA12 — reserved for HDMI by default
P8_36GPIO2_16gpio80UART3_CTSn / LCD_DATA10 — reserved for HDMI by default
P8_37GPIO2_14gpio78UART5_TXD / LCD_DATA8 — reserved for HDMI by default
P8_38GPIO2_15gpio79UART5_RXD / LCD_DATA9 — reserved for HDMI by default
P8_39GPIO2_12gpio76LCD_DATA6 — reserved for HDMI by default
P8_40GPIO2_13gpio77LCD_DATA7 — reserved for HDMI by default
P8_41GPIO2_10gpio74LCD_DATA4 — reserved for HDMI by default
P8_42GPIO2_11gpio75LCD_DATA5 — reserved for HDMI by default
P8_43GPIO2_8gpio72LCD_DATA2 — reserved for HDMI by default
P8_44GPIO2_9gpio73LCD_DATA3 — reserved for HDMI by default
P8_45GPIO2_6gpio70LCD_DATA0 — reserved for HDMI by default
P8_46GPIO2_7gpio71LCD_DATA1 — reserved for HDMI by default

Two Traps Worth Knowing About Before You Wire Anything Up

  • P8_27 – P8_46 are usually claimed by HDMI. The stock BeagleBone Black device tree enables the HDMI framebuffer overlay by default, which mux‑locks nearly the entire second half of P8 to LCD data/sync signals. If gpioinfo shows those lines as unavailable or already requested, that's why — you'll need to disable the HDMI overlay (via config-pin or an entry in uEnv.txt) before those pins act as GPIO.
  • P8_3 – P8_6 are electrically shared with the onboard eMMC. These four pins carry the same MMC1 data lines used to boot from and access the built-in eMMC storage. On boards booting from eMMC, treat these as reserved unless you specifically know what you're doing.

My Honest Pros & Cons

✅ What I Love

  • Every GPIO-capable pin on both headers in one scroll, cross-referenced by bank_offset and the flattened number most tutorials and forum posts actually use.
  • Saves the "which pins are actually free" question that comes up at the start of every new BeagleBone Black project.
  • Pairs directly with the gpioinfo + pinmux debugfs workflow from earlier in this series when you need to verify a specific pin's live state.

❌ What Could Be Better

  • Default alternate functions listed here reflect the stock device tree — a custom device tree overlay can remap any of these pins to something else entirely.
  • It's a static reference, not a live query — always double-check with gpioinfo before trusting a number on hardware you didn't set up yourself.

Final Verdict

Bookmark this one. Whether you're picking a free GPIO for a new sensor, double-checking that the pin you want isn't secretly wired to HDMI or the eMMC, or just trying to translate a forum post's "gpio60" into a header label, this table is the fastest path there — faster than re-deriving bank/offset math from the datasheet every time.