Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Flight Controller Board: KIWI F405 12S Configuration

kiwif405-12s.jpeg

Buy Online Buy Online

Overview

KIWI F4.0 is a versatile flight controller based on the STM32F405, designed for FPV, wings, and autonomous platforms. The controller combines precision inertial sensing, OSD support, built-in Blackbox, and relay outputs for controlling external modules. Support for both Betaflight and ArduPilot allows this board to be used in a wide range of applications.

KIWI F4.0 is a reliable platform for building FPV drones, aircraft, and specialized autonomous systems with full support for Betaflight and ArduPilot. Thanks to flexible relay, sensor, and telemetry connectivity, the controller is ready for real-world mission use.

Firmware

Pinout and Diagrams

(Click to zoom in)

Features

  • Industrial-grade IMU Invensense ICM-42688P with external clock
  • Bosch BMP388 barometer for altitude measurement
  • Integrated 128Mbit Blackbox flash memory (W25Q128FV)
  • MAX7456 OSD chip for overlaying telemetry on analog video
  • High-precision voltage and current monitoring via ADC (VBAT, CURRENT)
  • GPIO-controlled relay outputs for powering VTX, cameras, or pyrotechnic systems
  • 4 motor PWM outputs (DShot, bidirectional on M1 & M3) + 6 auxiliary channels
  • USB Type-C with DFU firmware flashing support
  • Full CRSF / ELRS telemetry support (RSSI, LQ, SNR, Power)

Technical Specifications

  • MCU: STM32F405RG (168 MHz, 1024 KB flash)
  • Crystal: 16 MHz external oscillator
  • IMU: ICM-42688P (SPI2, rotation ROLL_180_YAW_90)
  • Barometer: BMP388 (I2C1, address 0x76)
  • OSD: MAX7456 (SPI1)
  • Flash Memory: W25Q128FV 128 Mbit (SPI3)
  • Dimensions: 36×36 mm, mounting 30.5×30.5 mm
  • LED: PC2 (active low)

Serial Ports

PortArduPilotDefault ProtocolPinsNotes
USBSERIAL0MAVLinkPA11, PA12OTG FS, Type-C
USART1SERIAL1RC InputPB6, PB7
USART2SERIAL2MAVLink2 (460800)PA2, PA3Alt: RC via TIM9
USART3SERIAL3GPS (115200)PC10, PC11
UART4SERIAL4SmartAudioPA0, PA1VTX control
UART5SERIAL5ESC TelemetryPC12, PD2NODMA

GPIOs, Relays, and AUX

Dedicated GPIO Pads

PadPinGPIODefaultArduPilot Relay Config
F+PC14103RELAY1RELAY1_PIN=103 (hwdef default)
U1PA4100Output LOWRELAY2_PIN=100, RELAY2_FUNC=1
U3PC15101Output LOWRELAY3_PIN=101, RELAY3_FUNC=1
U2PA10102Output LOWRELAY4_PIN=102, RELAY4_FUNC=1
LEDPC290Status LED

RELAY1 (F+ pad) works out of the box — pre-configured in hwdef. U1/U2/U3 need params set to use as relays.

PWM Outputs

OutputPinGPIOTimerFunctionDShot Bidir
PWM1PC950TIM8_CH4Motor 1Yes
PWM2PC851TIM8_CH3Motor 2No
PWM3PC752TIM8_CH2Motor 3Yes
PWM4PC653TIM8_CH1Motor 4No
PWM5PA854TIM1_CH1AUX 1No
PWM6PA955TIM1_CH2AUX 2No
PWM7PB1156TIM2_CH4AUX 3No
PWM8PB1057TIM2_CH3AUX 4No
PWM9PB1TIM3_CH4AUX 5No
PWM10PB0TIM3_CH3AUX 6No

PWM9/PWM10 have no GPIO ID in hwdef — PWM only. Other PWM pins can be reassigned to GPIO via SERVOn_FUNCTION=0 + RELAYn_PIN=<gpio>.

Relay Usage

MAVProxy:

param set RELAY2_PIN 100
param set RELAY2_FUNC 1
relay set 0 1    # RELAY1 ON (F+ pad HIGH)
relay set 0 0    # RELAY1 OFF
relay set 1 1    # RELAY2 ON (U1 pad HIGH)

Mission waypoint: DO_SET_RELAY — relay number 0-based (0=RELAY1), setting 1=ON / 0=OFF.

Lua:

relay:toggle(0)  -- toggle RELAY1
relay:on(1)      -- RELAY2 ON
relay:off(1)     -- RELAY2 OFF

All GPIO pads default LOW on boot. Use RELAY_DEFAULT params to set initial state.


Power Monitoring

  • Battery Voltage: PC0 (ADC1 IN10)
  • Battery Current: PC1 (ADC1 IN11)
  • Default monitor type: Analog (type 4)

Sensor Calibration

ParameterArduPilotBetaflight
Voltage scaleBATT_VOLT_MULT = 21.0voltage_meter_scale = 210
Current scaleBATT_AMP_PERVLT = 142.9current_meter_scale = 1052

Battery Voltage Thresholds (ArduPilot)

Parameter6S8S12S
Full charge25.2 V33.6 V50.4 V
BATT_ARM_VOLT22.229.644.4
BATT_LOW_VOLT21.028.042.0
BATT_CRT_VOLT19.826.439.6

SPI Bus Assignment

BusDeviceChip SelectSpeed
SPI1MAX7456PC310 MHz
SPI2ICM-42688PPC52/8 MHz
SPI3W25Q128FVPC13104 MHz

I2C Bus

  • I2C1: PB8 (SCL), PB9 (SDA) — BMP388 barometer at 0x76, external compass probing

Debug

  • SWDIO: PA13
  • SWCLK: PA14

Premium Features

Kiwi OSD Pinio Elements (Betaflight 2025.12+)

Custom OSD text elements that change based on PINIO switch state (User 1–4 boxes). Each element displays configurable ON/OFF text labels, useful for showing relay status, arming indicators, or mission state on the OSD.

CLI Settings

SettingDescription
kiwi_osd_pinioN_text_onText shown when User N switch is active
kiwi_osd_pinioN_text_offText shown when User N switch is inactive (use - to hide)
kiwi_osd_pinioN_posOSD screen position (341 = hidden)

Where N is 1–4 corresponding to PINIO1–PINIO4.

Example Setup

# Show SAFE/ARMED on OSD driven by User 2 switch
set kiwi_osd_pinio2_text_on = ARMED
set kiwi_osd_pinio2_text_off = SAFE
set kiwi_osd_pinio2_pos = 2242

# Show PARACHUTE only when User 3 switch is active, hidden when off
set kiwi_osd_pinio3_text_on = PARACHUTE
set kiwi_osd_pinio3_text_off = -
set kiwi_osd_pinio3_pos = 2274

# Assign User 2 to AUX3 switch (high position)
aux 3 41 3 1700 2100 0 0

# Assign User 3 to AUX2 switch (high position)
aux 4 42 2 1700 2100 0 0

save

Hardware Notes

On the KIWI F405 12S, only PINIO4 (PA4 / RELAY1) has a physical GPIO pin. PINIO1–3 are defined as NONE in the hardware config, but the OSD elements still work — the User box toggles the logical state, and the OSD text updates accordingly. No physical pin is needed for OSD-only use.


Camera Gimbal Support

KIWI F405 supports camera gimbals out of the box — both servo-based and MAVLink protocol gimbals (CADDX GM3 V2 and compatible).

Wire gimbal UART to any free serial port (gimbal TX → FC RX, gimbal RX → FC TX, GND).

ParamValueNotes
SERIALx_PROTOCOL2MAVLink2
SERIALx_BAUD115115200 bps
MNT1_TYPE6Gremsy (reboot after setting)
MNT1_PITCH_MIN-120GM3 V2 spec: ±120°
MNT1_PITCH_MAX120
MNT1_YAW_MIN-160GM3 V2 spec: ±160°
MNT1_YAW_MAX160
MNT1_RC_RATE60deg/s for rate control, 0 for angle

RC Control

Assign RC channels to control gimbal axes:

ParamValueNotes
RC6_OPTION213Mount1 Pitch
RC7_OPTION214Mount1 Yaw
RC8_OPTION212Mount1 Roll (3-axis gimbals only)

Example: with MNT1_RC_RATE=60, moving the RC6 stick deflects pitch at 60°/s. Set MNT1_RC_RATE=0 for direct angle control (stick position = gimbal angle).

Gimbal firmware must be V2.0 or higher.

Servo Gimbal

Connect pitch/yaw servos to AUX PWM outputs (PWM5–PWM8).

ParamValueNotes
MNT1_TYPE1Servo
SERVOx_FUNCTION6Mount1 Pitch (assign to desired output)
SERVOx_FUNCTION8Mount1 Yaw (assign to desired output)
MNT1_PITCH_MIN-90
MNT1_PITCH_MAX90
MNT1_YAW_MIN-170
MNT1_YAW_MAX170
MNT1_RC_RATE60deg/s for rate control, 0 for angle

Default Parameters

  • Frame: Quadcopter (FRAME_CLASS=1, FRAME_TYPE=3 BetaFlight X reversed)
  • Motor protocol: DShot (MOT_PWM_TYPE=5)
  • BLHeli passthrough: enabled (SERVO_BLH_AUTO=1, mask=15)
  • Flight mode channel: CH8
  • VTX: enabled, band 6, channel 4, freq 1240