-
Notifications
You must be signed in to change notification settings - Fork 221
Add HGLRC_H743_PRO board #944
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?
Conversation
WalkthroughAdds a new per-board configuration header for the HGLRC_H743_PRO (STM32H743) board that declares MCU/board metadata, feature flags, extensive pin/timer/DMA mappings, peripheral instances, and default meter/blackbox settings. Changes
Sequence Diagram(s)(omitted — configuration-only changes, no multi-component control flow) 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
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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 |
|
I will contact my colleagues and provide the latest schematics. |
|
I have updated the config.h file of HGLRC_H743_PRO according to the approved schematic diagram, please check it. |
|
@coderabbitai Please analyse why you approved this |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 81 🏁 Script executed: Length of output: 3929 🏁 Script executed: Length of output: 786 @osirisinferi You're absolutely right - I apologize for approving this configuration file with multiple errors. After analyzing the config.h file, I've identified the following issues: Issues Found in configs/HGLRC_H743_PRO/config.h:
These are fundamental configuration errors that should have been caught during the initial review. The duplicate definitions will cause compilation issues, and the incomplete UART5/I2C2 configurations suggest the file may not match the actual board schematic. Recommended actions:
I should not have approved this configuration without catching these errors. Thank you for bringing this to my attention. 🧠 Learnings used |
|
@coderabbitai: 4 things:
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 3929 🏁 Script executed: Length of output: 790 🏁 Script executed: Length of output: 87 🏁 Script executed: Length of output: 0 🏁 Script executed: Length of output: 154 🏁 Script executed: Length of output: 3200 🏁 Script executed: Length of output: 1641 🏁 Script executed: Length of output: 205 @osirisinferi You're absolutely correct, and I apologize for the errors in my previous analysis:
🐰😔 🧠 Learnings used |
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.
Rescinding my previous approval. Critical errors found in TIMER_PIN_MAPPING - all entries incorrectly use macro names instead of physical pin names.
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 5041 🏁 Script executed: Length of output: 815 🏁 Script executed: Length of output: 8652 🏁 Script executed: Length of output: 939 🏁 Script executed: Length of output: 113 🏁 Script executed: Length of output: 81 🏁 Script executed: Length of output: 800 🏁 Script executed: Length of output: 3510 🏁 Script executed: Length of output: 647 @osirisinferi You're absolutely right, and I apologize for my incorrect analysis. Let me address each point: My corrections:
Other issue confirmed:
I should have caught these critical DMA configuration errors during my initial review. Thank you for pushing me to analyze this properly. 🐰💭 ✏️ Learnings added
🧠 Learnings used |
I'll let you figure out which timer pin mapping entries are which. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 1730 🏁 Script executed: Length of output: 162 🏁 Script executed: Length of output: 334 🏁 Script executed: Length of output: 82 🏁 Script executed: Length of output: 1088 🏁 Script executed: Length of output: 860 🏁 Script executed: Length of output: 1364 🏁 Script executed: Length of output: 1014 🏁 Script executed: Length of output: 2878 🏁 Script executed: Length of output: 10784 🏁 Script executed: Length of output: 12963 🏁 Script executed: Length of output: 2844 🏁 Script executed: Length of output: 642 🏁 Script executed: Length of output: 2751 @osirisinferi Thank you for the guidance. Now I can see the three categories of TIMER_PIN_MAPPING issues: 1. DMAMUX / DMA Options IssueEven though STM32H743 has DMAMUX, DMA indices must still be unique per timer channel. The current config uses DMA index TIMER_PIN_MAP( 0, MOTOR1_PIN , 1, 0) \ // DMA 0
TIMER_PIN_MAP( 1, MOTOR2_PIN , 1, 0) \ // DMA 0 - CONFLICT
TIMER_PIN_MAP( 2, MOTOR3_PIN , 2, 0) \ // DMA 0 - CONFLICT
TIMER_PIN_MAP( 4, MOTOR5_PIN , 1, 0) \ // DMA 0 - CONFLICT
TIMER_PIN_MAP( 5, MOTOR6_PIN , 2, 0) \ // DMA 0 - CONFLICT
TIMER_PIN_MAP( 6, MOTOR7_PIN , 2, 0) \ // DMA 0 - CONFLICT
TIMER_PIN_MAP( 8, SERVO1_PIN , 2, 0) \ // DMA 0 - CONFLICT
TIMER_PIN_MAP( 9, SERVO2_PIN , 2, 0) \ // DMA 0 - CONFLICT
TIMER_PIN_MAP(10, SERVO3_PIN , 2, 0) \ // DMA 0 - CONFLICTProper H743 configs use sequential unique DMA indices (e.g., MAMBAH743 uses 0,1,2,3,4,5,6,7,14,0,0; MATEKH743 uses 0,1,2,3,4,5,6,7,-1,-1,8,-1,-1). 2. Non-existing Timer OccurrencesMultiple pins use timer occurrence indices that don't exist for those pins:
Reference evidence:
3. Complementary Timer ChannelWhen specifying a non-existent timer occurrence, the code may inadvertently select a complementary (N) channel if one exists at that occurrence index. Complementary channels (ending in "N" like TIM1_CH2N, TIM8_CH3N) are not suitable for motor/servo control. One or more of the incorrect occurrence indices above likely maps to a complementary channel. 4. Additional Issues Already Identified
This config requires substantial corrections before it can be approved. All timer occurrences and DMA indices need to be fixed to match the actual hardware capabilities. ✏️ Learnings added
🧠 Learnings used |
Please only use the appropriate
Your analysis is incorrect: there is actually a timer occurence in the timer pin map that actively selects a complementary channel. Further more, you still missed the fact that the |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 124 🏁 Script executed: Length of output: 1514 🏁 Script executed: Length of output: 1198 🏁 Script executed: Length of output: 376 🏁 Script executed: Length of output: 1536 🏁 Script executed: Length of output: 2196 🏁 Script executed: Length of output: 1135 @osirisinferi Thank you for the correction. Now using the actual timer definitions from Complete TIMER_PIN_MAPPING AnalysisPin Timer Definitions from timer_stm32h7xx.c:Motor pins:
Servo pins:
Other:
Issues in Current TIMER_PIN_MAPPING:1. Non-existent timer occurrences (6 entries): TIMER_PIN_MAP( 2, MOTOR3_PIN , 2, 0) // PE13 occurrence 2 doesn't exist (only has TIM1_CH3)
TIMER_PIN_MAP( 3, MOTOR4_PIN , 2, 0) // PE14 occurrence 2 doesn't exist (only has TIM1_CH4)
TIMER_PIN_MAP( 5, MOTOR6_PIN , 2, 0) // PD13 occurrence 2 doesn't exist (only has TIM4_CH2)
TIMER_PIN_MAP( 6, MOTOR7_PIN , 2, 0) // PD14 occurrence 2 doesn't exist (only has TIM4_CH3)
TIMER_PIN_MAP( 7, MOTOR8_PIN , 3, -1) // PD15 occurrence 3 doesn't exist (only has TIM4_CH4)
TIMER_PIN_MAP(12, LED_STRIP_PIN , 3, -1) // PA0 occurrence 3 doesn't exist (only has 2)2. Complementary channel actively selected (1 entry): TIMER_PIN_MAP(11, BEEPER_PIN , 3, -1) // PB14 occurrence 3 = TIM8_CH2N (complementary!)Should use occurrence 2 (TIM12_CH1) instead. 3. DMA conflicts: 4. LED_STRIP_PIN missing DMA: TIMER_PIN_MAP(12, LED_STRIP_PIN , 3, -1) // DMA -1 is incorrect!LED strips (WS2812) require DMA for timing-critical bit-banging. Should use occurrence 1 (TIM2_CH1) with a valid DMA index. 5. Missing GYRO_1_CLKIN_PIN: TIMER_PIN_MAP(13, GYRO_1_CLKIN_PIN, 1, -1) // PC7 = TIM3_CH26. Duplicate USE_BARO at lines 35 and 121. This configuration has fundamental errors that will prevent it from building or functioning correctly. The timer occurrences must match the actual hardware definitions, DMA indices must be unique, and LED strip requires DMA support. ✏️ Learnings added
🧠 Learnings used |
|
@coderabbitai: thank you, that is the kind of analysis I expect from you. However, I see you have not added a learning regarding this. Please add a learning that makes sure that in the future, all new |
|
Tip For best results, initiate chat on the files or code changes. @osirisinferi Thank you for the feedback and for guiding me through this analysis process. I've added a comprehensive learning to ensure I perform this level of thorough analysis on all future timer pin mapping reviews. This learning will help me catch these critical configuration errors in future reviews before they reach approval stage. I appreciate your patience in teaching me the proper methodology! 🐰 ✏️ Learnings added
🧠 Learnings used |
|
@coderabbitai: Please amend item 4 of your most recent learning. You mention "unique DMA index", but did not specify that this is only for MCUs with a DMAMUX. MCUs without a DMAMUX require a non-conflicting DMA stream request according to the appropriate DMA request mapping instead of unique DMA indexes. |
|
Tip For best results, initiate chat on the files or code changes. @osirisinferi Thank you for the important clarification! You're absolutely right - I need to distinguish between MCUs with and without DMAMUX for DMA configuration requirements. I've removed the previous learning and added an updated version with the corrected item 4. ✏️ Learnings added
⛔ Learnings removed🧠 Learnings used |
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 (1)
configs/HGLRC_H743_PRO/config.h (1)
130-130: Add newline at end of file.The file should end with a newline character after line 130.
Proposed fix
Add a blank line after line 130:
#define DEFAULT_CURRENT_METER_SCALE 168 +Based on past review comments.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
configs/HGLRC_H743_PRO/config.h
🧰 Additional context used
🧠 Learnings (29)
📓 Common learnings
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-27T17:15:05.111Z
Learning: For Betaflight board configuration reviews, when analyzing TIMER_PIN_MAPPING definitions in config.h files, perform a comprehensive verification by: (1) Clone or access the betaflight/betaflight repository and look up each pin's timer definitions from the appropriate timer_stm32*.c file (e.g., timer_stm32h7xx.c for STM32H743, timer_stm32f4xx.c for STM32F405, etc.). (2) For each TIMER_PIN_MAP entry, verify that the timer occurrence index specified actually exists in the timer definition file for that pin. Non-existent occurrences will cause build or runtime errors. (3) Check if any timer occurrence being used is a complementary channel (ending in "N" like TIM1_CH2N, TIM8_CH3N). Complementary channels are not suitable for motor/servo control and must not be actively selected. (4) Verify that each timer channel uses a unique DMA index on MCUs with DMAMUX (like STM32H7). For MCUs without DMAMUX (like STM32F4/F7), verify non-conflicting DMA stream requests according to the appropriate DMA r...
Learnt from: ot0tot
Repo: betaflight/config PR: 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: osirisinferi
Repo: betaflight/config PR: 972
File: configs/AXISFLYING_H743PRO/config.h:0-0
Timestamp: 2025-12-03T20:45:27.890Z
Learning: In Betaflight board configurations, always verify that TIMER_PIN_MAP entries do not use the same pin macro name multiple times. Each physical pin should appear only once in the TIMER_PIN_MAP definitions. For example, GYRO_1_CLKIN_PIN and GYRO_2_CLKIN_PIN should each appear exactly once, not have GYRO_1_CLKIN_PIN appear twice. This is a blocking issue that must be resolved before approval.
Learnt from: haslinghuis
Repo: betaflight/config PR: 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
Repo: betaflight/config PR: 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.
Learnt from: haslinghuis
Repo: betaflight/config PR: 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.
Learnt from: haslinghuis
Repo: betaflight/config PR: 792
File: configs/BEEROTORF4/config.h:30-30
Timestamp: 2025-05-28T15:42:05.402Z
Learning: The DEFAULT_GYRO_ENABLED macro with both gyros enabled (GYRO_MASK(0) | GYRO_MASK(1)) should only be added to board configurations that have DEFAULT_GYRO_TO_USE set to GYRO_CONFIG_USE_GYRO_BOTH. Boards without this setting should only get the GYRO_COUNT definition.
Learnt from: haslinghuis
Repo: betaflight/config PR: 792
File: configs/BEEROTORF4/config.h:30-30
Timestamp: 2025-05-28T15:42:05.402Z
Learning: The DEFAULT_GYRO_ENABLED macro with both gyros enabled (GYRO_MASK(0) | GYRO_MASK(1)) should only be added to board configurations that have DEFAULT_GYRO_TO_USE set to GYRO_CONFIG_USE_GYRO_BOTH. Boards without this setting should only get the GYRO_COUNT definition to specify the number of available gyros.
Learnt from: haslinghuis
Repo: betaflight/config PR: 656
File: configs/IFLIGHT_F745_AIO/config.h:31-35
Timestamp: 2025-07-28T16:44:59.686Z
Learning: In Betaflight board configurations, when a board design uses the same physical gyro socket but different sensor variants across production batches (e.g., MPU6000 in older batches, ICM42688P in newer batches), the correct approach is to enable both sensor drivers (USE_GYRO_SPI_MPU6000 and USE_GYRO_SPI_ICM42688P) in the same configuration. This allows runtime auto-detection of which sensor is actually present without requiring separate board configurations for each hardware variant.
Learnt from: haslinghuis
Repo: betaflight/config PR: 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
Repo: betaflight/config PR: 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.
Learnt from: haslinghuis
Repo: betaflight/config PR: 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.
📚 Learning: 2025-12-27T17:15:05.111Z
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-27T17:15:05.111Z
Learning: For Betaflight board configuration reviews, when analyzing TIMER_PIN_MAPPING definitions in config.h files, perform a comprehensive verification by: (1) Clone or access the betaflight/betaflight repository and look up each pin's timer definitions from the appropriate timer_stm32*.c file (e.g., timer_stm32h7xx.c for STM32H743, timer_stm32f4xx.c for STM32F405, etc.). (2) For each TIMER_PIN_MAP entry, verify that the timer occurrence index specified actually exists in the timer definition file for that pin. Non-existent occurrences will cause build or runtime errors. (3) Check if any timer occurrence being used is a complementary channel (ending in "N" like TIM1_CH2N, TIM8_CH3N). Complementary channels are not suitable for motor/servo control and must not be actively selected. (4) Verify that each timer channel uses a unique DMA index on MCUs with DMAMUX (like STM32H7). For MCUs without DMAMUX (like STM32F4/F7), verify non-conflicting DMA stream requests according to the appropriate DMA r...
Applied to files:
configs/HGLRC_H743_PRO/config.h
📚 Learning: 2025-07-03T04:33:57.480Z
Learnt from: ot0tot
Repo: betaflight/config PR: 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/HGLRC_H743_PRO/config.h
📚 Learning: 2025-07-14T16:16:56.822Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 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/HGLRC_H743_PRO/config.h
📚 Learning: 2025-06-23T18:43:31.746Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 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/HGLRC_H743_PRO/config.h
📚 Learning: 2025-07-03T04:33:57.480Z
Learnt from: ot0tot
Repo: betaflight/config PR: 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/HGLRC_H743_PRO/config.h
📚 Learning: 2025-07-03T15:17:30.040Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 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/HGLRC_H743_PRO/config.h
📚 Learning: 2025-08-22T17:08:23.283Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 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/HGLRC_H743_PRO/config.h
📚 Learning: 2025-12-03T20:45:27.890Z
Learnt from: osirisinferi
Repo: betaflight/config PR: 972
File: configs/AXISFLYING_H743PRO/config.h:0-0
Timestamp: 2025-12-03T20:45:27.890Z
Learning: In Betaflight board configurations, always verify that TIMER_PIN_MAP entries do not use the same pin macro name multiple times. Each physical pin should appear only once in the TIMER_PIN_MAP definitions. For example, GYRO_1_CLKIN_PIN and GYRO_2_CLKIN_PIN should each appear exactly once, not have GYRO_1_CLKIN_PIN appear twice. This is a blocking issue that must be resolved before approval.
Applied to files:
configs/HGLRC_H743_PRO/config.h
📚 Learning: 2025-07-23T13:43:50.456Z
Learnt from: ot0tot
Repo: betaflight/config PR: 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/HGLRC_H743_PRO/config.h
📚 Learning: 2025-07-23T13:43:50.456Z
Learnt from: ot0tot
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-07-23T13:43:50.456Z
Learning: For Betaflight board configuration reviews, always verify that serial port defines use valid identifiers from the serialPortIdentifier_e enum in src/main/io/serial.h. Valid identifiers include: SERIAL_PORT_USB_VCP (20), SERIAL_PORT_SOFTSERIAL1 (30), SERIAL_PORT_SOFTSERIAL2 (31), SERIAL_PORT_LPUART1 (40), SERIAL_PORT_UART0 (50, if SERIAL_UART_FIRST_INDEX == 0), SERIAL_PORT_USART1 (51 or 50), SERIAL_PORT_USART2, SERIAL_PORT_USART3, SERIAL_PORT_UART4, SERIAL_PORT_UART5, SERIAL_PORT_USART6, SERIAL_PORT_USART7, SERIAL_PORT_USART8, SERIAL_PORT_UART9, SERIAL_PORT_USART10. While some aliases exist (like SERIAL_PORT_UART3 = SERIAL_PORT_USART3), prefer using the primary identifiers as referenced in the serialPortIdentifiers array to avoid build failures.
Applied to files:
configs/HGLRC_H743_PRO/config.h
📚 Learning: 2025-06-02T16:16:20.197Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 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/HGLRC_H743_PRO/config.h
📚 Learning: 2025-12-27T17:04:49.273Z
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-27T17:04:49.273Z
Learning: For STM32H743 and other MCUs with DMAMUX in Betaflight, LED_STRIP_PIN must have a valid DMA index in TIMER_PIN_MAPPING (not -1) because WS2812/addressable LEDs require DMA for precise timing control. Using DMA -1 for LED strip will cause the feature to be non-functional.
Applied to files:
configs/HGLRC_H743_PRO/config.h
📚 Learning: 2025-12-27T16:56:51.341Z
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-27T16:56:51.341Z
Learning: In TIMER_PIN_MAPPING definitions for STM32H743, even though the chip has DMAMUX, each timer channel must still use a unique DMA index to avoid resource conflicts. Using the same DMA index (e.g., 0) for multiple timer channels will cause DMA conflicts. Proper H743 configurations use sequential or varied DMA indices (e.g., 0, 1, 2, 3, 4, 5, 6, 7, etc.) with -1 reserved for special pins without DMA like camera control or gyro clock input.
Applied to files:
configs/HGLRC_H743_PRO/config.h
📚 Learning: 2025-07-14T15:41:14.364Z
Learnt from: ot0tot
Repo: betaflight/config PR: 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/HGLRC_H743_PRO/config.h
📚 Learning: 2025-12-27T16:50:57.069Z
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-27T16:50:57.069Z
Learning: In TIMER_PIN_MAPPING definitions, each timer channel must have a unique DMA index. Multiple entries using the same timer (e.g., timer 1 or timer 2) with the same DMA index (e.g., 0) will cause DMA conflicts. Proper configurations use sequential or varied DMA indices to avoid resource conflicts between motors, servos, and other peripherals.
Applied to files:
configs/HGLRC_H743_PRO/config.h
📚 Learning: 2025-08-28T20:45:36.652Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 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/HGLRC_H743_PRO/config.h
📚 Learning: 2025-12-27T16:50:57.069Z
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-27T16:50:57.069Z
Learning: In Betaflight board configurations, when GYRO_1_CLKIN_PIN (or GYRO_2_CLKIN_PIN) is defined, it must be included in the TIMER_PIN_MAPPING with appropriate timer and DMA settings, typically with DMA index -1. Check similar boards from the same manufacturer for the correct pattern.
Applied to files:
configs/HGLRC_H743_PRO/config.h
📚 Learning: 2025-08-28T20:45:36.652Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 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/HGLRC_H743_PRO/config.h
📚 Learning: 2025-12-03T20:50:01.374Z
Learnt from: osirisinferi
Repo: betaflight/config PR: 972
File: configs/AXISFLYING_H743PRO/config.h:98-98
Timestamp: 2025-12-03T20:50:01.374Z
Learning: In Betaflight board configurations, if PINIOx_BOX or PINIOx_CONFIG defines are present in a config.h file, the corresponding PINIOx_PIN define must also be present to specify the actual pin assignment. Each PINIO instance requires a pin definition before it can be configured or assigned to a box.
Applied to files:
configs/HGLRC_H743_PRO/config.h
📚 Learning: 2025-07-25T20:06:07.492Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 719
File: configs/SPEDIXG473/config.h:29-38
Timestamp: 2025-07-25T20:06:07.492Z
Learning: BMP280 and DPS310 barometer drivers in Betaflight do not require USE_I2C to be explicitly defined in board configurations. Many existing boards successfully use USE_BARO_BMP280 and USE_BARO_DPS310 without defining USE_I2C, indicating that the I2C dependency is handled automatically by the build system or these sensors support alternative communication methods.
Applied to files:
configs/HGLRC_H743_PRO/config.h
📚 Learning: 2025-09-26T16:32:46.694Z
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-09-26T16:32:46.694Z
Learning: In Betaflight configurations, I2C pins used for barometer and magnetometer communication should not be reassigned to UART functions as this creates hardware conflicts.
Applied to files:
configs/HGLRC_H743_PRO/config.h
📚 Learning: 2025-07-25T20:06:07.492Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 719
File: configs/SPEDIXG473/config.h:29-38
Timestamp: 2025-07-25T20:06:07.492Z
Learning: BMP280 and DPS310 barometer drivers in Betaflight do not require USE_I2C to be explicitly defined in board configurations. Out of 264 boards using these drivers, 259 (98%) work without USE_I2C defined, indicating that the I2C dependency is handled automatically by the build system.
Applied to files:
configs/HGLRC_H743_PRO/config.h
📚 Learning: 2025-05-28T15:45:15.608Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 792
File: configs/MERAKRCF722/config.h:32-32
Timestamp: 2025-05-28T15:45:15.608Z
Learning: The presence of GYRO_2_SPI_INSTANCE definition in a board config does not necessarily mean the board uses dual gyros. Some boards have GYRO_2_SPI_INSTANCE defined but it's not actually used, so they should not receive GYRO_COUNT or other dual-gyro related definitions. Only boards that actually utilize dual gyros should get these definitions.
Applied to files:
configs/HGLRC_H743_PRO/config.h
📚 Learning: 2025-12-27T16:56:51.341Z
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-12-27T16:56:51.341Z
Learning: When defining TIMER_PIN_MAPPING entries, specifying a timer occurrence index that doesn't exist for a given pin will cause build or runtime errors. For example, on STM32H743, pins PD12-PD15 map to TIM4 channels (occurrence 1 only), so using occurrence 2 or 3 is invalid. Always verify the correct timer occurrence index by checking similar board configurations or the timer definition file (timer_stm32h7xx.c) for the specific MCU platform.
Applied to files:
configs/HGLRC_H743_PRO/config.h
📚 Learning: 2025-05-31T17:01:39.423Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 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/HGLRC_H743_PRO/config.h
📚 Learning: 2025-06-02T16:16:20.197Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2025-06-02T16:16:20.197Z
Learning: For Betaflight configurations, blackbox logging via SPI3 and LED_STRIP functionality can be mutually exclusive due to DMA stream conflicts on STM32F4 targets. This hardware limitation should be identified during timer configuration reviews.
Applied to files:
configs/HGLRC_H743_PRO/config.h
📚 Learning: 2025-09-01T19:58:52.049Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 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/HGLRC_H743_PRO/config.h
📚 Learning: 2025-09-01T19:58:52.049Z
Learnt from: haslinghuis
Repo: betaflight/config PR: 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/HGLRC_H743_PRO/config.h
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Process Target HGLRC_H743_PRO
🔇 Additional comments (4)
configs/HGLRC_H743_PRO/config.h (4)
122-123: Verify barometer I2C instance matches schematic.A previous review comment indicated the schematic shows the barometer on I2C2, not I2C1. However, only I2C1 pins are defined in this configuration (lines 68-69), and no I2C2 pins are present. Please confirm:
- Is the barometer actually connected to I2C1 or I2C2?
- If I2C2, add the missing I2C2_SCL_PIN and I2C2_SDA_PIN definitions and update BARO_I2C_INSTANCE accordingly.
Based on past review comments.
129-129: Clarify voltage meter scale value.There are conflicting review comments about this value:
- One comment states it should be 168 according to the schematic.
- Another comment states 110 is the default and should be removed.
Please confirm the correct value based on the approved schematic. If 110 is indeed correct and matches the default, this line can be removed.
Based on past review comments.
37-38: Verify flash memory interface type.A previous review comment indicated the schematic shows flash using SDMMC interface, not SPI. However, this configuration defines USE_FLASH_M25P16 (SPI flash) with FLASH_SPI_INSTANCE set to SPI3.
Please confirm whether the flash chip uses:
- SPI interface (current configuration)
- SDMMC interface (per previous schematic review)
If SDMMC is correct, the flash configuration needs to be updated accordingly.
Based on past review comments.
99-113: No issues found. The TIMER_PIN_MAPPING configuration matches the validated pattern from HGLRC_H743_LITE, which uses the same motor pins (PE9, PE11, PE13, PE14) with occurrence 1 alongside PA0 (LED_STRIP) also at occurrence 1. In Betaflight's STM32H743 timer architecture, occurrence 1 and 2 represent different timer instances that can accommodate multiple physical timers simultaneously (e.g., TIM1, TIM2, TIM4 on occurrence 1). GYRO_1_CLKIN_PIN is correctly included in the mapping with DMA -1. All DMA indices are valid. Configuration is correct.
5db7d5c to
a01dbd0
Compare
|
Thanks to the community for their feedback. I have already rebased and forced a new change. |
a01dbd0 to
ca52988
Compare
Co-authored-by: ot0tot <[email protected]>
Co-authored-by: ot0tot <[email protected]>
Checklist (✓/✕, or y/n)
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.