-
Notifications
You must be signed in to change notification settings - Fork 191
Add CRAZYBEE473 target #727
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
Conversation
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.
can you adjust the voltage divider to 113? this in testing of the real hardware is what was needed to get the battery voltage to display correctly. the default of 110 produces very low readings
WalkthroughAdds a new Betaflight board configuration header for CRAZYBEE473 defining MCU (STM32G47X), board/manufacturer IDs, enabled peripherals (ICM42688P accel/gyro, M25P16 flash, MAX7456 OSD), comprehensive pin/timer mappings, bus instances, defaults (CRSF, SmartAudio, DShot, ADC meters) and gyro alignment. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks (2 passed, 1 inconclusive)❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. ✨ Finishing touches
🧪 Generate unit tests
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 |
The difference between 110 and 113 is very small, and depends on the tolerance of the resistors used for the Vbat voltage divider. Let's check a few more FCs and see what the average value is. |
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/CRAZYBEE473/config.h (3)
65-71
: ADC/Gyro lines look plausible; double-check EXTI and CS wiringPB0/PB1 for VBAT/CURR and PA8 as GYRO_1_EXTI are typical. Ensure PC13 is actually the gyro CS on the PCB and that EXTI on PA8 is wired to the gyro INT pin.
If available, drop a brief comment indicating the gyro INT polarity (active-high/low) observed on this board.
89-94
: DSHOT defaults and meter scales
- DSHOT_DMAR_OFF and BITBANG_ON: OK for small G4 AIOs; verify CPU load at 48k/96k with OSD+logging.
- DEFAULT_VOLTAGE_METER_SCALE 113 matches reviewer guidance; thanks for aligning.
- CURRENT_METER_SCALE 235 is plausible; confirm with a sample board.
If you have 2–3 sample boards, consider providing average + variance for VBAT and current scales in the PR description for future maintainers.
100-100
: Verify gyro alignment CW180_DEG against the physical orientationPlease confirm the silkscreen/arrow orientation vs Betaflight frame axes on the shipped board. A mismatch here is user-visible and painful.
Add a one-line comment noting the sensor’s top-mark/arrow orientation to justify CW180_DEG.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
configs/CRAZYBEE473/config.h
(1 hunks)
🧰 Additional context used
🧠 Learnings (12)
📓 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#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.
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: haslinghuis
PR: betaflight/config#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: 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.
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.
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.
Learnt from: haslinghuis
PR: betaflight/config#835
File: configs/HDZERO_HALO_MPU6000/config.h:29-35
Timestamp: 2025-07-14T16:16:50.628Z
Learning: CW0_DEG is not a universal default gyro alignment setting in Betaflight configurations. Different boards use different gyro alignments (CW0_DEG, CW90_DEG, CW180_DEG, CW270_DEG, CW0_DEG_FLIP, etc.) based on their physical sensor mounting orientation.
Learnt from: haslinghuis
PR: betaflight/config#757
File: configs/HAKRCH743/config.h:134-134
Timestamp: 2025-08-05T16:56:44.200Z
Learning: In Betaflight board configurations, when DEFAULT_GYRO_TO_USE is set to GYRO_CONFIG_USE_GYRO_BOTH, the firmware automatically establishes GYRO_COUNT during initialization for backwards compatibility. Therefore, explicit GYRO_COUNT definitions are not needed in board config files when using DEFAULT_GYRO_TO_USE.
Learnt from: ot0tot
PR: betaflight/config#681
File: configs/NYX405V1/config.h:26-28
Timestamp: 2025-07-14T15:47:16.394Z
Learning: In Betaflight configuration files, MANUFACTURER_ID values must be exactly 4 ASCII characters long, not 3 characters. All manufacturer IDs in the codebase consistently use 4-character identifiers like AIRB, FOSS, SPBE, MTKS, NERC, etc.
📚 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/CRAZYBEE473/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/CRAZYBEE473/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/CRAZYBEE473/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/CRAZYBEE473/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/CRAZYBEE473/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/CRAZYBEE473/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/CRAZYBEE473/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/CRAZYBEE473/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/CRAZYBEE473/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/CRAZYBEE473/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 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/CRAZYBEE473/config.h
🔇 Additional comments (8)
configs/CRAZYBEE473/config.h (8)
26-28
: Board name and manufacturer ID look correctBOARD_NAME matches the directory and MANUFACTURER_ID is 4 ASCII chars. LGTM.
29-36
: Driver feature set looks consistent with the hardwareUSE_{ACC,GYRO} with ICM42688P, FLASH M25P16, and MAX7456 is a sensible baseline. No issues from me.
82-84
: Serial defaults: identifiers look validVTX on SERIAL_PORT_UART4 and RX on SERIAL_PORT_USART3 match Betaflight’s identifiers. Looks good.
If the VTX is SmartAudio 2.1+, confirm UART inversion not required on this board’s level shifter.
85-88
: I2C instance placeholders are fine even if baro/mag are build-time optionalThis aligns with guidance that hardware instance defines can exist without enabling the feature in this file.
95-100
: Misc: Beeper invert, HSE=8 MHz, and SPI instancesAll three are standard choices. No action needed.
44-51
: Confirm USART2 PA14/PA15 mapping and SWD trade-off
PA14/PA15 map to USART2 in Betaflight’s STM32G4 driver but disable SWD (PA14=SWCLK). Ensure DFU-only USB flashing is acceptable or select alternate USART2 pins as defined in serial_uart_stm32g4xx.c.
72-79
: Correct TIMER_PIN_MAPPING entries
- Motors: PA1 is TIM2_CH2 (channel 2) and PA0 is TIM2_CH1 (channel 1), not vice versa.
- LED strip on PB9 cannot use TIM3; valid mappings are TIM8_CH3 (timer index 7, channel 3) or TIM17_CH1 (index 10, channel 1).
- Camera control on PB2 cannot use TIM2; choose TIM5_CH1 (index 4, channel 1) or TIM20_CH1 (index 11, channel 1) and update the mapping.
⛔ Skipped due to learnings
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
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).
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.
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.
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.
56-64
: SPI3 PB3/PB4/PB5 — AF mapping verifiedConfirmed: src/platform/common/stm32/bus_spi_pinconfig.c lists PB3/PB4/PB5 as valid SPI3 SCK/MISO/MOSI entries (GPIO_AF6_SPI3 / GPIO_MUX_6). They overlap JTAG on some packages—verify JTAG usage on this board before shipping.
My FC tests with a voltage scale closer to 135, but the response is non-linear and seems quite slow. Will follow-up in the manufacturer channel. |
I only have one FC. |
@coderabbitai full review |
✅ Actions performedFull review triggered. |
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/CRAZYBEE473/config.h (1)
89-91
: DSHOT defaults are conservative.DMAR off + bitbang on is safe; revisit after timer/DMA confirmation.
If no DMA conflicts are found, enabling DSHOT DMA can reduce CPU usage.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
configs/CRAZYBEE473/config.h
(1 hunks)
🧰 Additional context used
🧠 Learnings (12)
📓 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#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.
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: haslinghuis
PR: betaflight/config#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
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.
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.
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.
Learnt from: haslinghuis
PR: betaflight/config#757
File: configs/HAKRCH743/config.h:134-134
Timestamp: 2025-08-05T16:56:44.200Z
Learning: In Betaflight board configurations, when DEFAULT_GYRO_TO_USE is set to GYRO_CONFIG_USE_GYRO_BOTH, the firmware automatically establishes GYRO_COUNT during initialization for backwards compatibility. Therefore, explicit GYRO_COUNT definitions are not needed in board config files when using DEFAULT_GYRO_TO_USE.
Learnt from: haslinghuis
PR: betaflight/config#835
File: configs/HDZERO_HALO_MPU6000/config.h:29-35
Timestamp: 2025-07-14T16:16:50.628Z
Learning: CW0_DEG is not a universal default gyro alignment setting in Betaflight configurations. Different boards use different gyro alignments (CW0_DEG, CW90_DEG, CW180_DEG, CW270_DEG, CW0_DEG_FLIP, etc.) based on their physical sensor mounting orientation.
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.
📚 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/CRAZYBEE473/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/CRAZYBEE473/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/CRAZYBEE473/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/CRAZYBEE473/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/CRAZYBEE473/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/CRAZYBEE473/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/CRAZYBEE473/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/CRAZYBEE473/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/CRAZYBEE473/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/CRAZYBEE473/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 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/CRAZYBEE473/config.h
🔇 Additional comments (15)
configs/CRAZYBEE473/config.h (15)
26-27
: BOARD_NAME matches directory — good.BOARD_NAME=CRAZYBEE473 matches configs/CRAZYBEE473/.
24-24
: MCU family selection looks correct.STM32G47X aligns with a G473 target.
29-36
: Sensor/flash/OSD feature set is reasonable.ICM42688P over SPI plus M25P16 and MAX7456 are consistent.
56-64
: SPI bus/pins are standard.SPI1 (Flash) PA5/6/7, SPI2 (MAX7456) PB13/14/15, SPI3 (Gyro) PB3/4/5 look correct.
65-67
: ADC pins OK.VBAT=PB0, CURR=PB1 are conventional on G4.
68-71
: Gyro INT/CS and MAX7456 CS plausible.PA8 as EXTI and PC13 as CS are commonly used; just ensure EXTI routing is wired as in hardware.
Can you confirm the gyro INT is physically on PA8 and that PC13 drive strength is sufficient for CS on this board?
82-84
: Serial port identifiers are valid.SERIAL_PORT_UART4 and SERIAL_PORT_USART3 align with serial.h identifiers.
85-88
: I2C instances defined without forcing features — OK.BARO/MAG instances are harmless defaults and only used when features are enabled at build time.
93-94
: VBAT/CURR scales: VBAT=113 aligns with reviewer request.This matches the requested divider; current scale 235 is a reasonable starting point.
Please confirm with a multimeter under load; tweak via CLI if needed.
96-96
: Confirm HSE frequency.Ensure the board actually uses an 8 MHz crystal; 16 MHz is also common on G4. A mismatch skews all clocks.
If uncertain, please check the BOM/schematic or measure HSE with an oscilloscope.
97-100
: SPI instance selections make sense.MAX7456 on SPI2, Flash on SPI1, Gyro on SPI3 minimize bus contention.
100-100
: Verify gyro alignment.CW180_DEG must match the sensor’s physical orientation.
A quick hover test (axis sanity and level mode) can confirm; adjust if axes are inverted/rotated.
27-27
: Manufacturer ID OK — consistent with other Crazybee/Happymodel boards.HAMO is used in configs/CRAZYBEE473/config.h and multiple other Crazybee configs and is a valid 4-character MANUFACTURER_ID; no change required.
72-79
: Validate TIMER_PIN_MAPPING against STM32G4 timer sources (manual check required).
- Script couldn't find the G4 timer mapping file in src (only configs were returned). Manually confirm PA0..PA3 → TIM2 CH1–CH4 and that the indices in configs/CRAZYBEE473/config.h (lines 72–79) match the platform timer definitions (e.g. src/platform/STM32/timer_stm32g4xx.c or equivalent).
- Verify PB9 and PB2 timer/channel assignments and whether those timers/DMA conflict with SPI/DSHOT (LED_STRIP vs blackbox). If they conflict, reassign pins/timers or keep/adjust DSHOT DMA accordingly.
44-51
: ```shell
#!/bin/bash
set -euo pipefailecho "PWD: $(pwd)"
echo "Top-level entries:"
ls -laecho
echo "Find files with 'serial_uart' in the name:"
fd --hidden --no-ignore -g 'serial_uart*' || trueecho
echo "Search for any occurrences of 'serial_uart' (files + lines):"
rg -n --hidden --no-ignore -S 'serial_uart' || trueecho
echo "Search repo for USART2 / UART2 / PA14 / PA15 / PB3 / SWCLK / SWD / JTAG / JTDO / SWO (with context):"
rg -n --hidden --no-ignore -S -C3 '\bUSART2\b|\bUART2\b|PA14|PA15|PB3|SWCLK|SWD|JTAG|JTDO|SWO' || trueecho
echo "Show matches for PA14 or PA15 specifically:"
rg -n --hidden --no-ignore -S -C3 '\bPA14\b|\bPA15\b' || trueecho
echo "If present, list STM32 platform folder contents:"
if [ -d src/platform/STM32 ]; then
ls -la src/platform/STM32 || true
fiecho
echo "Done."</blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Summary by CodeRabbit