Skip to content

Conversation

@liyouluo
Copy link
Contributor

@liyouluo liyouluo commented Oct 17, 2025

Hi.

The schematic has been reviewed in Discord.

please check the config.

Summary by CodeRabbit

  • New Features
    • Added full support for the BetaFPV G473 V3 flight controller: STM32G4-class MCU support, ICM42688P accel/gyro, BMP280/DPS310 barometer options, onboard flash and video OSD support, beeper, four motor outputs, addressable LED strip, multiple UART/I2C/SPI ports, ADC battery/current sensing, timer/DMA mappings, and sensible defaults for sensors, telemetry and motor protocols.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 17, 2025

Walkthrough

Adds a new board configuration header for BETAFPVG473_V3 defining MCU, board/manufacturer IDs, enabled sensors/peripherals, extensive pin and timer mappings, DMA/peripheral instance settings, conditional UART/serialrx options, and default device/operation macros.

Changes

Cohort / File(s) Summary
Board & identifiers
configs/BETAFPVG473_V3/config.h
Adds FC_TARGET_MCU(STM32G47X), BOARD_NAME(BETAFPVG473_V3), MANUFACTURER_ID(BEFH)
Feature flags
configs/BETAFPVG473_V3/config.h
Enables USE_ACC, USE_GYRO, USE_ACC_SPI_ICM42688P, USE_GYRO_SPI_ICM42688P, USE_FLASH/USE_FLASH_M25P16, USE_MAX7456, USE_GYRO_CLKIN, USE_BARO (BMP280, DPS310)
Pins & peripherals
configs/BETAFPVG473_V3/config.h
Declares GPIO pin mappings for beeper, motors, LED strip, UART1–4 TX/RX, I2C1 SCL/SDA, LED0/LED1, SPI1–3 SCK/SDI/SDO, ADC_VBAT/ADC_CURR, FLASH_CS, MAX7456_CS, GYRO_1_CS/GYRO_1_EXTI/GYRO_1_CLKIN
Timers & DMA
configs/BETAFPVG473_V3/config.h
Adds TIMER_PIN_MAPPING associating timers/ports/channels to pins and defines ADC1_DMA_OPT / ADC2_DMA_OPT
Instances, alignment & defaults
configs/BETAFPVG473_V3/config.h
Sets MAX7456_SPI_INSTANCE, FLASH_SPI_INSTANCE, GYRO_1_SPI_INSTANCE, BARO_I2C_INSTANCE, MAG_I2C_INSTANCE, GYRO_1_ALIGN, DEFAULT_ALIGN_BOARD_YAW, DEFAULT_BLACKBOX_DEVICE, DEFAULT_DSHOT_BURST, DEFAULT_DSHOT_BITBANG, DEFAULT_CURRENT_METER_SOURCE, DEFAULT_VOLTAGE_METER_SOURCE, BEEPER_INVERTED, conditional MSP_DISPLAYPORT_UART and SERIALRX mappings

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • haslinghuis
  • ot0tot
  • nerdCopter

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description is substantially incomplete compared to the required template. The template explicitly requires multiple sections including mandatory review information, hardware compliance requirements, housekeeping notes, and critically, a detailed checklist covering schematics review, hardware testing, guideline compliance, connector standards, flight testing, and issue resolution. The provided description contains only three brief sentences with no checklist items marked, no documented evidence of compliance with the guidelines, and vague language ("please check the config") that does not fulfill the template requirements. While the description mentions schematic review in Discord and includes a "Schematics approved" label, this information is not properly documented in the required checklist format. The author should revise the pull request description to follow the provided template structure. Specifically, include and complete the checklist by marking which items have been verified (with ✓ or y/n), document that schematics have passed review, confirm hardware testing status, explicitly verify adherence to Betaflight guidelines and connector standards, indicate whether flight testing has been completed, and specify that any comments or issues have been resolved. This ensures all mandatory compliance requirements are properly documented for reviewer assessment.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Add BETAFPVG473_V3" directly and clearly summarizes the primary change in the pull request: adding a new configuration file for the BETAFPVG473_V3 flight controller board. The title is concise, specific, and free of vague language or unnecessary noise. A developer reviewing the repository history would immediately understand that this PR introduces support for a new flight controller model.
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

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9990ff2 and 8739aab.

📒 Files selected for processing (1)
  • configs/BETAFPVG473_V3/config.h (1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📚 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/BETAFPVG473_V3/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/BETAFPVG473_V3/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/BETAFPVG473_V3/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/BETAFPVG473_V3/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/BETAFPVG473_V3/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/BETAFPVG473_V3/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/BETAFPVG473_V3/config.h
🔇 Additional comments (7)
configs/BETAFPVG473_V3/config.h (7)

24-27: LGTM! Board identification is correct.

The BOARD_NAME matches the directory name, and the MCU target and manufacturer ID are properly defined.


29-39: Feature definitions look appropriate.

The peripheral and sensor definitions are standard for a flight controller with ICM42688P IMU, M25P16 flash, MAX7456 OSD, and barometer support.


41-74: Pin definitions appear comprehensive.

All required peripheral pins are defined. Since the schematic has been approved, these assignments should correctly reflect the hardware design.


84-85: ADC DMA options defined.

The ADC DMA options are set, which should be verified against timer DMA assignments to ensure no conflicts.


87-96: Conditional serial configuration is well-structured.

The conditional logic appropriately handles different receiver protocols (SBUS vs CRSF) and HD OSD configuration.


98-110: Default configurations are appropriate.

The peripheral instance assignments (SPI1 for gyro, SPI2 for OSD, SPI3 for flash) and default settings (bitbang DSHOT, ADC voltage/current monitoring, flash blackbox) are suitable for this flight controller configuration.


76-82: Mappings are consistent with other STM32G47X boards, but timer index accuracy requires verification against firmware source.

The timer pin mapping follows established patterns:

  • PB0, PB1, PB2 consistently map to timer 1 across all G473 variants (BETAFPVG473, V2, SPEDIXG473)
  • PB6 and PB9 on timer 2 is supported (precedent in SPEDIXG473)
  • DMA streams (0-5 for timers, 6-7 for ADC) do not conflict
  • GYRO_1_CLKIN_PIN with DMA -1 is correct (clock inputs don't require DMA)

However, the actual timer index correctness (whether timer index 1 corresponds to TIM3 vs TIM1, etc.) depends on timer_stm32g4xx.c definitions in the betaflight/firmware repository, which is not available in this config-only repository. The consistency across multiple G473 boards suggests the mapping is likely correct, but cannot be definitively verified here.


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.

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
#define BEEPER_INVERTED
#define MAX7456_SPI_INSTANCE SPI2
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#define MAX7456_SPI_INSTANCE SPI2
#define SYSTEM_HSE_MHZ 8
#define MAX7456_SPI_INSTANCE SPI2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants