Skip to content

Conversation

@haslinghuis
Copy link
Member

@haslinghuis haslinghuis commented Apr 16, 2025

Summary by CodeRabbit

  • New Features
    • Added support for the BROTHERHOBBYH743 flight controller board with detailed hardware configurations for motors, servos, LEDs, sensors, OSD, SD card, barometer, magnetometer, UART ports, and configurable pins.

@haslinghuis haslinghuis force-pushed the brotherhobbyh743 branch 2 times, most recently from 213d845 to e37c196 Compare April 16, 2025 11:02
@haslinghuis
Copy link
Member Author

@ot0tot @nerdCopter

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 19, 2025

"""

Walkthrough

A new configuration header file for the BROTHERHOBBYH743 flight controller is introduced. This file specifies hardware mappings, sensor configurations, peripheral assignments, timer mappings, DMA options, and board identification macros for the STM32H743 MCU platform, enabling support for board-specific features and components.

Changes

File(s) Change Summary
configs/BROTHERHOBBYH743/config.h Added new configuration header defining board name, MCU target, pin assignments for LEDs, beeper, motors, servos, SPI buses, UARTs, ADC channels, SD card, sensors (dual SPI ICM42688P gyro/accel, barometer, magnetometer), OSD, timer pin mappings, DMA options, and related macros for the BROTHERHOBBYH743 flight controller.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Firmware
    participant BROTHERHOBBYH743 Board

    User->>Firmware: Select BROTHERHOBBYH743 target
    Firmware->>BROTHERHOBBYH743 Board: Apply config.h hardware mappings
    Firmware->>BROTHERHOBBYH743 Board: Initialize peripherals (motors, servos, sensors, OSD, SD card)
    Firmware->>BROTHERHOBBYH743 Board: Configure timers, DMA, and IO
    BROTHERHOBBYH743 Board-->>Firmware: Board ready for operation
Loading

Possibly related PRs

  • Add New Target DAKEFPVH743Pro #793: Both PRs add new configuration header files for STM32H743-based flight controller boards, defining similar sets of hardware mappings, sensor usage, and peripheral assignments, indicating they are related in purpose and structure though for different board targets.
  • Add AIKONF4V3 #715: Both PRs add new configuration header files for different flight controller boards, defining similar sets of macros for MCU targets, pin assignments, sensor enablement, SPI/I2C/UART interfaces, timer mappings, and peripherals like OSD and SD card, indicating they are related in purpose and structure but target distinct hardware.
  • KonexH743 motor output order #783: Both PRs add new configuration header files for STM32H743-based flight controllers with detailed hardware mappings, sensor setups, and timer pin mappings, indicating they are related in purpose and structure but target different specific boards.

Suggested reviewers

  • ot0tot
  • nerdCopter
    """

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 330b588 and e1cea82.

📒 Files selected for processing (1)
  • configs/BROTHERHOBBYH743/config.h (1 hunks)
🔇 Additional comments (6)
configs/BROTHERHOBBYH743/config.h (6)

1-22: LGTM: Standard licensing and header structure.

The GPL licensing header and pragma once guard are correctly implemented.


24-28: LGTM: Target and board identification properly defined.

The MCU target, board name, and manufacturer ID are correctly specified for the STM32H743-based BROTHERHOBBYH743 board.


83-93: LGTM: Comprehensive SD card configuration.

The SDIO configuration with 4-bit mode and default blackbox device assignment is well-configured for optimal SD card performance.


63-76: Verify dual gyro sensor configuration.

The dual ICM42688P sensor setup looks correct with different SPI instances and alignments. Ensure that the different alignment settings (CW90_DEG vs CW0_DEG) match the physical sensor orientations on the board.

#!/bin/bash
# Description: Verify ICM42688P sensor support and dual sensor configuration patterns in the codebase
# Expected: Find ICM42688P sensor definitions and examples of dual sensor setups

# Search for ICM42688P sensor definitions
rg -A 3 "ICM42688P" --type h --type c

# Search for dual gyro configuration patterns
rg -A 5 "GYRO_CONFIG_USE_GYRO_BOTH|DEFAULT_GYRO_TO_USE" --type h --type c

131-137: Verify PINIO configuration values.

The PINIO configuration uses specific config values (129) and box IDs (40, 41). Ensure these values align with the intended GPIO behavior and user interface integration.

#!/bin/bash
# Description: Verify PINIO configuration patterns and box ID usage
# Expected: Find similar PINIO configurations and validate config/box ID ranges

# Search for PINIO configuration patterns
rg -A 5 "PINIO.*_CONFIG.*PINIO.*_BOX" --type h

# Search for box ID definitions and ranges
rg -B 2 -A 2 "BOX.*4[01]" --type h --type c

