How to Create a Target Configuration
1. Considerations for Target Configurations
1.1. General
Target Configurations are very flexible - anything that can be configured in Betaflight can be added to a Target Configuration. This is intentional, as it allows Target Configurations to be adapted to many different kinds of targets, from 'general purpose' flight controller boards over 'all in one' boards with on-board ESC and RX all the way to targets for 'ready to fly' craft that come pre-configured and pre-tuned.
However, this flexibility also puts the onus on target designers to be reasonable about what they add to the Target Configurations that they create and propose for publication. In general, Betaflight tries to minimise the risk of damage or injury to users, and to avoid configurations that will create problems and potential support issues for a majority of users of a particular target. We reserve the right to refuse to add Target Configurations that are in breach of these principles. Furthermore, target creators are advised to use common sense, and refrain from using configuration that is likely to annoy most users of their hardware - users are not likely to consider products from a manufacturer that has annoyed them in the past for future purchases.
Another expectation is that Target Configurations that are submitted for publication are tested - please, in the interest of your customers, do not submit untested configurations. Instructions on how to install Betaflight with a new and unpublished Target Configuration can be found here.
1.2. Minimum Configuration
The expectation is that a Target Configuration contains at least all of the settings to make the hardware on a board work for the user out of the box. The instructions in 2. can be used to create such a configuration from a legacy target. For any hardware that is not configured to work in the Target Configuration, Betaflight's answer to support requests for this hardware will be 'target X does not support this hardware'.
1.3. Don'ts
These are things that will result in a Target Configuration being rejected by Betaflight, such as:
- any settings that are equal to the defaults in the firmware (e.g.
resource ... NONE
). Having such settings included results in targets that are more likely to break with new versions of the firmware, and are therefore harder to maintain and more likely to cause support issues; - pre-setting any calibration settings that are dependent on and different for every board, like
acc_calibration
- these are designed for the user to be prompted to calibrate them when connecting to Betaflight Configurator, in order to get the correct calibration for their hardware; - Target Configurations that result in safety issues or a setup that is potentially illegal to be used where the user is, such as:
- setting
motor_pwm_protocol
to any digital protocol - if this default configuration is used with ESCs that do not support digital protocols, it is likely to result in motors spinning up as soon as a battery is connected. The default ofDISABLED
is safe, and the user will be asked to select a motor protocol that is appropriate for their ESCs when they connect to Betaflight Configurator. (Exception: If a Target Configuration is to be used for an all-in-one / RTF product only, an appropriate value formotor_pwm_protocol
for the on-board ESCs can be selected.) - pre-setting any VTX table settings - allowable values for these are governed by law in most countries, and it is up to the manufacturer / supplier of the VTX hardware and the user to make sure that they are complying with the laws in their country.
- setting
- setting any values that default to auto-detection (like
baro_hardware
,mag_hardware
) toNONE
- the default ofAUTO
is designed to work with no hardware present, and setting the value toNONE
will result in support issues from users wanting to add their own hardware. (Exception: Boards that do not have any pins or pads for an SPI or I2C bus exposed can define these settings asNONE
.) - pre-setting tuning settings for general purpose boards. Betaflight puts a lot of effort into shipping firmware with a default tune that is designed to work reliably across a wide range of hardware, and is extensively tested before every release. All of our documentation is based on this default tune. Adding a different tune to a Target Configuration will result in additional support issues from users for whom the instructions provided by Betaflight do not work. Furthermore, these custom defaults are likely to become outdated with future releases of Betaflight. (Exception: For Target Configurations that are used with only one RTF offering with fixed hardware, it may make sense to add a tune that is optimised for the hardware.)
1.4 Discouraged
Betaflight advises target creators against adding any setting to their Target Configuration if it is not strictly related to hardware configuration. Example settings that are discouraged:
- OSD element configuration;
- craft name;
- rates
All of these are really user preferences, and adding them as part of a Target Configuration just means that most customers of this hardware will have to spend extra time on reverting the presets before they can set up their own preferences. There are no strict rules here, and what is reasonable will be dependent on what type of target it is, but manufacturers are advised to use common sense.
2. Creating a Target Configuration for a New Board
These instructions explain how to create a new Target configuration. Creating Targets for a new board means you must start with a firmware for Your MCU and build up the required pin mappings. The firmware can be a generic one, or one you have built locally. Start with this firmware and then validate pin mappings and hardware functionality needed in the configuration file.