Skip to content

Add target HUMMINGBIRD_FC305_H7 - #11755

Open
LYNHQQ wants to merge 1 commit into
iNavFlight:maintenance-10.xfrom
newbeedrone:target/HUMMINGBIRD_FC305_H7
Open

Add target HUMMINGBIRD_FC305_H7#11755
LYNHQQ wants to merge 1 commit into
iNavFlight:maintenance-10.xfrom
newbeedrone:target/HUMMINGBIRD_FC305_H7

Conversation

@LYNHQQ

@LYNHQQ LYNHQQ commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Add support for HUMMINGBIRD FC305 H7

@github-actions

Copy link
Copy Markdown

Branch Targeting Suggestion

You've targeted the master branch with this PR. Please consider if a version branch might be more appropriate:

  • maintenance-9.x - If your change is backward-compatible and won't create compatibility issues between INAV firmware and Configurator 9.x versions. This will allow your PR to be included in the next 9.x release.

  • maintenance-10.x - If your change introduces compatibility requirements between firmware and configurator that would break 9.x compatibility. This is for PRs which will be included in INAV 10.x

If master is the correct target for this change, no action is needed.


This is an automated suggestion to help route contributions to the appropriate branch.

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Add STM32H743 target: HUMMINGBIRD_FC305_H7

✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Add a new HUMMINGBIRD_FC305_H7 build target for STM32H743 (8MHz HSE).
• Define board pin mapping and enabled peripherals (IMU, OSD, SDIO, UARTs, ADC, PINIO).
• Provide timer/PWM mapping for motors, servos, beeper, and LED strip.
Diagram

graph TD
A["CMake target"] --> B["HUMMINGBIRD_FC305_H7 target"] --> C["target.h (pins/features)"] --> D["Drivers (SPI/I2C/UART)"] --> E[("Board peripherals")]
B --> F["target.c (timers/PWM)"] --> D
B --> G["config.c (PINIO box)"] --> D
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Factor shared HUMMINGBIRD_FC305* definitions into a common header
  • ➕ Reduces duplication across F4/F7/H7 variants
  • ➕ Makes future board revisions easier to maintain
  • ➖ Requires identifying which pin/peripheral definitions are truly common
  • ➖ Adds indirection that can obscure per-target differences
2. Alias/derive from an existing H743 target with similar peripherals
  • ➕ Faster bring-up by reusing known-good H743 baseline settings
  • ➕ May reduce the amount of target-specific code
  • ➖ Risk of carrying over incorrect pin/timer assumptions
  • ➖ Still needs careful override of board-unique mappings

Recommendation: Current approach (a dedicated target directory with explicit pin/timer mappings) is appropriate for new board bring-up and matches existing target patterns. Consider extracting shared HUMMINGBIRD_FC305-family definitions only if multiple variants will be maintained long-term.

Files changed (4) +276 / -0

Enhancement (3) +275 / -0
config.cSet default PINIO box permanent IDs +29/-0

Set default PINIO box permanent IDs

• Implements targetConfiguration() to assign USER1/USER2/USER3 permanent IDs to the PINIO box slots for consistent box mapping.

src/main/target/HUMMINGBIRD_FC305_H7/config.c

target.cDefine timer/PWM mapping for motors, servos, beeper, and LED strip +47/-0

Define timer/PWM mapping for motors, servos, beeper, and LED strip

• Adds timerHardware[] mappings for 8 motor outputs (TIM5/TIM4), two PWM-only servos (TIM12), plus beeper (TIM2) and LED strip (TIM15). Documents STM32H743 TIM12 DMA limitation and leaves gyro CLKIN unsupported.

src/main/target/HUMMINGBIRD_FC305_H7/target.c

target.hAdd board pinout and feature enables for HUMMINGBIRD_FC305_H7 +199/-0

Add board pinout and feature enables for HUMMINGBIRD_FC305_H7

• Introduces the target header defining board identifier/product string, enabled features, and pin mappings for LEDs/beeper, SPI buses (IMU + MAX7456 OSD + spare), I2C buses (external sensors + DPS310 baro), SDIO SD card, UART1-8 + VCP, ADC channels, and PINIO outputs.

src/main/target/HUMMINGBIRD_FC305_H7/target.h

Other (1) +1 / -0
CMakeLists.txtRegister HUMMINGBIRD_FC305_H7 STM32H743 build target (8MHz HSE) +1/-0

Register HUMMINGBIRD_FC305_H7 STM32H743 build target (8MHz HSE)

• Adds the CMake target definition for an STM32H743XI-based board and sets the external crystal frequency to 8MHz.

src/main/target/HUMMINGBIRD_FC305_H7/CMakeLists.txt

@LYNHQQ
LYNHQQ force-pushed the target/HUMMINGBIRD_FC305_H7 branch from 99370bd to 20bc980 Compare July 31, 2026 07:49
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

Test firmware build ready — commit 07814f1

Download firmware for PR #11755

1 targets built. Find your board's .hex file by name on that page (e.g. MATEKF405SE.hex). Files are individually downloadable — no GitHub login required.

Development build for testing only. Use Full Chip Erase when flashing.

@qodo-code-review

