-
Notifications
You must be signed in to change notification settings - Fork 195
Add JHEH743PRO #907
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
base: master
Are you sure you want to change the base?
Add JHEH743PRO #907
Conversation
Caution Review failedFailed to post review comments WalkthroughAdds a new public Betaflight board configuration header for the STM32H743-based JHEH743PRO, declaring MCU/board IDs, enabled sensors/peripherals, pin/timer/DMA mappings, SPI/I2C/UART/ADC assignments, default runtime settings, and gyro alignment macros. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
f6607c6
to
49a09e4
Compare
49a09e4
to
95091ee
Compare
There was a problem hiding this 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 (3)
configs/JHEH743PRO/config.h (3)
98-100
: Note: PA15 as FLASH CS may disable full JTAG; ensure SWD-only is acceptable.Using PA15 for CS is common but precludes JTAG on production units. Just confirm SWD is the intended debug mode.
123-127
: DMA option set includes TIMUP5 but no TIM5 outputs are mapped; consider pruning or adding TIMUP2 if needed.
- Motors use TIM2 and TIM3; LED uses TIM1. Defining TIMUP5_DMA_OPT looks unused.
- If you ran into DMA stream conflicts on TIM2/TIM3, document them; otherwise, drop unused opts to reduce confusion.
131-138
: Defaults OK; please confirm meter scales and beeper inversion from hardware measurements.
- CURRENT/VOLTAGE scales (170/110) are common starting points but benefit from calibration.
- BEEPER_INVERTED depends on the transistor stage; quick bench test recommended.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
configs/JHEH743PRO/config.h
(1 hunks)
🧰 Additional context used
🧠 Learnings (14)
📓 Common learnings
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.
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.
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.
📚 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/JHEH743PRO/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/JHEH743PRO/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/JHEH743PRO/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/JHEH743PRO/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/JHEH743PRO/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/JHEH743PRO/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/JHEH743PRO/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/JHEH743PRO/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/JHEH743PRO/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/JHEH743PRO/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/JHEH743PRO/config.h
📚 Learning: 2025-08-21T11:11:19.213Z
Learnt from: haslinghuis
PR: betaflight/config#870
File: configs/ZEX_ATHENA_STD_PRO/config.h:54-55
Timestamp: 2025-08-21T11:11:19.213Z
Learning: For STM32H743 in Betaflight, UART4 can use PB8 (UART4_RX) and PB9 (UART4_TX) with GPIO_AF8_UART4, as confirmed in the official Betaflight codebase at src/platform/STM32/serial_uart_stm32h7xx.c. This is a valid pin mapping despite what some generic STM32 documentation might suggest.
Applied to files:
configs/JHEH743PRO/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/JHEH743PRO/config.h
🔇 Additional comments (7)
configs/JHEH743PRO/config.h (7)
26-28
: BOARD_NAME matches directory name; good.JHEH743PRO in the define matches configs/JHEH743PRO/. Manufacturer ID looks fine (4 chars).
101-108
: Both gyros share the same CLKIN (PD12); confirm the PCB ties both CLKINs together.This is fine if the clock net is shared on the board. If not, set only the present one(s).
128-130
: MAG_I2C_INSTANCE/BARO_I2C_INSTANCE without USE_MAG is fine.Board-level hints are helpful even when feature macros are compile-time selected.
144-147
: Gyro alignments: verify orientations match the silkscreen arrow(s).Wrong alignment will cause attitude errors; quick hover test or sensor tab check recommended.
78-90
: Incorrect — PB2 is a valid SPI3_SDO (MOSI) pin in this codebaseRepository search shows many H7 configs set SPI3_SDO_PIN = PB2 (e.g., configs/JHEH743_HD/config.h, configs/JHEH743PRO/config.h, configs/TMOTORH743/config.h, configs/MAMBAH743/config.h), so PB2 is an accepted mapping here and no platform change is required.
Likely an incorrect or invalid review comment.
53-68
: Confirm UART4 PD0/PD1 and UART5 PC12 are present in serial_uart_stm32h7xx.c
fd search couldn't locate serial_uart_stm32h7xx.c (searched 'src'); many configs (including configs/JHEH743PRO) define UART4_TX=PD1 / UART4_RX=PD0 and UART5_TX=PC12 — verify those mappings exist in src/platform/STM32/serial_uart_stm32h7xx.c and update this config to use only pins listed there if they do not.
111-121
: Confirm PD12 timer mapping for GYRO_CLKIN
- configs/JHEH743PRO sets GYRO_1_CLKIN_PIN / GYRO_2_CLKIN_PIN = PD12 and has TIMER_PIN_MAP( 9, PD12, 1, -1 ). (configs/JHEH743PRO/config.h:103,107,121)
- timer_stm32h7xx.c was not found by the verification script; many H7 configs treat PD12 as TIM4_CH1 (PWM-capable). Confirm timer_stm32h7xx.c maps PD12 to a PWM-capable channel (e.g., TIM4_CH1) or update the TIMER_PIN_MAPPING accordingly.
Checklist
Summary by CodeRabbit