Skip to content

Add GD32H757VSTART FC board config file support#1104

Open
jianpingwu1 wants to merge 1 commit into
betaflight:masterfrom
jianpingwu1:gd32h7_start_config_support
Open

Add GD32H757VSTART FC board config file support#1104
jianpingwu1 wants to merge 1 commit into
betaflight:masterfrom
jianpingwu1:gd32h7_start_config_support

Conversation

@jianpingwu1
Copy link
Copy Markdown

@jianpingwu1 jianpingwu1 commented May 18, 2026

Add support for GD32H757V Start FC boards config file.
It has been successfully compiled and completed basic functionality testing on relevant hardware.

Summary by CodeRabbit

  • New Features
    • Added board support configuration for the GD32H757V1START flight controller, enabling sensor support (gyro, accelerometer, barometer), complete pin mappings, and hardware interface configurations (SPI, I2C, UARTs).

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Walkthrough

This PR introduces a new Betaflight board configuration header for the GD32H757VSTART_V02 flight controller. The file defines the target MCU (GD32H757VI), configures enabled sensor features (gyro, accel, barometer, flash, display), and specifies all hardware pin assignments including motors, communication interfaces (UART, I2C, SPI), LEDs, ADC inputs, and interrupt/chip-select lines for sensors and peripherals.

Changes

GD32H757VSTART_V02 Board Configuration

Layer / File(s) Summary
Board configuration macros
configs/GD32H757VSTART_V02/config.h
MCU target (GD32H757VI), board identifiers, enabled gyro/accel/baro/flash/display features, full pin mappings for motors 1–8, UARTs 0/1–4/6/7, I2C0/1, SPI0–3, LEDs, ADC inputs, gyro interrupt/CS, flash/display CS, USB detect, and timer routing. Includes ADC DMA option configuration, default blackbox storage, current/voltage meter defaults, and gyro SPI instance/alignment settings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

Betaflight Supported

Suggested reviewers

  • haslinghuis
  • ot0tot
  • sugaarK
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete. It lacks mandatory sections required by the template, including hardware compliance verification, checklist items, and schematics review confirmation. Complete the PR description by filling out all mandatory sections from the template, including hardware compliance checklist items and confirmation of required reviews (schematics, hardware testing, guidelines adherence).
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: adding a board configuration file for the GD32H757VSTART flight controller.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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.

❤️ Share

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

Copy link
Copy Markdown
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.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@configs/GD32H757VSTART_V02/config.h`:
- Line 72: UART7_TX_PIN and LED1_PIN are both defined as PE1 causing a hardware
pin conflict; check the board schematic to determine which function should keep
PE1 and update the other macro (either UART7_TX_PIN or LED1_PIN) to the correct
GPIO pin per the schematic so they are not the same pin; ensure the updated
definition uses the correct symbol name (UART7_TX_PIN or LED1_PIN) and matches
existing pin naming convention (e.g., PXn) used elsewhere in the file.
- Around line 150-154: The file defines PINIO1_BOX, PINIO2_BOX, PINIO3_BOX and
PINIO1_CONFIG, PINIO2_CONFIG while PINIO1_PIN and PINIO2_PIN are commented out
and PINIO3 has no PIN or CONFIG, so either re-enable the PINIO pins and fully
define PINIO3 (uncomment PINIO1_PIN and PINIO2_PIN, add PINIO3_PIN and
PINIO3_CONFIG consistent with PINIO1_CONFIG/PINIO2_CONFIG) if PINIO is intended,
or remove/comment out PINIO1_BOX, PINIO2_BOX, PINIO3_BOX, PINIO1_CONFIG, and
PINIO2_CONFIG to match the default/no-PINIO usage (ensure PINIO1_PIN, PINIO2_PIN
remain commented if removing).
- Line 78: UART6_RX_PIN is defined as PE7 but ESCSERIAL_PIN also uses PE7,
causing a hardware conflict; change one to a free GPIO (e.g., pick an unused
port/pin like PE8 or another verified free pin on this board) and update the
define for either UART6_RX_PIN or ESCSERIAL_PIN in config.h accordingly,
ensuring the chosen pin does not collide with other peripherals; alternatively
add a conditional guard (e.g., USE_ESCSERIAL or ENABLE_UART6) around the
ESCSERIAL_PIN or UART6_RX_PIN define so only one is active at build time and
document the choice in the config comment.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4242bc1c-9cfa-45cf-8b12-58ff3ef34274

📥 Commits

Reviewing files that changed from the base of the PR and between 6703db5 and 24ff88c.

📒 Files selected for processing (1)
  • configs/GD32H757VSTART_V02/config.h

#define UART3_TX_PIN PB8
#define UART4_TX_PIN PC12
#define UART6_TX_PIN PE8
#define UART7_TX_PIN PE1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Critical pin conflict: PE1 assigned to both UART7_TX and LED1.

Line 72 defines UART7_TX_PIN as PE1, and line 87 defines LED1_PIN as PE1. The same GPIO pin cannot serve two simultaneous functions. This will cause hardware configuration errors and unpredictable behavior.

🔧 Verify hardware schematic and correct the conflict

Please check the board schematic to determine:

  1. Which function should actually use PE1
  2. What the correct pin assignment should be for the other function

Then update one of these definitions accordingly.

Also applies to: 87-87

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@configs/GD32H757VSTART_V02/config.h` at line 72, UART7_TX_PIN and LED1_PIN
are both defined as PE1 causing a hardware pin conflict; check the board
schematic to determine which function should keep PE1 and update the other macro
(either UART7_TX_PIN or LED1_PIN) to the correct GPIO pin per the schematic so
they are not the same pin; ensure the updated definition uses the correct symbol
name (UART7_TX_PIN or LED1_PIN) and matches existing pin naming convention
(e.g., PXn) used elsewhere in the file.

