Skip to content

Conversation

@haslinghuis
Copy link
Member

@haslinghuis haslinghuis commented Oct 11, 2025

  • EUNIFY

Checklist

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

Summary by CodeRabbit

  • New Features
    • Added support for the AIRBRAINH743 flight controller (STM32H743).
    • Enables gyro/accelerometer (ICM42688P), barometer (DPS310), onboard flash logging (W25N01G) and optional magnetometer.
    • Preconfigured up to 8 motor outputs, status LEDs, inverted beeper, and LED strip.
    • Ready-to-use UART, I2C and SPI ports, timer/DMA mappings, sensor alignment, and default blackbox, voltage and current meter settings.

@haslinghuis haslinghuis self-assigned this Oct 11, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 11, 2025

Walkthrough

Adds a new AIRBRAINH743 board configuration header (STM32H743) that declares MCU/board/manufacturer macros, enables sensors/peripherals (ICM42688P, DPS310, W25N01G), and provides comprehensive pin, timer, DMA, SPI/I2C/UART, ADC, beeper, pinio, and default meter/blackbox settings.

Changes

Cohort / File(s) Change Summary
New board config: AIRBRAINH743
configs/AIRBRAINH743/config.h
New board header introducing FC_TARGET_MCU, BOARD_NAME, MANUFACTURER_ID; enables gyro/accel (ICM42688P), baro (DPS310), flash (W25N01G), optional mag; defines motor/LED/UART/I2C/SPI/ADC/BEEPER/PINIO/FLASH pin mappings; adds TIMER_PIN_MAPPING macro block; sets ADC/TIM DMA options; assigns GYRO/FLASH SPI instances and alignment; sets default blackbox/current/voltage meter sources and scales; adds beeper inversion and pinio box/config constants.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Add GEPRC_TAKER_H743MINI #881 — Adds an STM32H743 board config header with overlapping macros and structures (sensors, TIMER_PIN_MAPPING, DMA options, pin mappings, SPI instances).

Suggested reviewers

  • ot0tot
  • nerdCopter
  • blckmn

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The provided description is largely incomplete compared to the template requirements. While the checklist items are technically present with appropriate checks marked, the description lacks substantive content: it provides only "EUNIFY" (likely a manufacturer name) without any context, explanation, or meaningful details about the hardware, changes, or compliance. The template explicitly calls for detailed sections on the review process, hardware compliance, design guidelines, and instructions to "replace this text with details of your own," but the author has provided minimal information beyond the checklist. This falls short of the expected description structure and detail level. The author should expand the pull request description to include meaningful details about the AIRBRAINH743 board, the manufacturer (EUNIFY), hardware specifications, and any relevant compliance or design information. The description should provide context beyond the checklist, such as key features, design decisions, and any notes relevant to reviewers. Following the template structure more closely would help ensure the description contains the information needed for a comprehensive review of the new flight controller target.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Add AIRBRAINH743" directly and clearly relates to the main change in the pull request, which introduces a new configuration header file for the AIRBRAINH743 flight controller target. The title is concise, specific, and provides sufficient clarity for a teammate scanning the repository history to understand that a new hardware target is being added. The title avoids vague terminology and noise, making it an effective summary of the primary change.
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 70b129e and 91b5861.

📒 Files selected for processing (1)
  • configs/AIRBRAINH743/config.h (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • configs/AIRBRAINH743/config.h

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.

fix timer PB1

Co-authored-by: Osiris Inferi <[email protected]>
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

♻️ Duplicate comments (2)
configs/AIRBRAINH743/config.h (2)

96-96: PB1 timer mapping is correct.

The timer mapping for PB1 uses timer index 2, which corresponds to TIM3_CH4 - the correct non-inverted channel for motor control on this pin for STM32H743.

Note: This addresses the concern raised in a previous review comment.


86-86: Critical: PINIO1_PIN is undefined.

PINIO2_PIN is defined here, but PINIO1_PIN is referenced in PINIO1_CONFIG and PINIO1_BOX (lines 117-118) without being defined. This will cause a compilation error.

Add the missing PINIO1_PIN definition. For example:

 #define ADC_CURR_PIN PC5
+#define PINIO1_PIN PX# // Replace PX# with actual pin
 #define PINIO2_PIN PB3 // USER2

Please verify the correct pin assignment from the hardware schematic.

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

37-38: Clarify barometer model in comment.

The comment indicates DPS368, but the macro uses DPS310. While these sensors are compatible, consider updating the comment to match the macro or explaining the compatibility to avoid confusion.

Apply this diff to clarify:

-#define USE_BARO_DPS310  //DPS368
+#define USE_BARO_DPS310  // DPS310/DPS368 compatible
📜 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 c70a9c1 and 5457379.

📒 Files selected for processing (1)
  • configs/AIRBRAINH743/config.h (1 hunks)
🧰 Additional context used
🧠 Learnings (9)
📚 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/AIRBRAINH743/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, PB0 can use multiple timer options including TIM1_CH2N, TIM3_CH3, and TIM8_CH2N as defined in timer_stm32h7xx.c. For CAMERA_CONTROL_PIN assignments, TIM3_CH3 (timer index 3) is the appropriate choice.

Applied to files:

  • configs/AIRBRAINH743/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/AIRBRAINH743/config.h
📚 Learning: 2025-09-01T19:58:52.049Z
Learnt from: haslinghuis
PR: betaflight/config#881
File: configs/GEPRC_TAKER_H743MINI/config.h:86-99
Timestamp: 2025-09-01T19:58:52.049Z
Learning: For STM32H743 PB0 in Betaflight, there are three timer options: TIM1_CH2N, TIM3_CH3, and TIM8_CH2N. Only TIM3_CH3 (timer index 2) is suitable for GYRO_CLKIN as the other two are complementary (N) channels. This is confirmed in timer_stm32h7xx.c.

Applied to files:

  • configs/AIRBRAINH743/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/AIRBRAINH743/config.h
📚 Learning: 2025-09-01T19:58:52.049Z
Learnt from: haslinghuis
PR: betaflight/config#881
File: configs/GEPRC_TAKER_H743MINI/config.h:86-99
Timestamp: 2025-09-01T19:58:52.049Z
Learning: For STM32H743 in Betaflight, PB0 has multiple timer options but only timer index 2 provides a non-complementary output suitable for GYRO_CLKIN functionality. The other timer options for PB0 are N channels (complementary outputs) which are not appropriate for CLKIN usage.

Applied to files:

  • configs/AIRBRAINH743/config.h
📚 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/AIRBRAINH743/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/AIRBRAINH743/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/AIRBRAINH743/config.h
🔇 Additional comments (3)
configs/AIRBRAINH743/config.h (3)

24-27: LGTM! MCU and board identifiers are correctly defined.

The BOARD_NAME correctly matches the directory name, and the MCU target is properly set for STM32H743.


102-107: LGTM! DMA options are properly configured.

The DMA channel assignments use sequential values appropriate for STM32H743 and avoid conflicts.


109-123: Configuration settings look good.

The I2C, SPI, blackbox, and meter configurations are properly set up and consistent with the pin definitions and enabled features.

Note: Ensure PINIO1_PIN is defined (as flagged in a separate comment) for the PINIO1 configuration to work correctly.

@haslinghuis haslinghuis requested a review from ot0tot October 21, 2025 17:00
@haslinghuis haslinghuis requested a review from ot0tot October 22, 2025 15:18
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