qodo-code-review Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. PWM beeper not enabled ✓ Resolved 🐞 Bug ☼ Reliability
Description
The target defines BEEPER_PWM_FREQUENCY and provides a TIM_USE_BEEPER timer mapping on PA15, but
targetConfiguration() never enables beeperConfigMutable()->pwmMode, so the PWM beeper path is never
initialized. On boards with a passive beeper (which requires PWM to generate tone), this results in
a non-functional beeper despite the PWM configuration being present.
Code

src/main/target/HUMMINGBIRD_FC305_H7/config.c[R24-29]

+void targetConfiguration(void)
+{
+    pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1;
+    pinioBoxConfigMutable()->permanentId[1] = BOX_PERMANENT_ID_USER2;
+    pinioBoxConfigMutable()->permanentId[2] = BOX_PERMANENT_ID_USER3;
+}
Evidence
The target declares PWM beeper frequency and a timer channel tagged for beeper use, but the beeper
implementation only initializes PWM output when beeperConfig()->pwmMode is enabled; other targets
with PWM beepers set this flag in their targetConfiguration.

src/main/target/HUMMINGBIRD_FC305_H7/target.h[29-32]
src/main/target/HUMMINGBIRD_FC305_H7/target.c[36-41]
src/main/target/HUMMINGBIRD_FC305_H7/config.c[24-29]
src/main/drivers/sound_beeper.c[57-63]
src/main/drivers/sound_beeper.c[76-90]
src/main/drivers/pwm_output.c[755-785]
src/main/target/AETH743Basic/config.c[29-36]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The target defines PWM-beeper parameters (`BEEPER_PWM_FREQUENCY` and a `TIM_USE_BEEPER` timer mapping), but `targetConfiguration()` does not enable `beeperConfig()->pwmMode`. As a result, `beeperPwmInit()` is not called and the timer-based beeper output is never configured.

## Issue Context
`sound_beeper.c` only initializes PWM beeper when `beeperConfig()->pwmMode` is true; otherwise it uses GPIO toggling.

## Fix Focus Areas
- src/main/target/HUMMINGBIRD_FC305_H7/config.c[18-29]

### Suggested fix
1. Include `fc/config.h` in `config.c`.
2. Set `beeperConfigMutable()->pwmMode = true;` in `targetConfiguration()` (if the hardware is passive / intended to use PWM). 
3. If the hardware is actually an active buzzer, remove the PWM-specific configuration (timer mapping / frequency) to avoid confusion.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Board ID collision ✓ Resolved 🐞 Bug ≡ Correctness
Description
HUMMINGBIRD_FC305_H7 sets TARGET_BOARD_IDENTIFIER to "HBRD", which is already used by
HUMMINGBIRD_FC305, making the MSP-reported boardIdentifier ambiguous for tooling that keys off this
field. This can cause target mis-identification when selecting board-specific defaults/resources or
in support/debug workflows.
Code

src/main/target/HUMMINGBIRD_FC305_H7/target.h[R20-21]

+#define TARGET_BOARD_IDENTIFIER "HBRD"
+#define USBD_PRODUCT_STRING     "HUMMINGBIRD_FC305_H7"
Evidence
The new target introduces a duplicate TARGET_BOARD_IDENTIFIER, and the firmware exports this
identifier via MSP (boardIdentifier), so duplicates make the identifier ambiguous.

src/main/target/HUMMINGBIRD_FC305_H7/target.h[20-22]
src/main/target/HUMMINGBIRD_FC305/target.h[21-23]
src/main/fc/fc_msp.c[145-147]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`TARGET_BOARD_IDENTIFIER` is duplicated between two different targets (HUMMINGBIRD_FC305 and HUMMINGBIRD_FC305_H7). Since MSP exports this identifier, tools/users relying on `boardIdentifier` cannot reliably distinguish which firmware/target is running.

## Issue Context
The new target defines `TARGET_BOARD_IDENTIFIER "HBRD"`, but the existing HUMMINGBIRD_FC305 target already uses the same identifier.

## Fix Focus Areas
- src/main/target/HUMMINGBIRD_FC305_H7/target.h[20-22]

### Suggested fix
Change `TARGET_BOARD_IDENTIFIER` for HUMMINGBIRD_FC305_H7 to a unique (ideally 4-character, uppercase) identifier, and ensure any documentation/release tooling that references the identifier is updated accordingly.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Comment thread src/main/target/HUMMINGBIRD_FC305_H7/target.h Outdated
Comment thread src/main/target/HUMMINGBIRD_FC305_H7/config.c
@LYNHQQ
LYNHQQ force-pushed the target/HUMMINGBIRD_FC305_H7 branch from 20bc980 to 07814f1 Compare July 31, 2026 08:20
@sensei-hacker sensei-hacker added the New target This PR adds a new target label Aug 1, 2026
@sensei-hacker
sensei-hacker changed the base branch from master to maintenance-10.x August 2, 2026 18:01
@sensei-hacker sensei-hacker added Testing Required hardware needed Blocked by lack of hardware to reproduce issue labels Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hardware needed Blocked by lack of hardware to reproduce issue New target This PR adds a new target Testing Required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants