Skip to content

Conversation

eugenediatlov
Copy link

@eugenediatlov eugenediatlov commented Aug 12, 2025

Pull-Request requirements

Mandatory Review for All New Flight Controllers

  • All new flight controllers must undergo the Betaflight review process, regardless of whether they use an existing target.
  • Manufacturers may reuse the same target for multiple designs, but each new hardware release must be reviewed before approval.

Hardware Compliance Requirements

These measures help maintain high standards and ensure compatibility within the Betaflight ecosystem.

If you have any questions or need guidance, feel free to reach out to the Betaflight development team.

Housekeeping

  • Pilotix configs

Checklist (✓/✕, or y/n)

  • [y] passed schematics review
  • [y] passed hardware samples testing
  • [y] follows guidelines
  • [y] follows connector standards
  • [y] flight tested
  • [y] comments/issues resolved

Summary by CodeRabbit

  • New Features
    • Added support for PILOTIX F405 AIO and PILOTIX F405 V3 flight controllers.
    • Enables integrated gyro/accelerometer, barometer, OSD, and onboard flash logging.
    • Provides predefined motor outputs (up to 8–10), UART assignments for GPS, receiver, VTX/MSP, plus LEDs, LED strip, beeper, and USB detect.
    • Includes voltage/current sensing with calibrated defaults and ADC/DMA setup.
    • Sets sensible defaults for blackbox device, DShot behavior, and sensor alignment for a ready-to-fly experience.

Copy link
Contributor

coderabbitai bot commented Aug 12, 2025

Walkthrough

Adds two new Betaflight board configuration headers for PILOTIXF405AIO and PILOTIXF405V3 (STM32F405), defining board identity, sensor/peripheral enables, pin mappings (motors, UARTs, SPI/I2C/ADC, LEDs, beeper), timer mappings, default device settings, and peripheral instances/alignments. No changes to exported/public APIs beyond added macros in these headers.

Changes

Cohort / File(s) Summary of changes
PILOTIXF405AIO target
configs/PILOTIXF405AIO/config.h
New target header: defines MCU/board/manufacturer; enables ICM42688P ACC/GYRO, DPS310 BARO, W25Q128FV FLASH, MAX7456; sets motor (1–8), UART1/3/4/5/6, LEDs, beeper pins; SPI1/SPI3, I2C1, ADC pins; timer mapping for 8 motors; default meters/blackbox; SPI/I2C instances; serial port roles; gyro align.
PILOTIXF405V3 target
configs/PILOTIXF405V3/config.h
New target header: defines MCU/board/manufacturer; enables ACC/GYRO (MPU6000/ICM42688P), BARO (DPS310/BMP280/MS5611), FLASH W25Q128FV, MAX7456; extensive pinout (motors 1–8, UART1–5, LEDs, PPM, SPI1–3, I2C1, ADC, USB detect, PINIOs); 10-entry timer mapping; ADC3 with DMA; default meters/blackbox/DSHOT; peripheral instances (SPI/I2C); serial roles (GPS/SERIALRX/MSP), SERIALRX provider; gyro align.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Possibly related PRs

Suggested labels

New manufacturer

Suggested reviewers

  • haslinghuis
  • ot0tot
  • nerdCopter
  • sugaarK
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or `` to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c97b83a and ca31ae1.

📒 Files selected for processing (2)
  • configs/PILOTIXF405AIO/config.h (1 hunks)
  • configs/PILOTIXF405V3/config.h (1 hunks)
🧰 Additional context used
🧠 Learnings (13)
📓 Common learnings
Learnt from: haslinghuis
PR: betaflight/config#835
File: configs/HDZERO_HALO_MPU6000/config.h:44-56
Timestamp: 2025-07-14T16:16:56.822Z
Learning: For Betaflight board configurations of boards already in production, pin assignments in config.h files reflect the actual hardware design and cannot be changed, even if they present potential conflicts with debug interfaces. The configuration must match the physical board layout, not ideal software design preferences.
Learnt from: haslinghuis
PR: betaflight/config#822
File: configs/AXISFLYINGH7MINI/config.h:29-37
Timestamp: 2025-06-23T18:43:31.746Z
Learning: In Betaflight configuration files, feature enablement macros like USE_MAG are build options that can be controlled at compile time, while hardware instance definitions like MAG_I2C_INSTANCE are predefined in board configurations to assist with hardware mapping when those features are enabled at build time.
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the BOARD_NAME define in each config.h matches the directory name it resides in (e.g., configs/AXISFLYINGF7AIO/config.h must have #define BOARD_NAME AXISFLYINGF7AIO). This check is required for all Betaflight board configuration reviews.
Learnt from: haslinghuis
PR: betaflight/config#656
File: configs/IFLIGHT_F745_AIO/config.h:31-35
Timestamp: 2025-07-28T16:44:59.686Z
Learning: In Betaflight board configurations, when a board design uses the same physical gyro socket but different sensor variants across production batches (e.g., MPU6000 in older batches, ICM42688P in newer batches), the correct approach is to enable both sensor drivers (USE_GYRO_SPI_MPU6000 and USE_GYRO_SPI_ICM42688P) in the same configuration. This allows runtime auto-detection of which sensor is actually present without requiring separate board configurations for each hardware variant.
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the `BOARD_NAME` define in config.h files exactly matches the directory name where the config file is located. For example, if the config file is in configs/AXISFLYINGF7AIO/config.h, then the BOARD_NAME should be defined as "AXISFLYINGF7AIO". This ensures proper board identification and configuration loading in Betaflight.
Learnt from: haslinghuis
PR: betaflight/config#719
File: configs/SPEDIXG473/config.h:29-38
Timestamp: 2025-07-25T20:06:07.492Z
Learning: BMP280 and DPS310 barometer drivers in Betaflight do not require USE_I2C to be explicitly defined in board configurations. Out of 264 boards using these drivers, 259 (98%) work without USE_I2C defined, indicating that the I2C dependency is handled automatically by the build system.
📚 Learning: 2025-07-03T04:33:57.480Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the BOARD_NAME define in each config.h matches the directory name it resides in (e.g., configs/AXISFLYINGF7AIO/config.h must have #define BOARD_NAME AXISFLYINGF7AIO). This check is required for all Betaflight board configuration reviews.

Applied to files:

  • configs/PILOTIXF405AIO/config.h
  • configs/PILOTIXF405V3/config.h
📚 Learning: 2025-07-14T16:16:56.822Z
Learnt from: haslinghuis
PR: betaflight/config#835
File: configs/HDZERO_HALO_MPU6000/config.h:44-56
Timestamp: 2025-07-14T16:16:56.822Z
Learning: For Betaflight board configurations of boards already in production, pin assignments in config.h files reflect the actual hardware design and cannot be changed, even if they present potential conflicts with debug interfaces. The configuration must match the physical board layout, not ideal software design preferences.

Applied to files:

  • configs/PILOTIXF405AIO/config.h
  • configs/PILOTIXF405V3/config.h
📚 Learning: 2025-07-03T04:33:57.480Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the `BOARD_NAME` define in config.h files exactly matches the directory name where the config file is located. For example, if the config file is in configs/AXISFLYINGF7AIO/config.h, then the BOARD_NAME should be defined as "AXISFLYINGF7AIO". This ensures proper board identification and configuration loading in Betaflight.

Applied to files:

  • configs/PILOTIXF405AIO/config.h
  • configs/PILOTIXF405V3/config.h
📚 Learning: 2025-06-02T16:16:20.197Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-06-02T16:16:20.197Z
Learning: In STM32F405-based flight controller configurations, timer pin mappings must be carefully analyzed for DMA stream conflicts, especially between motor timers, LED strip timers, and SPI DMA assignments. Changes to TIMER_PIN_MAPPING should include verification that all required peripherals (motors, LED strip, blackbox SPI) can coexist without DMA conflicts.

Applied to files:

  • configs/PILOTIXF405AIO/config.h
  • configs/PILOTIXF405V3/config.h
📚 Learning: 2025-07-23T13:43:50.456Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-23T13:43:50.456Z
Learning: For Betaflight board configuration reviews, always verify that serial port defines (like ESC_SENSOR_UART, MSP_UART, GPS_UART, etc.) use valid SERIAL_PORT identifiers that match those defined in the Betaflight codebase at src/main/io/serial.h. Common valid identifiers include SERIAL_PORT_USART1, SERIAL_PORT_USART2, SERIAL_PORT_USART3, SERIAL_PORT_UART4, SERIAL_PORT_UART5, etc. Invalid identifiers like SERIAL_PORT_UART3 (should be SERIAL_PORT_USART3) will cause build failures.

Applied to files:

  • configs/PILOTIXF405AIO/config.h
  • configs/PILOTIXF405V3/config.h
📚 Learning: 2025-07-23T13:43:50.456Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-23T13:43:50.456Z
Learning: For Betaflight board configuration reviews, always verify that serial port defines use valid identifiers from the serialPortIdentifier_e enum in src/main/io/serial.h. Valid identifiers include: SERIAL_PORT_USB_VCP (20), SERIAL_PORT_SOFTSERIAL1 (30), SERIAL_PORT_SOFTSERIAL2 (31), SERIAL_PORT_LPUART1 (40), SERIAL_PORT_UART0 (50, if SERIAL_UART_FIRST_INDEX == 0), SERIAL_PORT_USART1 (51 or 50), SERIAL_PORT_USART2, SERIAL_PORT_USART3, SERIAL_PORT_UART4, SERIAL_PORT_UART5, SERIAL_PORT_USART6, SERIAL_PORT_USART7, SERIAL_PORT_USART8, SERIAL_PORT_UART9, SERIAL_PORT_USART10. While some aliases exist (like SERIAL_PORT_UART3 = SERIAL_PORT_USART3), prefer using the primary identifiers as referenced in the serialPortIdentifiers array to avoid build failures.

Applied to files:

  • configs/PILOTIXF405AIO/config.h
  • configs/PILOTIXF405V3/config.h
📚 Learning: 2025-05-31T17:01:39.423Z
Learnt from: haslinghuis
PR: betaflight/config#798
File: configs/FURYF4OSD/config.h:88-88
Timestamp: 2025-05-31T17:01:39.423Z
Learning: For STM32F4xx platforms, PB1 pin timer definitions are:
1 = DEF_TIM(TIM1, CH3N, PB1, 0, 0)
2 = DEF_TIM(TIM3, CH4, PB1, 0, 0) 
3 = DEF_TIM(TIM8, CH3N, PB1, 0, 0)
Timer instance 2 (TIM3, CH4) is the correct mapping for PB1 motor control on STM32F4xx platforms as defined in src/platform/STM32/timer_stm32f4xx.c

Applied to files:

  • configs/PILOTIXF405AIO/config.h
  • configs/PILOTIXF405V3/config.h
📚 Learning: 2025-07-14T15:41:14.364Z
Learnt from: ot0tot
PR: betaflight/config#834
File: configs/RADIOLINKF405/config.h:79-88
Timestamp: 2025-07-14T15:41:14.364Z
Learning: In STM32F405 configurations, PB1 typically maps to TIM3_CH4 and PC9 typically maps to TIM8_CH4. These are different timers and do not share DMA resources, so there is no conflict when both pins are used simultaneously (e.g., PB1 for LED_STRIP and PC9 for MOTOR4).

Applied to files:

  • configs/PILOTIXF405AIO/config.h
  • configs/PILOTIXF405V3/config.h
📚 Learning: 2025-06-23T18:43:31.746Z
Learnt from: haslinghuis
PR: betaflight/config#822
File: configs/AXISFLYINGH7MINI/config.h:29-37
Timestamp: 2025-06-23T18:43:31.746Z
Learning: In Betaflight configuration files, feature enablement macros like USE_MAG are build options that can be controlled at compile time, while hardware instance definitions like MAG_I2C_INSTANCE are predefined in board configurations to assist with hardware mapping when those features are enabled at build time.

Applied to files:

  • configs/PILOTIXF405AIO/config.h
  • configs/PILOTIXF405V3/config.h
📚 Learning: 2025-06-02T16:16:20.197Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-06-02T16:16:20.197Z
Learning: For Betaflight configurations, blackbox logging via SPI3 and LED_STRIP functionality can be mutually exclusive due to DMA stream conflicts on STM32F4 targets. This hardware limitation should be identified during timer configuration reviews.

Applied to files:

  • configs/PILOTIXF405AIO/config.h
📚 Learning: 2025-07-03T15:17:30.040Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T15:17:30.040Z
Learning: In Betaflight configurations, when a target name suggests dual IMUs (like JHEF7DUAL) but specific hardware variants only have one gyro available, the preferred solution is to use DEFAULT_GYRO_TO_USE macro to specify which gyro to use by default rather than pruning gyro defines or creating redundant configurations. This approach maintains compatibility when the same target is used by multiple hardware variants from the same manufacturer.

Applied to files:

  • configs/PILOTIXF405V3/config.h
📚 Learning: 2025-07-28T16:44:59.686Z
Learnt from: haslinghuis
PR: betaflight/config#656
File: configs/IFLIGHT_F745_AIO/config.h:31-35
Timestamp: 2025-07-28T16:44:59.686Z
Learning: In Betaflight board configurations, when a board design uses the same physical gyro socket but different sensor variants across production batches (e.g., MPU6000 in older batches, ICM42688P in newer batches), the correct approach is to enable both sensor drivers (USE_GYRO_SPI_MPU6000 and USE_GYRO_SPI_ICM42688P) in the same configuration. This allows runtime auto-detection of which sensor is actually present without requiring separate board configurations for each hardware variant.

Applied to files:

  • configs/PILOTIXF405V3/config.h
🔇 Additional comments (15)
configs/PILOTIXF405AIO/config.h (8)

24-26: Board name matches directory structure correctly.

The BOARD_NAME definition "PILOTIXF405AIO" matches the directory name, which is required for proper board identification in Betaflight.


28-36: Sensor configuration is consistent and appropriate.

The ICM42688P gyro/acc and DPS310 barometer configuration matches what's expected for a modern flight controller. Flash and MAX7456 OSD support are correctly enabled.


38-45: Motor pin assignments look correct for 8-motor configuration.

The motor pins use a mix of timer-capable pins across different STM32F405 timers, which is appropriate for an 8-motor configuration.


47-55: UART pin configuration is appropriate.

The UART pin assignments use standard STM32F405 UART pins. Note that UART5 only has RX configured, which is typical for ESC telemetry applications.


72-72: ESC serial configuration is correctly aliased.

The ESCSERIAL_PIN alias to UART5_RX_PIN is appropriate for ESC telemetry functionality.


91-97: Default configuration values are reasonable.

The blackbox flash device, DSHOT burst mode, ADC-based current/voltage metering, and current scale factor are all appropriate defaults for this hardware configuration.


101-104: SPI instance assignments are logical.

Flash and MAX7456 sharing SPI3, while gyro uses SPI1, is a good separation that should avoid bus conflicts. The gyro alignment of CW270_DEG matches the physical mounting orientation.


107-110: Manual Verification Required: Confirm Serial Port Identifiers

I wasn’t able to locate the serialPortIdentifier_e enum in the sandbox to cross-check these values. Please manually verify that the following assignments in configs/PILOTIXF405AIO/config.h match the primary identifiers defined in serial.h:

  • GPS_UART ➜ SERIAL_PORT_USART3
  • SERIALRX_UART ➜ SERIAL_PORT_UART4
  • ESC_SENSOR_UART ➜ SERIAL_PORT_UART5
  • VTX_SMARTAUDIO_UART ➜ SERIAL_PORT_USART6

Ensure each identifier exists in the serialPortIdentifier_e enum (e.g., use SERIAL_PORT_USART3 rather than any alias) to prevent build failures.

configs/PILOTIXF405V3/config.h (7)

24-26: Board name matches directory structure correctly.

The BOARD_NAME definition "PILOTIXF405V3" matches the directory name, which is required for proper board identification in Betaflight.


28-40: Comprehensive sensor support with multi-variant capability.

The configuration enables support for multiple gyro/accelerometer variants (MPU6000 and ICM42688P) and multiple barometers (DPS310, BMP280, MS5611). This approach allows runtime detection of different hardware variants using the same configuration, which is the recommended practice for boards that may have different sensor options across production batches.


43-87: Extensive pin configuration for feature-rich board.

The pin mappings include comprehensive UART, SPI, I2C, motor, and GPIO configurations. The inclusion of PINIO pins and USB detection indicates this is a well-featured flight controller. Pin assignments appear logical for STM32F405.


89-99: Timer mapping includes non-motor pins.

The timer mapping includes 10 entries, with PA3 (entry 0) mapped to RX_PPM_PIN and PB1 (entry 9) mapped to LED_STRIP_PIN, in addition to the 8 motor pins. This is appropriate for providing PWM/timer functionality to these peripherals.


104-106: Serial port assignments are valid and logical.

GPS on USART1, SERIALRX on USART2, and MSP on UART5 are all valid serial port identifiers and represent a logical assignment for the different functions.


108-127: Comprehensive default configuration with appropriate hardware mappings.

The configuration includes appropriate I2C instance assignments, default device selections, PINIO box configurations, and SPI instance mappings. The SERIALRX_PROVIDER set to CRSF and gyro alignment of CW90_DEG are reasonable defaults.


119-123: PINIO configuration follows standard conventions.

PINIO boxes 40, 41, 42 with config value 129 follow standard Betaflight PINIO conventions for auxiliary channel control of GPIO pins.

#define MOTOR5_PIN PB5
#define MOTOR6_PIN PB7
#define MOTOR7_PIN PC9
#define MOTOR8_PIN PB4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#define UART5_RX_PIN PD2
#define I2C1_SCL_PIN PB6
#define I2C1_SDA_PIN PB7
#define LED1_PIN PC13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See design guidelines

@sugaarK
Copy link
Member

sugaarK commented Aug 13, 2025

Checklist (✓/✕, or y/n)

  • [y] passed schematics review
  • [y] passed hardware samples testing
  • [y] follows guidelines
  • [y] follows connector standards
  • [y] flight tested
  • [y] comments/issues resolved

only one of these are true.. you've flight tested it
the rest haven't happened..
as @haslinghuis you need to read the guild lines and follow the compulsory ones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants