3 Cleanflight has enhanced serial port flexibility but configuration is slightly more complex as a result.
5 Cleanflight has the concept of a function (MSP, GPS, Serial RX, etc) and a port (VCP, UARTx, SoftSerial x).
6 Not all functions can be used on all ports due to hardware pin mapping, conflicting features, hardware, and software
11 * USB Virtual Com Port (VCP) - USB pins on a USB port connected directly to the processor without requiring
12 a dedicated USB to UART adapter. VCP does not 'use' a physical UART port.
13 * UART - A pair of dedicated hardware transmit and receive pins with signal detection and generation done in hardware.
14 * SoftSerial - A pair of hardware transmit and receive pins with signal detection and generation done in software.
16 UART is the most efficent in terms of CPU usage.
17 SoftSerial is the least efficient and slowest, SoftSerial should only be used for low-bandwith usages, such as telemetry transmission.
19 UART ports are sometimes exposed via on-board USB to UART converters, such as the CP2102 as found on the Naze and Flip32 boards.
20 If the flight controller does not have an onboard USB to UART converter and doesn't support VCP then an external USB to UART board is required.
21 These are sometimes referred to as FTDI boards. FTDI is just a common manufacturer of a chip (the FT232RL) used on USB to UART boards.
23 When selecting a USB to UART converter choose one that has DTR exposed as well as a selector for 3.3v and 5v since they are more useful.
27 * [FT232RL FTDI USB To TTL Serial Converter Adapter](http://www.banggood.com/FT232RL-FTDI-USB-To-TTL-Serial-Converter-Adapter-Module-For-Arduino-p-917226.html)
28 * [USB To TTL / COM Converter Module buildin-in CP2102](http://www.banggood.com/Wholesale-USB-To-TTL-Or-COM-Converter-Module-Buildin-in-CP2102-New-p-27989.html)
30 Both SoftSerial and UART ports can be connected to your computer via USB to UART converter boards.
32 ## Serial Configuration
34 To make configuration easier, common usage scenarios are listed below.
36 ### Serial port scenarios
40 1 MSP, CLI, TELEMETRY, SMARTPORT TELEMETRY, GPS-PASSTHROUGH
44 5 MSP, CLI, GPS-PASSTHROUGH
46 7 GPS-PASSTHROUGH ONLY
48 9 SMARTPORT TELEMETRY ONLY
50 11 MSP, CLI, BLACKBOX, GPS-PASSTHROUGH
55 If the configuration is invalid the serial port configuration will reset to its defaults and features may be disabled.
57 * There must always be a port available to use for MSP
58 * There must always be a port available to use for CLI
59 * There can only be 1 CLI port.
60 * There is a maximum of 2 MSP ports.
61 * To use a port for a function, the function's corresponding feature must be also be enabled.
62 e.g. after configuring a port for GPS enable the GPS feature.
63 * If SoftSerial is used, then all SoftSerial ports must use the same baudrate.
68 All examples assume default configuration (via CLI `defaults` command)
70 a) Parallel PWM, GPS and FrSky TELEMETRY (when armed)
72 - TELEMETRY,MSP,CLI,GPS PASSTHROUGH on UART1
76 feature RX_PARALLEL_PWM
79 set serial_port_2_scenario = 2
83 b) Graupner SumD RX SERIAL and HoTT TELEMETRY via SoftSerial
85 - MSP,CLI,GPS PASSTHROUGH on UART1
87 - HoTT Telemetry on SOFTSERIAL1
89 feature -RX_PARALLEL_PWM
93 set serial_port_1_scenario = 5
94 set serialrx_provider = 3
95 set serial_port_2_scenario = 3
96 set telemetry_provider = 1
97 set serial_port_3_scenario = 4
101 c) PPM RX, GPS and FrSky TELEMETRY via SoftSerial
103 - MSP, CLI, GPS PASSTHROUGH on UART1
105 - TELEMETRY on SOFTSERIAL1
108 feature -RX_PARALLEL_PWM
113 set serial_port_1_scenario = 5
114 set serial_port_2_scenario = 2
115 set serial_port_3_scenario = 4
118 d) RX SERIAL, GPS and TELEMETRY (when armed) MSP/CLI via SoftSerial
122 - TELEMETRY,MSP,CLI,GPS PASSTHROUGH on SOFTSERIAL1
125 feature -RX_PARALLEL_PWM
130 set serial_port_1_scenario = 2
131 set serial_port_2_scenario = 3
132 set serial_port_3_scenario = 1
133 set msp_baudrate = 19200
134 set cli_baudrate = 19200
135 set gps_passthrough_baudrate = 19200
139 e) PPX RX, HoTT Telemetry via UART2
141 - MSP,CLI,GPS PASSTHROUGH on UART1
142 - HoTT telemetry on UART2
145 feature -RX_PARALLEL_PWM
148 set serial_port_1_scenario = 5
149 set serial_port_2_scenario = 4
150 set telemetry_provider = 1
153 f) PPM RX, GPS, HoTT Telemetry via SoftSerial 1
155 - MSP,CLI,GPS PASSTHROUGH on UART1
157 - HoTT telemetry on SOFTSERIAL1
160 feature -RX_PARALLEL_PWM
165 set serial_port_2_scenario = 2
166 set serial_port_3_scenario = 4
167 set telemetry_provider = 1
173 - TELEMETRY, MSP, CLI, GPS PASSTHROUGH on UART1
177 feature -RX_PARALLEL_PWM
179 set serialrx_provider = 2
180 set serial_port_2_scenario = 3
184 h) Spektrum RX SERIAL
186 - TELEMETRY, MSP, CLI, GPS PASSTHROUGH on UART1
190 feature -RX_PARALLEL_PWM
192 set serialrx_provider = 0
193 set serial_port_2_scenario = 3
197 i) MSP via USART1 and SoftSerial 1
199 - TELEMETRY, MSP, CLI, GPS PASSTHROUGH on UART1
201 - Both ports will be at 19200 (limited by SoftSerial)
202 - USART2 can still be used for GPS/SerialRX/Telemetry, etc.
205 feature -RX_PARALLEL_PWM
208 set serial_port_1_scenario = 1
209 set serial_port_3_scenario = 8
210 set msp_baudrate = 19200
211 set cli_baudrate = 19200
212 set gps_passthrough_baudrate = 19200