Skip to content

Conversation

@kedeng
Copy link
Contributor

@kedeng kedeng commented Sep 5, 2025

  • passed Betaflight team's schematics review
  • passed hardware samples testing
  • follows guidelines
  • follows connector standards
  • flight tested
  • comments/issues resolved

Summary by CodeRabbit

  • New Features
    • Added native support for the SPEEDYBEE F435 AIO ELRS flight controller.
    • Preconfigured sensors and peripherals, including accelerometer, gyro, barometer, beeper, LEDs, and onboard flash for Blackbox logging.
    • Default motor outputs and timer mappings for reliable DSHOT operation.
    • Ready-to-use UART/MSP, I2C, SPI, and ADC configurations for plug-and-play setup.
    • Built-in power/voltage metering defaults for improved telemetry and diagnostics.
    • Optimized system clock and peripheral settings tailored to this hardware variant.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 5, 2025

Walkthrough

Adds a new board-specific configuration header for SPEEDYBEE_F435_AIO_ELRS, defining MCU/board IDs, pin mappings, timer mappings, peripheral instances, serial/MSP mappings, and default feature settings for Betaflight.

Changes

Cohort / File(s) Summary
New board config header
configs/SPEEDYBEE_F435_AIO_ELRS/config.h
Introduces full hardware config: MCU/board IDs, feature enables, motor/LED/beeper pin maps, TIMER_PIN_MAPPING, UART/I2C/SPI/ADC assignments, system clock, MSP/serial maps, and defaults for blackbox/DSHOT/meter sources.

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • ot0tot
  • haslinghuis
  • nerdCopter

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description consists only of a checklist with all items marked as complete, but lacks the substantive description required by the template. The template explicitly instructs authors to "Replace this text with details of your own," which should include hardware information, design considerations, and context for the new board configuration. Additionally, the PR objectives indicate that hardware samples testing and comments/issues resolution are not actually checked, yet the author has marked these items as complete. Most critically, there are unresolved comments in the PR regarding the PC15 pin definition that contradict the claim that all comments/issues have been resolved. The description provides no actual explanation of the changes, the board's specifications, or why this configuration should be approved. The author should provide a comprehensive pull request description that includes: a detailed explanation of the SPEEDYBEEF435AIOELRS board and its specifications, clarification of the current status of all checklist items (particularly hardware samples testing and comments/issues resolution), addressing the unresolved PC15 pin comment from the reviewer, and any other relevant hardware design or configuration details. The description should go substantially beyond the checklist to demonstrate that the submission meets all requirements outlined in the template.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title concisely and accurately describes the main change by indicating the addition of the SPEEDYBEEF435AIOELRS board support and directly matches the changeset content. It is clear, focused, and free of unnecessary detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • 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

Comment @coderabbitai help to get the list of available commands and usage tips.

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: 0

🧹 Nitpick comments (1)
configs/SPEEDYBEEF435AIOELRS/config.h (1)

54-56: I2C2 on PH2/PH3: check alternate-function overlap with UART4.

AT32F435 often supports UART4 on PH2/PH3; your config uses them for I2C2, which is fine but precludes UART4 on those pins. Consider adding a note to prevent later conflicts.

Apply:

 #define I2C2_SCL_PIN            PH2
 #define I2C2_SDA_PIN            PH3
+// NOTE: PH2/PH3 are used for I2C2; on AT32F435 these pins can also map to UART4.
+// This target reserves them for I2C; UART4 on PH2/PH3 is not available.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e0af134 and f61c337.

