Skip to content

Conversation

ThanYangFPV
Copy link
Contributor

@ThanYangFPV ThanYangFPV commented Oct 15, 2025

Add new target DAKEFPVH743_SLIM.

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 DAKEFPVH743_SLIM flight controller target.
    • Provides comprehensive hardware mappings for motors, servos, LEDs, beeper, timers, UART/SPI/I2C, ADCs, SD card, flash, and auxiliary pins.
    • Enables onboard peripherals: accelerometer/gyro (SPI variants), barometer, OSD, SD card logging, flash, and current/voltage sensing.
    • Applies sensible defaults for DSHOT, SDIO (4-bit), beeper polarity, gyro clocking/alignment, sensor scaling, and PID/ESC parameters to simplify setup.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 15, 2025

Caution

Review failed

Failed to post review comments

Walkthrough

Adds a new STM32H743 board configuration header for DAKEFPVH743_SLIM defining MCU/board/manufacturer IDs, enabled peripherals (sensors, baro, flash, OSD, SDIO), detailed pin/timer/DMA mappings, device instances, gyro/SDIO specifics, and default runtime settings.

Changes

Cohort / File(s) Summary
New board config header
configs/DAKEFPVH743_SLIM/config.h
Adds a complete STM32H743 board config: MCU/board/manufacturer macros, peripheral enable flags (ACC/GYRO/BARO/FLASH/MAX7456/SDCARD/SDIO), full pin mapping for motors/servos/LEDs/UART/I2C/SPI/ADC/aux, TIMER_PIN_MAPPING, DMA options, device instance macros (FLASH_SPI, MAX7456_SPI, BARO_I2C, MAG_I2C, GYRO_SPI instances), SDIO pin and detect settings, gyro CLKIN and alignment, default runtime settings (blackbox, DSHOT, meters, PID denom, serial mappings, beeper inversion, user-box mappings).

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 largely incomplete compared to the required template. The author has omitted several mandatory sections including the "Mandatory Review for All New Flight Controllers," "Hardware Compliance Requirements," and "Housekeeping" sections that explain the submission requirements and guidelines. While the checklist is present with all required items, the description lacks the essential context, explanatory text, and compliance information that the template specifies should accompany any new flight controller submission.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Add new target DAKEFPVH743_SLIM." clearly and specifically describes the main change in the pull request. The changeset introduces a new configuration header file for the DAKEFPVH743_SLIM flight controller board, and the title accurately captures this primary objective. The wording is concise, descriptive, and provides sufficient context for a developer reviewing the repository history to understand what was changed.
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

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
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 (2)
configs/DAKEFPVH743_SLIM/config.h (2)

109-110: Consider gyro clock pin configuration.

The configuration enables gyro clock input on PB7. While functionally correct, ensure the timer mapping at line 133 uses the macro name GYRO_1_CLKIN_PIN instead of the literal PB7 for consistency with Betaflight conventions.

Based on learnings.


119-134: Verify timer pin mappings for DMA stream conflicts.

The timer mappings assign motors to DMA channels 0-7 and the LED strip to DMA channel 8, with servos and camera control using DMA -1. On STM32H7 platforms, carefully verify that these DMA assignments don't conflict with SPI DMA streams used by flash (SPI3), MAX7456 (SPI2), gyros (SPI1/SPI4), or other peripherals.

Additionally, line 133 should use the macro name GYRO_1_CLKIN_PIN instead of the literal PB7 for consistency.

-    TIMER_PIN_MAP( 13, PB7,  1, -1) \
+    TIMER_PIN_MAP( 13, GYRO_1_CLKIN_PIN,  1, -1) \

Based on learnings.

📜 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 c940ae8 and 012dcb8.

📒 Files selected for processing (1)
  • configs/DAKEFPVH743_SLIM/config.h (1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📚 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/DAKEFPVH743_SLIM/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/DAKEFPVH743_SLIM/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/DAKEFPVH743_SLIM/config.h
📚 Learning: 2025-07-23T13:43:50.456Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-23T13:43:50.456Z
Learning: For Betaflight board configuration reviews, always verify that serial port defines (like ESC_SENSOR_UART, MSP_UART, GPS_UART, etc.) use valid SERIAL_PORT identifiers that match those defined in the Betaflight codebase at src/main/io/serial.h. Common valid identifiers include SERIAL_PORT_USART1, SERIAL_PORT_USART2, SERIAL_PORT_USART3, SERIAL_PORT_UART4, SERIAL_PORT_UART5, etc. Invalid identifiers like SERIAL_PORT_UART3 (should be SERIAL_PORT_USART3) will cause build failures.

Applied to files:

  • configs/DAKEFPVH743_SLIM/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/DAKEFPVH743_SLIM/config.h
📚 Learning: 2025-08-20T02:54:58.596Z
Learnt from: ot0tot
PR: betaflight/config#872
File: configs/HGLRCH743/config.h:82-83
Timestamp: 2025-08-20T02:54:58.596Z
Learning: For Betaflight board configuration reviews, the definitive source for validating UART pin assignments is the serial_uart_{platform}.c file in the Betaflight codebase (e.g., serial_uart_stm32h7xx.c for STM32H7xx platforms), not generic MCU datasheets. These files contain the exact pin mappings that Betaflight supports for each UART peripheral.

Applied to files:

  • configs/DAKEFPVH743_SLIM/config.h
🔇 Additional comments (2)
configs/DAKEFPVH743_SLIM/config.h (2)

178-180: Serial port identifiers are correctly defined.

The serial port assignments follow the correct naming convention:

  • SERIAL_PORT_UART5 for UART5
  • SERIAL_PORT_USART3 for USART3
  • SERIAL_PORT_USART2 for USART2

This matches the expected pattern where USART1-3 use SERIAL_PORT_USARTx and UART4-8 use SERIAL_PORT_UARTx.

Based on learnings.


60-75: Consolidate macro usage and verify mappings

  • Replace literal “PB7” in TIMER_PIN_MAPPING (line 133) with GYRO_1_CLKIN_PIN for consistency.
  • Manually confirm TIMER_PIN_MAPPING entries don’t reuse the same timer-channel pair.
  • Ensure SERIAL_PORT_UART5, SERIAL_PORT_USART3 and SERIAL_PORT_USART2 exist in serialPortIdentifier_e (src/main/io/serial.h).

Comment on lines 47 to 59
#define MOTOR1_PIN PA0 // M1 TIM2 CH1
#define MOTOR2_PIN PA1 // M2 TIM2 CH2
#define MOTOR3_PIN PA2 // M3 TIM2 CH3
#define MOTOR4_PIN PA3 // M4 TIM2 CH4
#define MOTOR5_PIN PD12 // M5 TIM4 CH1
#define MOTOR6_PIN PD13 // M6 TIM4 CH2
#define MOTOR7_PIN PD14 // M7 TIM4 CH3
#define MOTOR8_PIN PD15 // M8 TIM4 CH4

#define SERVO1_PIN PE9 // S1 TIM1 CH1
#define SERVO2_PIN PE11 // S2 TIM1 CH2
#define SERVO3_PIN PC8 // S3 TIM8 CH3
#define SERVO4_PIN PC9 // S4 TIM8 CH4
Copy link
Contributor

Choose a reason for hiding this comment

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

This configuration is not valid as explained in the Discord.

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