FPV

Betaflight Resource Mapping

August 18, 2019
3545
Views

This is a quick rundown on betaflight resource mapping, how to remap motors and other pins in betaflight. RESOURCE pins are pins with software emulation, meaning physical pins such as power, video in and video out cannot be remapped.

The pin mapping refers to the physical mapping layout of the MCU pins as shown in the following pin out diagram.

First start by typing resource in the CLI for a list of current resource assignments.

resource

You should get a printout like this.

# resource
resource BEEPER 1 B05
resource MOTOR 1 C08
resource MOTOR 2 C06
resource MOTOR 3 C09
resource MOTOR 4 C07
resource MOTOR 5 B00
resource MOTOR 6 B01
resource PPM 1 B06
resource LED_STRIP 1 B06
resource SERIAL_TX 2 A02
resource SERIAL_TX 3 B10
resource SERIAL_TX 4 A00
resource SERIAL_TX 11 A09
resource SERIAL_RX 1 A10
resource SERIAL_RX 2 A03
resource SERIAL_RX 3 B11
resource SERIAL_RX 12 A01
resource INVERTER 1 C00
resource I2C_SCL 1 B08
resource I2C_SDA 1 B09
resource LED 1 B04
resource SPI_SCK 1 A05
resource SPI_SCK 2 B13
resource SPI_SCK 3 C10
resource SPI_MISO 1 A06
resource SPI_MISO 2 B14
resource SPI_MISO 3 C11
resource SPI_MOSI 1 A07
resource SPI_MOSI 2 B15
resource SPI_MOSI 3 C12
resource ESCSERIAL 1 B06
resource CAMERA_CONTROL 1 B03
resource ADC_BATT 1 C02
resource ADC_RSSI 1 C03
resource ADC_CURR 1 C01
resource FLASH_CS 1 B12
resource OSD_CS 1 A15
resource GYRO_EXTI 1 C04
resource GYRO_CS 1 A04
resource USB_DETECT 1 D02

Lets use the motor resources as an example. Here we are saying that all communications and commands for motor 1 will be sent out of PIN C08 of the MCU. If you find that spinning motor 1 physically spins motor 4 for example, then motor 1 would have the incorrect resource mapped to that pin. Therefor we can remap it to the correct pin for motor 1. In this example I will remap motor 1 to the correct pin.

Now we know that when we spool motor 1, motor 4 is physically spinning, so the resource assigned to motor 4 should be re-assigned to motor 1.

resource MOTOR 1 C07

All motors need to have resources assigned in order for the motors to initialize. If you make a mistake and map a motor to a pin which is not a motor resource, when you power up you will not get the following initialize tones from your motors. You will need to repeat the process.

I suggest writing down the original resource mapping so if things dont work out, you can paste it back in and start again from scratch. Also, I suggest writing down in notepad the the new resource mapping and pasting it all in in one go.

Now, lets remap the LED pin to the BUZZER pin. In the above resource print we can see what these pins currently have assigned.

resource LED_STRIP 1 B06
resource BEEPER 1 B05

So now, lets remap the LED pin to be present on the BUZZER pin.

resource LED_STRIP 1 B05
resource BEEPER 1 none

Thats it! Check out the video below for motor mapping example.

Leave a Reply