#define UART2_RX_PIN PD9
#define UART3_RX_PIN PB9
#define UART4_RX_PIN PD2
#define UART6_RX_PIN PE7
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for similar PE7 dual-assignment patterns in other board configs
rg -n 'UART6_RX_PIN.*PE7' --type=c -A2 -B2
rg -n 'ESCSERIAL_PIN.*PE7' --type=c -A2 -B2

Repository: betaflight/config

Length of output: 659


🏁 Script executed:

# Search for ESCSERIAL_PIN definitions in all board configs to see if pin sharing is common
rg -n 'ESCSERIAL_PIN' --type=c | head -20

# Check for configuration guards around UART6_RX_PIN and ESCSERIAL_PIN
rg -B5 -A5 'UART6_RX_PIN|ESCSERIAL_PIN' configs/GD32H757VSTART_V02/config.h

Repository: betaflight/config

Length of output: 1838


🏁 Script executed:

# Search across all board configs for UART6_RX_PIN to see if this pattern appears elsewhere
find configs -name "config.h" -exec grep -l "UART6_RX_PIN" {} \;
find configs -name "config.h" -exec grep -l "ESCSERIAL_PIN" {} \;

Repository: betaflight/config

Length of output: 14257


🏁 Script executed:

# Check if there are any conditional definitions or comments indicating mutual exclusivity
rg -B10 'UART6_RX_PIN.*PE7|ESCSERIAL_PIN.*PE7' configs/GD32H757VSTART_V02/config.h

Repository: betaflight/config

Length of output: 595


🏁 Script executed:

# Search for any configuration guards or conditional definitions around PE7
rg -B20 'UART6_RX_PIN.*PE7' configs/GD32H757VSTART_V02/config.h | head -40

# Check if there are any comments explaining ESCSERIAL usage
rg -B5 'ESCSERIAL_PIN' configs/GD32H757VSTART_V02/config.h

# Search for any `#ifdef` or feature guards related to ESCSERIAL or UART6
rg '`#ifdef`.*ESCSERIAL|`#ifdef`.*UART6' --type=c

Repository: betaflight/config

Length of output: 669


🏁 Script executed:

# Check if there's any other board with the same pin sharing pattern
rg 'UART6_RX_PIN' --type=c -A50 | rg -B50 'ESCSERIAL_PIN.*PE' | grep -E 'configs/|UART6_RX_PIN|ESCSERIAL_PIN'

Repository: betaflight/config

Length of output: 6142


Fix PE7 pin conflict: UART6_RX_PIN and ESCSERIAL_PIN both defined as PE7.

This board is the only one in the codebase where UART6_RX_PIN and ESCSERIAL_PIN share the same pin (PE7). All other boards use distinct pins for these functions. Without conditional guards or runtime configuration to disable one, this creates a hardware conflict. Reassign one of these pins to an available GPIO.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@configs/GD32H757VSTART_V02/config.h` at line 78, UART6_RX_PIN is defined as
PE7 but ESCSERIAL_PIN also uses PE7, causing a hardware conflict; change one to
a free GPIO (e.g., pick an unused port/pin like PE8 or another verified free pin
on this board) and update the define for either UART6_RX_PIN or ESCSERIAL_PIN in
config.h accordingly, ensuring the chosen pin does not collide with other
peripherals; alternatively add a conditional guard (e.g., USE_ESCSERIAL or
ENABLE_UART6) around the ESCSERIAL_PIN or UART6_RX_PIN define so only one is
active at build time and document the choice in the config comment.

Comment on lines +150 to +154
#define PINIO1_BOX 40
#define PINIO2_BOX 41
#define PINIO3_BOX 42
#define PINIO1_CONFIG 129
#define PINIO2_CONFIG 129
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Inconsistent PINIO configuration: boxes and configs defined but pins are commented out.

Lines 150-154 define PINIO1_BOX, PINIO2_BOX, PINIO3_BOX, PINIO1_CONFIG, and PINIO2_CONFIG, but the actual PINIO pins (PINIO1_PIN and PINIO2_PIN) are commented out on lines 116-117. Additionally, PINIO3_BOX is defined without a corresponding PINIO3_CONFIG or PINIO3_PIN.

Based on learnings, config.h should only define settings that differ from defaults. If PINIO functionality is not being used (pins commented), the box and config macros should also be removed or commented out.

🔧 Recommended fix

Either uncomment the PINIO pins if the functionality is intended:

-// `#define` PINIO1_PIN PD10
-// `#define` PINIO2_PIN PD11
+#define PINIO1_PIN PD10
+#define PINIO2_PIN PD11
+#define PINIO3_PIN <appropriate_pin>  // Add if PINIO3 is needed
+#define PINIO3_CONFIG 129  // Add if PINIO3 is needed

Or remove/comment out the unused PINIO configuration:

-#define PINIO1_BOX 40
-#define PINIO2_BOX 41
-#define PINIO3_BOX 42
-#define PINIO1_CONFIG 129
-#define PINIO2_CONFIG 129
+// `#define` PINIO1_BOX 40
+// `#define` PINIO2_BOX 41
+// `#define` PINIO3_BOX 42
+// `#define` PINIO1_CONFIG 129
+// `#define` PINIO2_CONFIG 129
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#define PINIO1_BOX 40
#define PINIO2_BOX 41
#define PINIO3_BOX 42
#define PINIO1_CONFIG 129
#define PINIO2_CONFIG 129
// `#define` PINIO1_BOX 40
// `#define` PINIO2_BOX 41
// `#define` PINIO3_BOX 42
// `#define` PINIO1_CONFIG 129
// `#define` PINIO2_CONFIG 129
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@configs/GD32H757VSTART_V02/config.h` around lines 150 - 154, The file defines
PINIO1_BOX, PINIO2_BOX, PINIO3_BOX and PINIO1_CONFIG, PINIO2_CONFIG while
PINIO1_PIN and PINIO2_PIN are commented out and PINIO3 has no PIN or CONFIG, so
either re-enable the PINIO pins and fully define PINIO3 (uncomment PINIO1_PIN
and PINIO2_PIN, add PINIO3_PIN and PINIO3_CONFIG consistent with
PINIO1_CONFIG/PINIO2_CONFIG) if PINIO is intended, or remove/comment out
PINIO1_BOX, PINIO2_BOX, PINIO3_BOX, PINIO1_CONFIG, and PINIO2_CONFIG to match
the default/no-PINIO usage (ensure PINIO1_PIN, PINIO2_PIN remain commented if
removing).

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.

1 participant