Skip to content

Conversation

@haslinghuis
Copy link
Member

@haslinghuis haslinghuis commented Aug 30, 2025

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 JHEF722PRO flight controller.
    • Onboard ICM42688P gyro/accelerometer and DPS310 barometer enabled.
    • Flash-based Blackbox storage and MAX7456 OSD support added.
    • OSD, beeper, LED strip, camera control, PINIO outputs, multiple UARTs and I2C ports available.
    • Preconfigured motor/servo outputs, timer mappings, sensor alignment, and ADC-based voltage/current/RSSI sensing with defaults.
    • User boxes for 10V BEC and COB exposed.

@haslinghuis haslinghuis self-assigned this Aug 30, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 30, 2025

Walkthrough

Adds a new board configuration header for the JHEF722PRO: MCU/board identifiers, enabled peripherals (ICM42688P, DPS310, flash, MAX7456), full pin and timer mappings, ADC/I2C/SPI instances, default devices/metrics, PINIO/box definitions, and gyro alignment.

Changes

Cohort / File(s) Change summary
New board config: JHEF722PRO
configs/JHEF722PRO/config.h
Introduces a complete hardware configuration header: sets FC_TARGET_MCU, BOARD_NAME, MANUFACTURER_ID; enables sensors/peripherals (accel/gyro with ICM42688P, baro DPS310, flash M25P16, MAX7456); defines beeper/motor/servo/PPM/LED/UART/I2C/SPI/camera/ADC/PINIO pins; adds TIMER_PIN_MAPPING, ADC/I2C/SPI instance selections, default blackbox/DSHOT/current/voltage settings, BEEPER_INVERTED, PINIO box IDs, gyro EXTI/CS/CLKIN pins and alignment, user box names, and PINIO1_CONFIG.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • add HDZERO_AIO15 #784 — similar board-specific config.h additions (sensor enables, SPI/CS pins, timer map, ADC/defaults), indicating parallel board bring-up work.

Suggested reviewers

  • ot0tot
  • nerdCopter
  • blckmn

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description is significantly incomplete compared to the required template. While the author has provided a checklist with their responses, the description entirely lacks the mandatory informational sections about the review process and hardware compliance requirements, any descriptive details about the JHEF722PRO board being added, and explanation of the actual changes being made. The template explicitly states to "Replace this text with details of your own," indicating that custom descriptive content should accompany the checklist, not replace it. The description is reduced to only a checklist without any context about what hardware is being submitted or why specific checklist items have been marked as complete or incomplete. The author should expand the pull request description to include a meaningful explanation of the JHEF722PRO hardware configuration, details about the board's specifications and purpose, and context for the checklist responses. Additionally, the description should retain or reference the mandatory information sections about Betaflight's review requirements and hardware compliance guidelines, and should include a housekeeping note confirming that the pull request is being made from a custom branch (which appears to be true based on the branch name "JHEF722PRO"). Each checklist item marked as incomplete should ideally have a brief explanation if relevant to the review process.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title "Add JHEF722PRO" is a concise, single-sentence summary that accurately describes the primary change in this PR — adding a new JHEF722PRO board configuration. It is specific, free of filler, and clearly communicates intent to reviewers. This makes it appropriate for history and quick scanning by teammates.
✨ 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.

@haslinghuis haslinghuis force-pushed the JHEF722PRO branch 4 times, most recently from 0cc866e to 75e8ff0 Compare August 30, 2025 21:19
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/JHEF722PRO/config.h (2)

91-100: Default DSHOT bitbang ON — consider AUTO if supported

If the F722 DMA layout is clean with this mapping, using AUTO (or OFF) can reduce CPU overhead versus always bitbanging. Keep ON if this target needs it for compatibility.


101-106: PINIO boxes/config — document semantics

Values (PINIO1_BOX=40, PINIO2_BOX=41, PINIO1_CONFIG=129) look fine; add a brief comment mapping 129’s bit fields to the intended behavior, and confirm box IDs don’t collide with target‑wide assignments.

📜 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 6424c23 and d6a23c9.

📒 Files selected for processing (1)
  • configs/JHEF722PRO/config.h (1 hunks)
