-
Notifications
You must be signed in to change notification settings - Fork 184
Pilotix configs #858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Pilotix configs #858
Conversation
WalkthroughAdds 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15–20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this 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
📒 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 IdentifiersI wasn’t able to locate the
serialPortIdentifier_e
enum in the sandbox to cross-check these values. Please manually verify that the following assignments inconfigs/PILOTIXF405AIO/config.h
match the primary identifiers defined inserial.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., useSERIAL_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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Does not follow design requirements - kindly read all relevant info in https://betaflight.com/docs/development/manufacturer section.
- After schematics review first development samples can be produced.
- Do not sell hardware before requiring BF approval.
#define UART5_RX_PIN PD2 | ||
#define I2C1_SCL_PIN PB6 | ||
#define I2C1_SDA_PIN PB7 | ||
#define LED1_PIN PC13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See design guidelines
only one of these are true.. you've flight tested it |
Pull-Request requirements
Mandatory Review for All New Flight Controllers
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
Checklist (✓/✕, or y/n)
Summary by CodeRabbit