📒 Files selected for processing (1)
  • configs/SPEEDYBEEF435AIOELRS/config.h (1 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 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#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.
Learnt from: haslinghuis
PR: betaflight/config#879
File: configs/AIRBOTSUPERF4V2/config.h:42-45
Timestamp: 2025-08-22T17:08:23.283Z
Learning: In Betaflight board configurations, OSD feature flags like USE_OSD_SD (analog/MAX7456) and USE_OSD_HD (digital/MSP DisplayPort) are typically defined at build time by the build system, not in the individual board config.h files. Board configs can conditionally define OSD-related settings based on these build-time flags.
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: haslinghuis
PR: betaflight/config#835
File: configs/HDZERO_HALO_MPU6000/config.h:29-35
Timestamp: 2025-07-14T16:16:50.628Z
Learning: GYRO_1_SPI_CLOCK_DIVIDER is not used in any Betaflight target configuration files. SPI clock frequency settings are not commonly configured at the target level.
Learnt from: ot0tot
PR: betaflight/config#872
File: configs/HGLRCH743/config.h:82-83
Timestamp: 2025-08-20T02:54:58.596Z
Learning: For Betaflight board configuration reviews, the definitive source for validating UART pin assignments is the serial_uart_{platform}.c file in the Betaflight codebase (e.g., serial_uart_stm32h7xx.c for STM32H7xx platforms), not generic MCU datasheets. These files contain the exact pin mappings that Betaflight supports for each UART peripheral.
Learnt from: ot0tot
PR: betaflight/config#681
File: configs/NYX405V1/config.h:26-28
Timestamp: 2025-07-14T15:47:16.394Z
Learning: In Betaflight configuration files, MANUFACTURER_ID values must be exactly 4 ASCII characters long, not 3 characters. All manufacturer IDs in the codebase consistently use 4-character identifiers like AIRB, FOSS, SPBE, MTKS, NERC, etc.
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.
📚 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/SPEEDYBEEF435AIOELRS/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 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/SPEEDYBEEF435AIOELRS/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/SPEEDYBEEF435AIOELRS/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/SPEEDYBEEF435AIOELRS/config.h
📚 Learning: 2025-08-20T02:54:58.596Z
Learnt from: ot0tot
PR: betaflight/config#872
File: configs/HGLRCH743/config.h:82-83
Timestamp: 2025-08-20T02:54:58.596Z
Learning: For Betaflight board configuration reviews, the definitive source for validating UART pin assignments is the serial_uart_{platform}.c file in the Betaflight codebase (e.g., serial_uart_stm32h7xx.c for STM32H7xx platforms), not generic MCU datasheets. These files contain the exact pin mappings that Betaflight supports for each UART peripheral.

Applied to files:

  • configs/SPEEDYBEEF435AIOELRS/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/SPEEDYBEEF435AIOELRS/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/SPEEDYBEEF435AIOELRS/config.h
📚 Learning: 2025-08-28T20:45:36.652Z
Learnt from: haslinghuis
PR: betaflight/config#888
File: configs/ZEX_ATHENA_MINI/config.h:0-0
Timestamp: 2025-08-28T20:45:36.652Z
Learning: In STM32H743 Betaflight configurations, PA15 maps to TIM2_CH1 (timer index 2) as defined in timer_stm32h7xx.c. When used for GYRO_CLKIN functionality, it's recommended to use the macro name GYRO_1_CLKIN_PIN in TIMER_PIN_MAPPING for consistency with other pin definitions.

Applied to files:

  • configs/SPEEDYBEEF435AIOELRS/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/SPEEDYBEEF435AIOELRS/config.h
📚 Learning: 2025-08-26T14:26:11.863Z
Learnt from: haslinghuis
PR: betaflight/config#883
File: configs/HGLRCF435_AIO/config.h:50-58
Timestamp: 2025-08-26T14:26:11.863Z
Learning: For AT32F435 in Betaflight, UART4 supports multiple pin options including PH2 (UART4_RX) and PH3 (UART4_TX) with GPIO_MUX_8, as confirmed in the official Betaflight codebase at src/platform/AT32/serial_uart_at32f43x.c. The AT32 platform has broader pin support than initially apparent from basic searches.

Applied to files:

  • configs/SPEEDYBEEF435AIOELRS/config.h
🔇 Additional comments (12)
configs/SPEEDYBEEF435AIOELRS/config.h (12)

26-28: BOARD_NAME and MANUFACTURER_ID look correct.

  • BOARD_NAME matches directory.
  • MANUFACTURER_ID is 4 chars (SPBE).

29-37: Confirm barometer presence (DPS310).

Many AIO ELRS boards ship without a baro. If DPS310 isn’t physically present, drop USE_BARO/USE_BARO_DPS310 to avoid probing overhead.


39-43: Motor pad pins: verify timer suitability.

PB6/PB7/PB0/PB1 are plausible, but please confirm their timer channels align with TIMER_PIN_MAPPING entries below for proper DSHOT+DMA.


57-63: SPI1 + gyro lines look standard; verify PA15 for EXTI.

PA15 as GYRO_1_EXTI_PIN is common; just confirm the INT line is indeed on PA15 on production boards.


64-68: Flash on SPI2 with CS=PC13: confirm electrical suitability.

PC13 (low-drive, slower slew on many MCUs) is usually OK for CS, but please confirm signal integrity with W25Q128 at your SPI clock.


69-74: ADC/VBAT/current and beeper/LED pins: LGTM.

PA0/PA1 for ADCs and beeper inversion match common designs.


89-94: I2C instances and gyro/flash instances: LGTM.

I2CDEV_2 for BARO/MAG and SPI1/SPI2 instances are consistent with the pin defines.


95-101: Defaults: blackbox/DSHOT/meter sources look fine; confirm current scale.

800 is plausible but board-specific. Please confirm shunt value and amplifier gain.


102-103: SERIALRX_UART port mapping verified
UART5_RX_PIN is PB8 and UART5_TX_PIN is PB9, matching SERIALRX_UART = SERIAL_PORT_UART5.


44-53: Verify AT32F43x UART pin assignments

  • UART1 (PA9/PA10) is standard.
  • UART2 RX-only on PA3 – ensure this is intentional.
  • UART5 (PB9/PB8) and UART7 (PB4/PB3) – confirm these pairs are supported by the AT32F43x UART implementation (src/platform/AT32/serial_uart_at32f43x.c in the main Betaflight repo).
  • Verify that SERIAL_PORT_UART5 and SERIAL_PORT_UART7 identifiers exist in the serial_port_identifier_e enum (src/main/io/serial.h in the main Betaflight repo).

84-87: Verify ADC1_DMA_OPT mapping
I couldn’t locate the DMA option lookup table in this repository; please confirm that setting ADC1_DMA_OPT to 11 is valid for ADC1 on the AT32F435 per the Betaflight DMA reference.


75-83: Verify timer channels, DMA resources and GYRO_1_CLKIN mapping (manual check required)

Could not locate AT32 timer/DMA hardware tables in the repo to fully verify; manual confirmation required:

  • Confirm MOTOR1–4 assignments in configs/SPEEDYBEEF435AIOELRS/config.h (TIMER_PIN_MAP around lines 75–83) — motors use timer indices 1 and 2. Ensure those timer/DMA streams do not conflict with LED_STRIP (TIMER_PIN_MAP entry for LED_STRIP_PIN -> timer 1 ch6) or SPI2 (SPI2_SCK PB13 / SPI2_SDI PB14) DMA usage.
  • Confirm LED_STRIP timer/channel choice uses a DMA stream separate from SPI2/blackbox SPI so LED updates won’t steal SPI DMA.
  • Confirm GYRO_1_CLKIN_PIN (PA2, defined in the same config) is mapped to a timer channel that supports external clock / input-capture on the target AT32 MCU.

If you want automated validation, point me to the platform timer table (timer_*.c or src/platform/AT32/ timer files) and I will re-run checks.

@kedeng kedeng force-pushed the SPEEDYBEEF435AIOELRS branch from 691f662 to 1203f06 Compare September 8, 2025 09:44
@haslinghuis haslinghuis requested a review from ot0tot September 8, 2025 15:32
@ot0tot
Copy link
Contributor

ot0tot commented Sep 9, 2025

@kedeng PC15 is defined as ELRS-PW_SWITCH. Does this need a PINIO assignment? Should this be high by default? Why was this included?

@kedeng
Copy link
Contributor Author

kedeng commented Sep 10, 2025

@kedeng PC15 is defined as ELRS-PW_SWITCH. Does this need a PINIO assignment? Should this be high by default? Why was this included?

The original design was to switch to external ELRS through PC15. But the updated version has removed external ELRS support, therefore this pin is no longer used.

@kedeng kedeng requested a review from ot0tot September 20, 2025 16:31
@kedeng kedeng changed the title Add SPEEDYBEEF435AIOELRS Add SPEEDYBEE_F435_AIO_ELRS Oct 13, 2025
@kedeng kedeng force-pushed the SPEEDYBEEF435AIOELRS branch from 785df4c to 0311c16 Compare October 14, 2025 09:51
@kedeng kedeng changed the title Add SPEEDYBEE_F435_AIO_ELRS Add SPEEDYBEEF435AIOELRS Oct 14, 2025
@haslinghuis haslinghuis requested a review from blckmn October 28, 2025 22:53
Copy link
Member

@sugaarK sugaarK left a comment

Choose a reason for hiding this comment

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

flight tested in tiny trainer racing sesh with leds
zero issues

@haslinghuis haslinghuis merged commit 8287828 into betaflight:master Oct 29, 2025
3 checks passed
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.

4 participants