🧰 Additional context used
🧠 Learnings (13)
📓 Common learnings
Learnt from: haslinghuis
PR: betaflight/config#814
File: configs/JHEF405PRO/config.h:109-109
Timestamp: 2025-06-08T22:02:28.961Z
Learning: The JHEF405PRO board does not actually use dual gyros despite having GYRO_2_SPI_INSTANCE defined in its configuration. It should not receive GYRO_COUNT or other dual-gyro related definitions since only the first gyro is supported.
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.
📚 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/JHEF722PRO/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 each config.h matches the directory name it resides in (e.g., configs/AXISFLYINGF7AIO/config.h must have #define BOARD_NAME AXISFLYINGF7AIO). This check is required for all Betaflight board configuration reviews.

Applied to files:

  • configs/JHEF722PRO/config.h
📚 Learning: 2025-07-03T15:17:30.040Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T15:17:30.040Z
Learning: In Betaflight configurations, when a target name suggests dual IMUs (like JHEF7DUAL) but specific hardware variants only have one gyro available, the preferred solution is to use DEFAULT_GYRO_TO_USE macro to specify which gyro to use by default rather than pruning gyro defines or creating redundant configurations. This approach maintains compatibility when the same target is used by multiple hardware variants from the same manufacturer.

Applied to files:

  • configs/JHEF722PRO/config.h
📚 Learning: 2025-06-23T18:43:31.746Z
Learnt from: haslinghuis
PR: betaflight/config#822
File: configs/AXISFLYINGH7MINI/config.h:29-37
Timestamp: 2025-06-23T18:43:31.746Z
Learning: In Betaflight configuration files, feature enablement macros like USE_MAG are build options that can be controlled at compile time, while hardware instance definitions like MAG_I2C_INSTANCE are predefined in board configurations to assist with hardware mapping when those features are enabled at build time.

Applied to files:

  • configs/JHEF722PRO/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/JHEF722PRO/config.h
📚 Learning: 2025-08-22T17:08:23.283Z
Learnt from: haslinghuis
PR: betaflight/config#879
File: configs/AIRBOTSUPERF4V2/config.h:42-45
Timestamp: 2025-08-22T17:08:23.283Z
Learning: In Betaflight board configurations, OSD feature flags like USE_OSD_SD (analog/MAX7456) and USE_OSD_HD (digital/MSP DisplayPort) are typically defined at build time by the build system, not in the individual board config.h files. Board configs can conditionally define OSD-related settings based on these build-time flags.

Applied to files:

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

24-28: BOARD_NAME/MCU/Manufacturer — OK

BOARD_NAME matches directory (JHEF722PRO) and MCU is correct for F722.


29-39: Feature set looks consistent with the hardware; confirm MAX7456 is present on all units

Good enables for ICM42688P, DPS310, flash, and MAX7456. If some production batches omit MAX7456, consider documenting or gating via build flag.


40-60: Motor/PPM/LED pin choices look standard

PC6–PC9 for motors and PA8 for LED strip are typical; PPM on PA3 sharing with UART2_RX is expected.

Please confirm the user docs note that PA3 is shared (PPM vs UART2 RX are mutually exclusive at runtime).


70-76: ADC pins and PC14 usage

ADC on ADC3 with PC0/1/2 is fine. PC14 as PINIO1 is okay on many boards; confirm this design does not populate an LSE crystal.


77-80: Gyro DRDY/CS/CLKIN — confirm CLKin timer/channel is valid

PB8 for GYRO_1_CLKIN is mapped below; ensure the chosen timer/channel can generate the target gyro clock (e.g., 24 MHz) within spec and board routing tolerances.


107-111: Instances and gyro alignment — verify orientation

SPI instances align with pin wiring; confirm GYRO_1_ALIGN=CW90_DEG matches the silkscreen orientation on shipped boards.


81-90: Missing JHEF722PRO config — verify F7 timer indices & DMA streams

  • configs/JHEF722PRO/config.h not found in the checked repo — cannot map the numeric timer indices in your TIMER_PIN_MAP to specific TIMx entries; provide the file or confirm which timer option each index selects.
  • Relevant timer mappings in src/platform/STM32/timer_stm32f7xx.c: PA3 → TIM2_CH4; PA8 → TIM1_CH1; PC6–PC9 → TIM3_CH1–CH4 (alternatively TIM8 CH1–CH4); PB8 → TIM10_CH1; PB0 → TIM3_CH3 or TIM1_CH2N (CH2N is a complementary output).
  • Action: ensure the numeric index in each TIMER_PIN_MAP selects a non‑complementary channel where motors/DSHOT are used (avoid CHxN), and check the DMA stream table in timer_stm32f7xx.c for conflicts between motor DMA, LED_STRIP and SPI (blackbox) before enabling hardware DSHOT.

61-69: SPI3 MOSI on PB5 — confirmed (F7 mapping present)
Confirmed: src/platform/common/stm32/bus_spi_pinconfig.c contains PB5 entries mapped to SPI3 (GPIO_AF6_SPI3 / GPIO_AF7_SPI3); SPI3_SDO = PB5 is valid. See src/platform/common/stm32/bus_spi_pinconfig.c:150,232,339,480.

Copy link
Member

@nerdCopter nerdCopter left a comment

Choose a reason for hiding this comment

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

  • pre-approving for workflow

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