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 (for most autopilots) 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 blheli32-esc-telemetry

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, see LTM Telemetry

26

Runcam see RunCam Camera Support

27

HOTT Telem see HOTT Telemetry

28

Scripting see Lua Scripts

29

Crossfire Receiver Crossfire and ELRS RC Systems

30

Generator see RichenPower Generator

31

Winch

32

MSP Telemetry see Multiwii Serial Protocol (MSP)

33

DJI FPV telemetry see MSP OSD

34

Serial Airspeed sensor

35

Serial ADSB receiver

36

External AHRS, see External AHRS Systems

37

Smart Audio, see Video Transmitter Support

38

FETtecOneWire, see FETtec OneWire ESCs

39

Torqeedo, see Torqeedo Electric Motors

40

AIS, see AIS (for boats)

41

CoDevESC

42

DisplayPort, see MSP OSD

43

MAVLink High Latency, see MAVLink High Latency Mode

44

IRC Tramp, see Video Transmitter Support

45

DDS XRCE

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.

  • if bit 4 is set, then the RX pin has a weak pull down resistor activated.

  • if bit 5 is set, then the RX pin has a weak pull up resistor activated.

  • if bit 6 is set, then the TX pin has a weak pull down resistor activated.

  • if bit 7 is set, then the TX pin has a weak pull up resistor activated.

  • if bit 8 is set, then the RX has no DMA activated (assuming DMA is available on this UART)

  • if bit 9 is set, then the TX has no DMA activated (assuming DMA is available on this UART)

  • if bit 10 is set, then MAVLink forwarding will not be active on this UART port.

  • if bit 11 is set, then the hardware FIFO in H7 autopilots is disabled

  • if bit 12 is set, the GCS are prevented from changing the MAVLink message stream rates set by the SRx_... parameters.

Note

HalfDuplex is supported on all ChiBiOS based autopilots, but inversion and swap are only supported on boards with F7 or H7 microprocessors.