Main Content

I2C Bus Port Numbers for Labels on PX4 Autopilots

R2026b

The I2C Controller Read and I2C Controller Write blocks in the UAV Toolbox Support Package for PX4® Autopilots support sending and receiving data using the bus on the PX4 flight controller board.

This section lists the mapping of the different port labels on the PX4 flight controller board to the bus port numbers that you can select when configuring the blocks in your Simulink model.

Note

For Pixhawk 6C Autopilots with serial numbers in the format XXXX 001 XXXXXX (located on the packaging), the TELEM3 port can also function as an I2C device. Do not connect non-I2C devices to the TELEM3 port if you have this version.

Bus Mapping for Supported Target Hardware Boards

Target Hardware SupportedBus Mapping Diagram
Cube Blue H7

Cube Blue H7 with I2C2 port on bus 2 and GPS1 port on bus 1, showing VCC, SCL, SDA, and GND pin assignments

Cube Orange

Cube Orange with I2C2 port on bus 2 and GPS1 port on bus 1, showing VCC, SCL, SDA, and GND pin assignments

Cube Orange Plus

Cube Orange Plus with I2C2 on bus 2, GPS2 on bus 1, and GPS1 on bus 1, showing pin assignments for each port

CUAV X7+

CUAV X7+ with six I2C ports: GPS&SAFETY and I2C1 on bus 1, I2C2 and UART4 on bus 2, I2C3 on bus 3, and I2C4 on bus 4

Pixhawk 6c

Pixhawk 6C with GPS2 on bus 2, GPS1 on bus 1, and I2C on bus 2 or 4, showing pin assignments

Pixhawk 6x

Pixhawk 6x with GPS2 on bus 2, UART4 and I2C on bus 3, GPS1 on bus 1, and I2C on bus 3, showing pin assignments

Pixhawk 1

Pixhawk 1 with I2C port on bus 1, showing VCC, SCL, SDA, and GND pin assignments

Pixhawk 2.1 (Cube)

Pixhawk 2.1 (Cube) with I2C2 port on bus 2 and GPS1 port on bus 1, showing VCC, SCL, SDA, and GND pin assignments

Pixhawk 4

Pixhawk 4 with UART I2C B on bus 2, GPS Module on bus 1, and I2C A on bus 4, showing pin assignments

Pixracer

Pixracer with GPS port on bus 1, showing VCC, SCL, SDA, and GND pin assignments