139-151: I’m pulling the DMA/SPI assignments in the BROTHERHOBBYH743 config for clarity. This will help confirm whether the LED_STRIP’s DMA channel (14) is valid and doesn’t conflict with SPI3 or ADC1.

#!/bin/bash
file="configs/BROTHERHOBBYH743/config.h"
echo "── Around TIMER_PIN_MAPPING ──"
rg -n -B5 -A5 "TIMER_PIN_MAPPING" "$file"
echo; echo "── SPI3 DMA options ──"
rg -n "SPI3" "$file"
echo; echo "── All DMA options ──"
rg -n "DMA" "$file"
echo; echo "── BLACKBOX / SPI usages ──"
rg -nE "BLACKBOX|SPI[0-9]" "$file"
✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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.

Documentation and Community

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

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

145-158: Fix inconsistent indentation in timer pin mapping.

The timer pin mapping has inconsistent indentation - line 146 uses spaces while other lines use tabs.

 #define TIMER_PIN_MAPPING \
- 		TIMER_PIN_MAP(  0, MOTOR1_PIN,     2,  0 ) \
+		TIMER_PIN_MAP(  0, MOTOR1_PIN,     2,  0 ) \
 		TIMER_PIN_MAP(  1, MOTOR2_PIN,     2,  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 e3aaa6a and 55163d4.

📒 Files selected for processing (1)
  • configs/BROTHERHOBBYH743/config.h (1 hunks)
🔇 Additional comments (10)
configs/BROTHERHOBBYH743/config.h (10)

1-28: LGTM! Board identification and basic configuration are correctly defined.

The license header, pragma guard, MCU target, and board identification macros follow standard Betaflight conventions.


29-50: LGTM! LED, beeper, motor, and servo pin assignments are well-structured.

The pin assignments for LEDs, beeper (with proper inversion flag), 8 motor outputs, and 4 servo outputs are clearly defined and follow consistent naming conventions.


51-67: LGTM! SPI bus configurations are comprehensive and correctly defined.

All four SPI buses are properly configured with SCK, SDI, and SDO pin assignments following consistent naming patterns.


68-82: LGTM! Dual gyro/accelerometer configuration is correctly implemented.

The dual ICM42688P sensor setup with different SPI instances, chip select pins, external interrupt pins, and alignment settings (CW90_DEG vs CW0_DEG) provides redundancy and proper hardware integration.


83-99: LGTM! OSD and SD card configurations are properly defined.

The MAX7456 OSD configuration and SDIO-based SD card setup with 4-bit mode and proper pin assignments follow Betaflight standards.


100-109: LGTM! I2C sensor configurations are correctly implemented.

The I2C bus configurations for barometer (DPS310 on I2C2) and magnetometer (on I2C1) with proper pin assignments are well-defined.


127-143: LGTM! ADC and PINIO configurations are properly defined.

The ADC channels for battery voltage, RSSI, and current sensing with appropriate default scales, plus the two configurable PINIO pins with box assignments, are correctly configured.


160-169: LGTM! DMA configurations are appropriately defined.

The ADC and timer DMA options are properly configured for the STM32H743 platform.


110-126: Verify UART5 availability on this board.

The UART configuration defines UARTs 1,2,3,4,6,7,8 but UART5 is missing. Please confirm if UART5 is intentionally omitted due to hardware constraints or if this is an oversight.

#!/bin/bash
# Description: Check if other STM32H743 boards in the repository also omit UART5
# Expected: Find patterns of UART5 usage or omission in similar boards

echo "Searching for UART5 usage in STM32H743 configurations:"
fd -e h . configs/ | xargs rg "STM32H743" -l | xargs rg "UART5" -A 2 -B 2

echo -e "\nSearching for UART5 patterns in all configs:"
fd -e h . configs/ | xargs rg "UART5_" | head -10

152-158: ```shell
#!/bin/bash

Inspect Blackbox/SPI DMA settings in BROTHERHOBBYH743 config

echo "Checking DMA options in BROTHERHOBBYH743/config.h:"
rg -n "DMA" configs/BROTHERHOBBYH743/config.h || echo "No DMA definitions found."

echo -e "\nChecking SPI settings in BROTHERHOBBYH743/config.h:"
rg -n "SPI" configs/BROTHERHOBBYH743/config.h || echo "No SPI settings found."

echo -e "\nChecking Blackbox log interface definitions:"
rg -n "BLACKBOX" configs/BROTHERHOBBYH743/config.h || echo "No BLACKBOX definitions found."


</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

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/BROTHERHOBBYH743/config.h (1)

136-142: Clarify PINIO configuration values.

The PINIO pins use config value 129 and box assignments 40/41. Consider adding comments to explain what these specific values represent in the Betaflight context for future maintainability.

 // PINIO
+// PINIO config 129: [Add description of what this config enables]
+// Box 40/41: [Add description of the box function assignments]
 #define PINIO1_PIN                          PD10
 #define PINIO1_CONFIG                       129
 #define PINIO1_BOX                          40
 #define PINIO2_PIN                          PD11
 #define PINIO2_CONFIG                       129
 #define PINIO2_BOX                          41
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 55163d4 and bd59cfa.

📒 Files selected for processing (1)
  • configs/BROTHERHOBBYH743/config.h (1 hunks)
🔇 Additional comments (6)
configs/BROTHERHOBBYH743/config.h (6)

1-27: LGTM! Well-structured header and board identification.

The file follows proper Betaflight conventions with correct GPL licensing, pragma once guard, and appropriate MCU target definition for the STM32H743 platform.


68-81: Excellent dual gyro setup for redundancy.

The dual ICM42688P configuration provides excellent redundancy with proper SPI instance separation (SPI1 and SPI4), distinct chip select pins, and appropriate alignment settings. The CW90_DEG and CW0_DEG alignments suggest different physical orientations for each sensor.


88-98: Excellent SD card configuration using SDIO.

The SDIO interface configuration with 4-bit mode provides superior performance compared to SPI-based storage. The pin assignments and default blackbox device setting are appropriate for this high-performance flight controller.


110-125: Note: UART5 is not configured.

The configuration includes UART1-4, 6-8 but omits UART5. This might be intentional if UART5 conflicts with other peripherals or is reserved for internal use on this STM32H743 implementation.

#!/bin/bash
# Description: Check if UART5 is intentionally omitted or if it's used elsewhere
# Expected: Either find UART5 usage or confirm it's intentionally omitted

echo "Searching for any UART5 references in Betaflight configs..."
rg -r "UART5" configs/ --type h | head -10
echo -e "\nChecking STM32H743 UART5 availability in other configs..."
fd "config.h" configs/ --exec rg -l "STM32H743" {} \; | xargs rg "UART5" || echo "No UART5 found in other H743 configs"

36-49: Verify 8-motor configuration requirements.

The configuration supports 8 motor outputs (MOTOR1-MOTOR8), which is typical for octocopter setups. Ensure this aligns with the intended board capabilities and that the pin assignments don't conflict with other critical functions.

#!/bin/bash
# Description: Verify motor pin assignments don't conflict with other configurations
# Expected: No pin conflicts between motor pins and other peripheral pins

echo "Checking for pin conflicts in motor assignments..."
rg -A 2 -B 2 "P[A-E][0-9]+" configs/BROTHERHOBBYH743/config.h | \
grep -E "(PB0|PB1|PA0|PA1|PA2|PA3|PD12|PD13)" | \
sort | uniq -c | awk '$1 > 1 {print "Potential conflict: " $2}'

145-158: Verify timer channel assignments for motors.

The timer mapping uses channel indices 0-7 for motors, with some motors sharing timer 2. Ensure these channel assignments are valid for the STM32H743 timer configuration and don't exceed hardware limits.

#!/bin/bash
# Description: Verify timer channel assignments are within STM32H743 capabilities
# Expected: Confirm timer channels don't exceed hardware limits

echo "Analyzing timer channel assignments..."
grep "TIMER_PIN_MAP" configs/BROTHERHOBBYH743/config.h | \
awk '{print $4, $5}' | \
sort | uniq -c | \
awk '$1 > 4 {print "Warning: Timer " $2 " has " $1 " channels assigned"}'

echo -e "\nChecking similar H743 configurations for reference..."
fd "config.h" configs/ --exec rg -l "STM32H743" {} \; | \
head -3 | xargs rg -A 15 "TIMER_PIN_MAPPING" | head -20

@haslinghuis
Copy link
Member Author

@ot0tot should be ready now

@haslinghuis haslinghuis requested a review from ot0tot June 25, 2025 16:22
@haslinghuis haslinghuis merged commit 4b9a515 into betaflight:master Jun 25, 2025
2 checks passed
@haslinghuis haslinghuis deleted the brotherhobbyh743 branch June 25, 2025 18:17
This was referenced Jun 26, 2025
@coderabbitai coderabbitai bot mentioned this pull request Jul 24, 2025
1 task
@coderabbitai coderabbitai bot mentioned this pull request Aug 18, 2025
6 tasks
This was referenced Oct 11, 2025
This was referenced Oct 22, 2025
@coderabbitai coderabbitai bot mentioned this pull request Nov 12, 2025
6 tasks
@coderabbitai coderabbitai bot mentioned this pull request Dec 4, 2025
6 tasks
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