Serial Port Configuration Options

This page describes the configuration options for the serial ports. Currently, some of these options are supported only on specific autopilots.

Logical Serial Port to Physical UART Assignment

ArduPilot Serialx Port numbering is logical, rather than physical. Which UART or USART port is assigned to a Serial Port is determined by the autopilot’s hardware definition file. Serial Port 0 is always assigned to the USB port, but others can vary. Check its description page

Note

more serial ports may be shown in the parameters than exist on a given controller. Check its description page

By default the protocols/expected peripheral for each port is shown below:

Note

any supported protocol/peripheral can be used by any port by changing its SERIALx_PROTOCOL parameter

Serial 0 USB port, MAVLink2 protocol
Serial 1 Telemetry port 1, MAVLink1 protocol
Serial 2 Telemetry port 2, MAVLink1 protocol
Serial 3 GPS1 port
Serial 4 GPS2 port
Serial 5 USER port, disabled
Serial 6 USER port, disabled
Serial 7 USER port, disabled

Often cased autopilots will have the designation “TELEM1”, “GPS”, etc. marked on the case, otherwise, the autopilot description page should provide the mapping to SERIALx Port

SERIALx_PROTOCOL

The serial ports support many different kinds of interfaces and peripheral. The SERIALx_PROTOCOL parameter determines what type of device/interface is expected.

Value Protocol
-1 Disabled
1

MAVLink1, See Telemetry Setup

2

MAVLink2, See Telemetry Setup

3

FrSky D, See FrSky Telemetry

4

FrSky SPort, See FrSky Telemetry

5

GPS, See GPS and Devices

7

Alexmos Gimbal Serial, See Alexmos Gimbal

8

SToRM32 Gimbal Serial, See SToRM32 Gimbal

9

Rangefinder, See Rangefinders

10

FrSky SPort Passthrough (OpenTX), See FrSky Passthrough Telemetry

11

Lidar360, See 360 Lidars here

13

Beacon, See Non-GPS Navigation

14

Volz Servo, See Volz Servos

15

SBus Servo, See SBus Servos

16

ESC Telemetry, See DShot and BLHeli_32 ESC Support

17

Devo Telemetry

18

OpticalFlow, See Optical Flow Sensors

19

RobotisServo, See Robotis Servos

20 NMEA Output, NEMA Output stream from GPS
21

WindVane, See Wind Vane

22

SLCAN

23

RC Input, See Typical Autopilot Wiring Connections

24

MegaSquirt EFI, see MegaSquirt EFI

25

LTM Telemetry

SERIALx_OPTIONS Parameter

Every serial port has in addition, to its baud rate (SERIALx_BAUD) and protocol format (SERIALx_PROTOCOL), the ability to invert its RX input and/or TX data, operate in half-duplex mode, and/or swap its RX and TX inputs.

For example, for direct connection to FRSky SPort telemetry, normally inverters and diode OR externally would be required. With SERIALx_OPTIONS bitmask set to 7, direct connection to the SPort can be accomplished from a serial port.

Bitmask Options

  • if bit 0 is set, then RX data received is inverted internally.
  • if bit 1 is set, the TX data is inverted before outputting.
  • if bit 2 is set, then HalfDuplex operation using the TX pin is implemented.
  • if bit 3 is set, then the TX and RX pins are effectively swapped internally.

Note

HalfDuplex is supported on all ChiBiOS based autopilots, but all other options are only supported on boards with F7 or H7 microprocessors.