Skip to content

Add BROTHERHOBBYH743 #753

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

haslinghuis
Copy link
Member

@haslinghuis haslinghuis commented Apr 16, 2025

Summary by CodeRabbit

  • New Features
    • Added support for the BROTHERHOBBYH743 flight controller board, including hardware mappings for motors, servos, LEDs, sensors, OSD, SD card, barometer, magnetometer, 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

Copy link

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, sensor/peripheral mappings, timers, DMA, and 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

  • KonexH743 motor output order #783: Adds a configuration header for another STM32H743-based flight controller with similar hardware and sensor mappings.
  • Add New Target DAKEFPVH743Pro #793: Introduces a configuration header for a different STM32H743 flight controller board, with comparable peripheral and sensor definitions.
  • add HDZERO_AIO15 #784: Adds a configuration header for a different flight controller board, defining MCU, pins, sensors, and timers similarly but targeting a distinct platform.

Suggested reviewers

  • ot0tot
  • nerdCopter
✨ 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

@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

@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

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.

2 participants