Skip to content

BuildOptions

neoxic edited this page Nov 11, 2024 · 3 revisions

Build options can be used to customize a build while avoiding the need to modify the source code. These options can be added to a new or existing target definition in the corresponding CMakeLists.txt file.

Common build options

IO_PA2

PB4/PA2 pinout selection (STM32F051, STM32G071xB, GD32F350).

IO_PA6

PB4/PA6 pinout selection (STM32G071xN).

IO_AUX

Enable two-wire communication via PA15:RX and PA2:TX when PA2 pinout is selected.

Bootloader build options

FAST_EXIT

Force the bootloader to pass control to the firmware as soon as possible. The only way to enter bootloader mode is via a software reset (bootloader probe via CLI).

Firmware build options

<PARAM>=X

Any default configuration value can be overriden using the corresponding uppercase option. For example, ARM=0 is equivalent to arm=0 (disable arming).

ANALOG

Enable direct analog mode. Startup music, arming and digital input including CLI are disabled.

ANALOG_CHAN=X

Override analog throttle ADC channel number.

DEAD_TIME=X

Dead time (clock cycles) [0..1023].

COMP_MAP=X

Motor phase to comparator input pin mapping (123, 231, 312, 321, 213, 132).

HALL_MAP=X

Hall sensor pin mapping.

SENS_MAP=X

Telemetry sensor pin mapping.

BEC_MAP=X

BEC voltage control pin mapping.

LED_MAP=X

Analog LED pin mapping.

LED_INV

Treat LED as active low. LEDx_INV can be used to invert individual pins.

LED_WS2812

Enable WS2812 RGB LED.

LED_STAT

Enable LED status indication. The following RGB status codes are used:

  • R: solid - temperature/voltage/current protection;
  • G: blinking slow/fast - forward/reverse, 1/2 duration - trap mode, 3/4 duration - sine startup mode;
  • B: blinking once/twice - passive/active drag brake;

In case of fewer availabe LEDs, patterns are combined.

TEMP_CHAN=X

Override ESC temperature sensor ADC channel.

TEMP_FUNC=X

Override ESC temperature sensor function.

TEMP_SENS=X

Motor temperature sensor.

VOLT_MUL=X

Voltage sensor multiplier (%).

CURR_MUL=X

Current sensor multiplier (mA/mV).

SERIAL_BR=X

Override native serial protocol baud rate (460800).

INVERTED_HIGH

Enable inverted high gate logic.

PWM_ENABLE

Enable PWM/EN driver logic.

FULL_DUTY

Enable 100% duty cycle driver support.

USE_HSE=X

Use external crystal oscillator running at X Mhz (STM32G431).

USE_PB1

PF0/PB1 pinout selection (STM32G431Cx).