Betaflight Resource Remapping: Changing Motor Order and Moving Pins Around

Resource Remapping is an awesome feature in Betaflight, that allows you to swap some pins around on a flight controller. Using Resource Remapping there are so much you can do, for example, to change motor ordering, relocate pins in case of ripped-off solder pads, and many more!

Further Reading: More Tutorials on Betaflight Features.

Why you might need Resource Remapping?

  • Not enough UART TX/RX
  • Ripped solder pads
  • Requires more motor output for hexacopter configuration
  • Missing PPM receiver input
  • Missing programmable LED output
  • Servo output
  • Change motor output order

How does Resource Remapping work in Betaflight

There are many pins on a processor (as shown in the top image), and each pin might be assigned a specific function by Betaflight. Resource Remapping basically allows we to re-assign those pins with a different function.

This feature is available in Betaflight V3.1 or newer versions.

In Betaflight configurator CLI, type “resource”, it will return the available functions that we can change, and their current pin assignment:

# resource
resource BEEPER 1 C15
resource MOTOR 1 B07
resource MOTOR 2 B06
resource MOTOR 3 B05
resource MOTOR 4 B04
resource PPM 1 B03
resource PWM 1 B00
resource PWM 2 B01
resource SONAR_TRIGGER 1 B00
resource SONAR_ECHO 1 B01
resource SERIAL_TX 1 A09
resource SERIAL_TX 2 A14
resource SERIAL_TX 3 B10
resource SERIAL_TX 11 B01
resource SERIAL_RX 1 A10
resource SERIAL_RX 2 A15
resource SERIAL_RX 3 B11
resource SERIAL_RX 11 B00
resource LED_STRIP 1 A08

The format is as follow:

resource [Function] [Index] [Port]

To change a pin for a function, you just follow the same format, and enter save at the end.

In the following we will show you some of the common usage of Betaflight Resource Mapping.

One very important note about this is, some of the pins of the processor might be unused, and does not connect to any solder points on the flight controller. The port you are changing the function to should ideally be a breakout pin on the flight controller (somewhere you can solder to easily). Otherwise you might have to solder a wire directly to the extremely tiny “leg” on the processor, which is really hard to do.

How to change LED Strip Pin?

For example if you want to change LED strip to A09, simply type in CLI:

resource LED_STRIP 1 A09
save

How to change motor ordering in flight controller (swap motor outputs)

As an example, imagine we had a quad with wrong motor ordering right now, because you mistakenly rotated the flight controller by 90 degree clockwise. Don’t worry, you don’t need to redo your soldering and wiring, you can easily fix this with Resource Remapping!

3     4
  \ /
  / \
1     2

The correct motor ordering should be like this as we should all know:

4     2
  \ /
  / \
3     1

Now type in “resource” in CLI, and please make a copy of the result (in case of any problem you can just go back). Then find the 4 lines specifying the motor pin assignment:

resource MOTOR 1 B07
resource MOTOR 2 B06
resource MOTOR 3 B05
resource MOTOR 4 B04

To manage the issue more easily, we can write down the current motor ordering with the pin number next to them:

3(B05)  4(B04)
     \ /
     / \
1(B07)  2(B06)

Now it becomes much clearer pin and motor you need to swap, right?

B06 should be “motor 1”, B04 should be “motor 2”, etc…

Type in CLI:

resource MOTOR 1 B06
resource MOTOR 2 B04
resource MOTOR 3 B07
resource MOTOR 4 B05
save

And that’s it!

How to change buzzer (beeper) pin

It’s just as simple as the examples above… BUT!

You cannot just assign any pin for the buzzer, you need to do more!

That’s because the buzzer can draw a fairly large amount of current (more than the STM32 processor can handle), therefore there is usually a transistor in place. The transistor handles the current for the processor, and it’s controlled by a signal from the processor. If you connect the beeper directly to the STM32 processor you could potentially fry it.

It’s probably not a good idea moving buzzer pin around considering how much work this is. But if you do decide to move the buzzer to another pin, you will need to build an external power circuit like this. This is an example for the CC3D FC’s, for the most reliable choice of component and circuit please consult your own FC manufacturer.

Multiple functions sharing the same pin?

Sometimes a pin can be shared by multiple functions in Betaflight, if this is not your intent it’s best to free up the pin from tasks that are not required.

To check, simply enter “resource” in CLI. In this example, you can see that pin C08 is shared by two functions: LED_STRIP and CAMERA_CONTROL.

Further Reading: How to setup Camera Control in Betaflight?

If we are not using LED Strip, but camera control, you can free up pin C08 from LED_STRIP by typing this command in CLI:

resource LED_STRIP 1 none

That’s it! :)

7 thoughts on “Betaflight Resource Remapping: Changing Motor Order and Moving Pins Around

  1. presko

    hi Oscar it s Presko from France 🥐🥖….
    i have a problemon my Quad… what is name of the esc 5 on the FC in ressource list because i would like to change the pad signal of my esc 1 it was ripped …..so i want to use the signal pad 5 from the backside for my esc 1…
    i hope i am understandable

    thank you guy

    Reply
    1. Oscar Post author

      it’s usually labelled as motor 5.
      But not every FC has more than 4 motor outputs.
      I think you can use the LED pad.

      Reply
  2. Stewart

    Hi Oscar,

    I just had to remap my motors and had some issues following your guide. I checked on the RCgroups betaflight thread and was told I needed to unmap the motors first using the following commands

    resource MOTOR 1 NONE
    resource MOTOR 2 NONE
    resource MOTOR 3 NONE
    resource MOTOR 4 NONE

    This solved my issue. I am running betaflight 3.3 on this board.

    Reply
  3. Sanka

    Helo Oscar, Sorry for this long description/question!

    This resource mapping info was a great find. Thanks. I have a question and am a newbie also and having problems getting Ws2812B led strips working on my HGLRC XJB F428 (Omnibus F4 V2).

    The LED strip will not light up at all with my new FC and it did light up and work with my old HGLRC XJB F425 FC (that does not work anymore!)

    AM having BF 3.2.3 as from the factory on my quad on the connected F428 FC.

    I have done some voltage testing using a multimeter on the FC F428 and these are the results.

    1)I checked the resources mapping using the instructions from the Project Blue Falcon video and according to the board the Resource LED strip is on A01 and when I checked using a multimeter resource A01 which is actually pin 15 on the chip and kept the other probe on the labelled LED signal pad (as seen on the photo attached) there was a ‘beep’ so I assume the resource mapping is O.K.

    2) I checked the 5V line voltage on/at the actual LED strip PAD after the 1N4001 diode connection and the voltage was 4.67 Volts at that LED strip pad. The 5V LED line PAD on the FC before the diode connection is measured at 5.337 Volts. So the diode for sure has dropped the LED power voltage to the LED strip.

    3) The LED signal line voltage on the actual LED strip signal pad was measured at 1.403 volts. The LED signal line voltage on the LED signal PAD on the FC reads 2.059 Volts.

    4) Just a question – I enabled the Pr-earm mode in beta flight does this have anything to do with the LED not coming on?

    5) Just a question – I also before this enabled the LEDLOW mode in betafllight (I did not know what this was) and removed the mode also thereafter and is not active at all. Will this have something to do with the LEDs not working?

    6) The loop Ghz in configuration tab on BF on mine is at default 2Ghz, is this O.K ? or can this cause the LED not to function?

    7) When I connected the same LED strips to an ARDUINO board the same LEDs work and light up so the LEDs are working OK for sure also! and my LED settings on BF also gets saved!

    Again sorry for all this information, I feel based on the above checks and voltage reading and mapping checks that all that is O.K and for some reason the LED settings are not getting saved due to something.

    MY MAIN QUESTION
    (a) Should I change the resource mapping. For example when I connected a 2 LED with Buzzer strip and enabled the buzzer the buzzer worked and sound came out but not the LED lights. So should I remap using your instructions the LED signal to the buzzer to see if this works?
    (b) If I should not assign the LED to the buzzer what other pin could I assign safely. Below I have attached my current resource list fyi.

    Any help or advise will be great as am waiting for HGLRC to open after Chinese New Year holidays next week also !

    Thanks

    # resources
    Unknown command, try ‘help’
    # 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 B14
    resource PWM 1 B14
    resource PWM 2 B15
    resource PWM 3 C06
    resource PWM 4 C07
    resource PWM 5 C08
    resource PWM 6 C09
    resource LED_STRIP 1 A01
    resource SERIAL_TX 1 A09
    resource SERIAL_TX 3 B10
    resource SERIAL_TX 6 C06
    resource SERIAL_RX 1 A10
    resource SERIAL_RX 3 B11
    resource SERIAL_RX 6 C07
    resource INVERTER 1 C00
    resource LED 1 B05
    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 B14
    resource ADC_BATT 1 C02
    resource ADC_RSSI 1 A00
    resource ADC_CURR 1 C01

    # resource list
    Currently active IO resource assignments:
    (reboot to update)
    ——————–
    A00: ADC_RSSI
    A01: LED_STRIP
    A02: MOTOR 4
    A03: MOTOR 3
    A04: MPU_CS
    A05: SPI_SCK 1
    A06: SPI_MISO 1
    A07: SPI_MOSI 1
    A08: FREE
    A09: FREE
    A10: SERIAL_RX 1
    A11: USB
    A12: USB
    A15: OSD_CS
    B00: MOTOR 1
    B01: MOTOR 2
    B03: FLASH_CS
    B04: BEEPER
    B05: LED 1
    B06: FREE
    B07: FREE
    B08: FREE
    B09: FREE
    B10: FREE
    B11: FREE
    B12: FREE
    B13: FREE
    B14: FREE
    B15: FREE
    C00: INVERTER 1
    C01: ADC_CURR
    C02: ADC_BATT
    C03: FREE
    C04: MPU_EXTI
    C05: FREE
    C06: FREE
    C07: FREE
    C08: FREE
    C09: FREE
    C10: SPI_SCK 3
    C11: SPI_MISO 3
    C12: SPI_MOSI 3
    D02: FREE

    Currently active DMA:
    ——————–
    DMA1 Stream 0: FREE
    DMA1 Stream 1: FREE
    DMA1 Stream 2: FREE
    DMA1 Stream 3: FREE
    DMA1 Stream 4: LED_STRIP
    DMA1 Stream 5: FREE
    DMA1 Stream 6: FREE
    DMA1 Stream 7: FREE
    DMA2 Stream 0: FREE
    DMA2 Stream 1: FREE
    DMA2 Stream 2: FREE
    DMA2 Stream 3: FREE
    DMA2 Stream 4: ADC
    DMA2 Stream 5: FREE
    DMA2 Stream 6: FREE
    DMA2 Stream 7: FREE

    Use: ‘resource’ to see how to change resources.

    Reply
  4. Shyam

    Can I remap the video out pin? I ripped that port on my Racerstar F4S. Can I use any other pin for this? How can I do that?

    Reply
    1. Oscar Post author

      No you cannot as video out and video in are not connected to the FC MCU, but the Max7345 chip for overlaying OSD in your video.

      Reply
  5. bvonbla

    Nice! This resource mapping thing also comes in handy on some flight controllers where dshot is not supported on all motor outputs. (I still don’t fully understand why that is).

    For example, on the PicoBLX flight controller. One of the motor outputs does not support dshot. But when we remap that motor to the pin where PPM would be connected to (and solder the signal wire of that motor to the PPM pin) then dshot can be used on all 4 motors!

    Reply

Leave a Reply

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

Are you Robot? *

I only check blog comments once or twice a week, if you want a quick reply you can post your question on this forum IntoFPV.com... You might get a faster response from me there (multirotor related only).