Tutorial: How to use Betaflight Softserial

Softserial stands for “Software Serial”, which can create software emulated serial port (UART) for connecting extra devices on the flight controller, and it’s also a great solution to the inverted SmartPort on F4 FC’s.

What can we use Softserial for?

Stuff that requires a UART connection, such as:

  • SmartAudio,
  • GPS
  • SBUS
  • ESC telemetry
  • Smart Port

With the limited number of UART’s on a flight controller (only three on F3/F4 boards), you can turn unused pins like LED_Strip or PPM into softserial ports and connect additional devices.

You can even “split“ one UART for two things. For example if you use UART1 RX pin for ESC Telemetry. you can use UART1 TX pin for SmartAudio or SmartPort if you set it to Soft Serial. This allows you to free up a whole UART for something else.

Oh, did I mention that Soft Serial also supports inverted Smart Port signal? This is extremely useful for F1 and F4 flight controllers because they don’t have built-in inverter. With Softserial, you can connect SmartPort directly to the FC without doing the uninversion hack.

Softserial Limitation

Nothing is perfect, there are some disadvantages in using Soft Serial:

  • Duty cycle limitation – Softserial is not suitable for high duty cycle and “chatty” applications that occupy too much processor time like OSD and serial RX
  • Soft Serial consumes processor resources and will increase CPU load
    • F1 flight controllers cannot run Soft Serial on the latest Betaflight firmware due to the lack of processing power
    • It might not be a good idea to run Softserial on some F3’s if you want fast looptime and to use some other resource-hungry features at the same time
    • Some FC have softserial disabled in the official firmware, you can only enable it with custom-built firmware
  • In the current firmware, it’s limited to 2 Soft Serial ports maximum

How to configure and use Soft Serial?

It’s much easier to demonstrate how to use SoftSerial with examples, which I will show you later in this tutorial.

But in a nutshell, there are only 2 steps to configuring Softserial:

  1. Enable SoftSerial feature
  2. Assign SoftSerial TX/RX to spare pins using Betaflight Resource Remapping

Check out this beginner’s guide to Resource Remapping in Betaflight.

After FC rebooting, you should now see a newly added “Soft Serial” port in port tab.

Which pins can i use for Soft Serial?

This depends on the FC, and what timers the pins are connected to, you can find out what pins can be used for Soft Serial on your particular FC at this page: https://github.com/betaflight/betaflight/wiki/Single-Wire-Software-Serial

In general you should be able to find the following pins on MOST FC’s and use them for soft serial:

  • UART TX & RX
  • PPM Input
  • Programmable LED Strip Pin
  • Motor 5, 6, 7 & 8 (if they are available)

If you run into any problem or have any technical questions, you should always contact your FC manufacturer first.


Examples of Using Softserial

Here are some common usage of Softserial. I am using Betaflight F4 flight controller in all of my examples, but the same steps and concept should apply to other FC’s.

Connecting “inverted” SmartPort signal to an F4 flight controller

By using Softserial, we can connect SmartPort directly to an F4 FC without worrying about signal inversion.

In this example we will connect it to the TX of UART1.

In CLI, type in “resource”, and we can see the pin number of TX1, which is A09 (it might be different  in another FC).

Let’s assign A09 to Softserial 1, by entering in CLI:

resource SERIAL_TX 11 A09
save

Note that, Soft Serial port number starts from 11, which means, 11 is Softserial #1, 12 is Softserial #2

Enable “Softserial” feature in Betaflight, and you should see Softserial1 in the Ports Tab. Then select “SmartPort” under Telemetry Output.

This should now be working! If not, go to CLI, and make sure:

set tlm_halfduplex = on
set tlm_inverted = off

For inverted S.Port signal, you should have “tlm_inverted” set to “off”, however for uninverted SmartPort, it should be set to “on”. Just try both if you are not sure.

After making these changes, you will need to switch off the FC (by unplugging the USB cable and battery), then switch them back on. Sometimes softserial needs to be power-cycled to work properly.

Not working? Please try resetting the board and follow the exact instruction again. It’s been reported working after resetting the board, I don’t know why this is.


“Sharing” one UART between SmartAudio and ESC Telemetry

By using the TX and RX pins of the same UART for two devices, you can free up a whole UART for something else.

For example you can hook up ESC Telemetry to UART1 RX, and configure UART1 TX as Softserial1 and use that for your SmartAudio.

In CLI, type in “resource”, and we can see the pin number of TX1, which is A09.

Let’s assign A09 to Softserial 1, by entering in CLI:

resource SERIAL_TX 11 A09
save

Enable “Softserial” feature in Betaflight, and you should now see Softserial1 in the Ports Tab. Choose “ESC” in UART1 and choose SmartAudio in Softserial1, before saving it.

