Skip to main content

GPIO Reference

Every STM32H7 pin used on the 305ap, sorted by port and pin. For the same information grouped by bus and peripheral, see the Internal Bus Reference.

Port A​

PinFunctionPeripheralNotes
PA0TELEM 1 TXUART4 TX
PA1TELEM 1 RXUART4 RX
PA2MOTOR 4TIM2 CH3
PA3BuzzerTIM5 CH4Tone alarm
PA4——Not connected
PA5Baro SCLKSPI1 SCKBMP581
PA6Baro MISOSPI1 MISOBMP581
PA7MOTOR 5TIM3 CH2
PA8MOTOR 1TIM1 CH1
PA9Motor telemetry RXUSART1Single-wire (TX pin used as RX)
PA10CAN 1 transceiver standbyGPIO outputLow = transceiver active
PA11USB D−OTG FS
PA12USB D+OTG FS
PA13IMU 2 INT2GPIO
PA14IMU 2 CSSPI3 CS
PA15MOTOR 3TIM2 CH1

Port B​

PinFunctionPeripheralNotes
PB0TELEM 1 CTSUART4 CTS
PB1MOTOR 6TIM3 CH4
PB2IMU 2 MOSISPI3 MOSI
PB3IMU 2 SCLKSPI3 SCK
PB4IMU 2 MISOSPI3 MISO
PB5CAN 2 RXFDCAN2 RX
PB6CAN 2 TXFDCAN2 TX
PB7MOTOR 7TIM4 CH2
PB8Mag SCLI2C1 SCLMMC5983MA
PB9Mag SDAI2C1 SDAMMC5983MA
PB10External I2C SCLI2C2 SCLU20 connector
PB11External I2C SDAI2C2 SDAU20 connector
PB12Green LEDGPIO outputActive low
PB13RC inputUART5Single-wire
PB14TELEM 1 RTSUART4 RTS
PB15Baro DRDYGPIO inputBMP581

Port C​

PinFunctionPeripheralNotes
PC0——Not connected
PC1IMU 1 MOSISPI2 MOSI
PC2_CIMU 1 MISOSPI2 MISO
PC3_CCurrent sense inputADC (ADC1 CH13 via PC3)1/11 divider; external current sensor
PC4Battery voltageADC1 CH41/11 divider (BAT1_V_DIV = 11)
PC5——Not connected
PC6GPS TXUSART6 TX
PC7GPS RXUSART6 RX
PC8SD DAT0SDMMC1
PC9SD DAT1SDMMC1
PC10SD DAT2SDMMC1
PC11SD DAT3SDMMC1
PC12SD CLKSDMMC1
PC13External SPI CS1GPIO outputCN7 connector
PC14External SPI CS2GPIO outputCN7 connector
PC15IMU 2 DRDY (INT1)GPIO input

Port D​

PinFunctionPeripheralNotes
PD0CAN 1 RXFDCAN1 RX
PD1CAN 1 TXFDCAN1 TX
PD2SD CMDSDMMC1
PD3IMU 1 SCLKSPI2 SCK
PD4IMU 1 INT2GPIO
PD5VTX TXUSART2 TXMSP OSD (TELEM 3)
PD6VTX RXUSART2 RX
PD7Baro MOSISPI1 MOSIBMP581
PD8VTX SBUS / consoleUSART3 TXNuttX console, 57600 baud
PD9Red LEDGPIO outputActive low
PD10——Not connected
PD11Baro CSSPI1 CSBMP581
PD12GPS compass SCLI2C4 SCLGPS connector
PD13GPS compass SDAI2C4 SDAGPS connector
PD14MOTOR 8TIM4 CH3
PD15——Not connected

Port E​

PinFunctionPeripheralNotes
PE0IMU 1 DRDY (INT1)GPIO input
PE1CAN 2 transceiver standbyGPIO outputLow = transceiver active
PE2External SPI SCLKSPI4 SCKCN7 connector
PE3SD card detectGPIO input
PE4IMU 1 CSSPI2 CS
PE5——Not connected
PE6External SPI MOSISPI4 MOSICN7 connector
PE7TELEM 2 RXUART7 RX
PE8TELEM 2 TXUART7 TX
PE9TELEM 2 RTSUART7 RTS
PE10TELEM 2 CTSUART7 CTS
PE11MOTOR 2TIM1 CH2
PE12Blue LEDGPIO outputActive low
PE13External SPI MISOSPI4 MISOCN7 connector
PE14——Not connected
PE15——Not connected

Using GPIOs from the Console​

The gpio command reads and writes pins from the MAVLink Console, which helps when checking hardware:

gpio read E3              # SD card detect (port letter and pin, without the "P")
gpio write B12 0 --force # green LED on (active low)

gpio refuses pins whose setup differs from the board's startup configuration unless --force is given. Don't force pins that a running driver uses (motor outputs, buses, the CAN standby lines). The LEDs are safest to experiment with; the led_control command is the normal way to control them.