You might need to restart the FC by disconnecting the USB cable and battery, then turn it back on for it to start working.


Not enough UART? Let’s use LED_Strip pin for SmartPort

if you have LED_Strip pin on your FC, and you are not using LED, you can turn it into a softserial port and use it for devices like SmartPort and SmartAudio.

In CLI, type in “resource”, and we can see the pin number for LED_Strip is B06.

Let’s assign B06 to Softserial 1, by entering in CLI:

resource LED_STRIP 1 none
resource SERIAL_TX 11 B06
save

Enable “Softserial” feature in Betaflight, and you should now see Softserial1 in the Ports Tab. Select “SmartPort” under Telemetry Output.

if it’s not working, please see example 1 for tips to troubleshoot the issue.


Possible Errors

index not between 1 and 10

Two possible causes:

  • You should check if Softserial feature is enabled. Give the FC a reboot after enabling the “Softserial” feature (unplug USB cable and battery), and check again just in case
  • Your particular FC has Softserial disabled in the firmware. This is because F1 and some F3 FC have limited memory to store the firmware, and features like Softserial have to be removed to save memory space.

36 thoughts on “Tutorial: How to use Betaflight Softserial

  1. Fran Ruiz

    Hi. I have already connected sbus to uart1. Can I share TX1 with smartport?.

    I have a Wizard TS215 wich only has 2 usable UART’s, but this drone has 4 RGB LED ports with LEDIN and LEDOUT pins (plus 5v and GND). Its possible to conect to RGB LED pins uninverted smartport? if its posible, it will go to ledin or ledout?

    Thanks a lot!!!!

    Reply
  2. Sam Sanford

    Hello Oscar, my idea is to use soft serial to free up enough UARTs for me to use them as PWM outputs to run two servos for a camera gimbal. Do you think it’s possible? I would like to use a flight controller that only has the 4 motor outputs in each corner because they are cleaner and just use UARTs to run servos with the cam stab feature and manual control with channel forwarding. Do you think UARTs would support this function? Thanks!

    Reply
  3. Christopher Lenihan

    Hello,

    one of my motor signal pads doesnt work anymore and there are only 4. Can i resource that signal pad to another pad that isnt specific for a motor signal??? Need an idea.

    Thanks

    Reply
    1. Oscar Post author

      It really depends on the FC design, you should consult your FC manufacturer or get in touch with Betaflight dev team.

      Reply
  4. John Daniels

    Hi Oscar is it possible to change a sbus pad to a TX pad as I have Fport on a uart TX3 and I want to use a GPS that requires a TX and a RX and all I have left is TX2 and sbus

    Reply
  5. Long Le

    This is very helpful. I have a question about using an open UART for Sbus. I have an AIO F4 FC. I ripped off the pad and would like to use an open UART. Only avail UART that is visible is TX6/RX6. Will the soft serial work in this situation?

    Reply
    1. Oscar Post author

      Soft serial is not good enough for timing critical applications like RC link. Use a hardware UART for it.

      Reply
  6. Calvin Hill

    Can I use softaerial to run the new fport protocol? Will cycle times running SBUS be fine? Running on a xracer F4 board

    Reply
    1. Oscar Post author

      Not a good idea. Soft Serial is too slow for timing critical tasks like RC control.
      Use a hardware UART for it.

      Reply
  7. Joe

    Hello Oscar,
    Im currently running a Kombini Dshot, and i either have to put telemetry or smart audio on a softserial. which one would you recommend to go on the softserial port?

    Reply
  8. RipTwist

    Hello Oscar,
    I’m in a bit of a pickle with my FC. I’m using a Cicada F4 AIO. I like the board and works great in my purple 215 since there is such limited space. I was pushing it pretty close to some tree tops and managed to have a twig lodge underneath my camera and rip the sbus pad right off the board. Everything else on the board is working just fine (motors spin, OSD in/out work). So I’ve been trying to get my Sbus to work on another pad and I can’t quite figure it out. I have used the resource commands and softserial to try to move it to the LED pad as well as the rx6 pad. Neither one has worked out. I’m also using an XM+ if that makes any difference ( probably not, just minus tlm). Any advice or guidance would be greatly appreciated.

    Thanks,
    RipTwist

    Reply
    1. Monto

      If you are using FrSky with Fport capable RX, you are in luck. all you need is to connect the fport RX to any spare TX and you are done! It works for me on two quads running R-XSR.

      Reply
  9. Monto

    Did anyone successfully get the soft serial to work on Omnibus F4 v3? I’ve tried many different pins without much success, and am wondering if this FC supports it at all.

    Reply
    1. Thomas

      I don’t think u need oft serial on an omnibus f4. I just got the omnibus f4 pro corner and it has a built in inverter/unconverted on hart 3&6. You just have to use the jumper on the board to enable it

      Reply
  10. FarmerBoyFPV

    Hey guys. Dealing with the midguard f4 or same as racerstar starF4 as they only have 2 uarts and no osd I am trying to do sbus telem and irc tramp tel on a maytek vtx. I’ve tried remapping two pins now, both with the smartport and vtx on soft serial. Here is the crazy thing, everything works right after i set it up, but after 1 power cycle it will no longer work… Is this a glitch? Firmware soft serial or what? I’ve googled everywhere and cant find an answer.

    Reply
  11. Arturo

    Hi Oscar, I´m trying to get tlm but in my taranis i can´t see data. I´ve enable softserial, resourde serial tx 1. All is ok but i can´t see the data, it doesn´t appear new sensors. What can i do? thanks

    Reply
  12. justin holman

    # resource
    resource BEEPER 1 B04
    resource MOTOR 1 B00
    resource MOTOR 2 B01
    resource MOTOR 3 A03
    resource MOTOR 4 A02
    resource MOTOR 5 A01
    resource MOTOR 6 A08
    resource PPM 1 B08
    resource PWM 1 B08
    resource PWM 2 B09
    resource PWM 3 C06
    resource PWM 4 C07
    resource PWM 5 C08
    resource PWM 6 C09
    resource LED_STRIP 1 A08

    # resource led_strip 1 none
    Resource is freed

    # resource SERIAL_TX 11 a08
    Invalid

    # resource motor 6 none
    Resource is freed

    # resource serial_tx 11 a08
    Invalid
    any ideas?

    Reply
  13. Guillaume K

    Hi, i break the usb port, can i use some other way to acces to the card? (like vp dm dp?)
    i try to use uart1 and ftdi but you have to configute it in betaflight…
    thank a lot

    Reply
  14. MATTHEW NEALE

    I had the Tramp hv working with BF lua script. I changed out my xsr for an r-xsr but I went back to xsr. Since then I have been unable to get the VTX values in the BF lua script. Smart port will work on uart 3, however uart6 seems to be non-functional. I have tried cli command to tlm inversions both on and off, I have conductivity between the TX6 pad and the pin entering the IRC tramp telemetry. Pids and rates are showing, vtx selected in config, port setup to UART6 IRC tramp. Literally 6 weeks I’ve been trying to solve this :-/

    Reply
  15. Pawx

    Can you remap the LED pins to be I2C SDA and SCL? trying to make a GPS build with cramped spaces and the FC i have that fits does not have these ports.

    Reply
  16. Daniel

    Best explanation of soft serial I’ve seen.
    Your led_strip example worked great on a spracingf3 board where the uarts are too few!

    Reply
  17. Bas

    I get his error
    # resource
    resource BEEPER 1 B04
    resource MOTOR 1 B00
    resource MOTOR 2 B01
    resource MOTOR 3 A03
    resource MOTOR 4 A02
    resource PPM 1 B09
    resource LED_STRIP 1 B07
    resource SERIAL_TX 1 A09
    resource SERIAL_TX 3 B10
    resource SERIAL_TX 4 A00
    resource SERIAL_TX 6 C06
    resource SERIAL_RX 1 A10
    resource SERIAL_RX 3 B11
    resource SERIAL_RX 4 A01
    resource SERIAL_RX 6 C07
    resource INVERTER 3 C15
    resource LED 1 B05
    resource LED 2 B06
    resource SPI_SCK 1 A05
    resource SPI_SCK 3 C10
    resource SPI_MISO 1 A06
    resource SPI_MISO 3 C11
    resource SPI_MOSI 1 A07
    resource SPI_MOSI 3 C12
    resource ESCSERIAL 1 B00
    resource CAMERA_CONTROL 1 B07
    resource ADC_BATT 1 C02
    resource ADC_CURR 1 C01
    Then i do
    resource SERIAL_TX 11 A09 to activate softserial 1 on A09
    Then i get this error
    index not between 1 and 10

    Reply
  18. JonnyVolts

    Hi Oscar, great article!
    I’m curious, can you use two devices over the one channel? For instance is it possible to run camera control and smart audio simultaneously?

    Reply
    1. Matt Mendez

      JB made a video on how to set this up (using softserial I believe). you can run both simultaneously. Requires some HW mods too but is definitely interesting.

      youtube.com/watch?v=xY4Ck0Sp8RQ

      Reply
      1. Oscar Post author

        On the same pin? No.
        I haven’t covered camera control, because I personally think it’s a bit complicated for what it does at the moment.
        As far as I know, new hardware/tech is coming, and it will be plug and play in the future so I wouldn’t bother with it now.

Leave a Reply

Your email address will not be published. Required fields are marked *

Are you Robot? *

For prompt technical support, please use our forum IntoFPV.com. I check blog comments weekly.