Skip to content

Add HWF435 target#1074

Open
Hebo98 wants to merge 11 commits into
betaflight:masterfrom
Hebo98:hobbywing_config
Open

Add HWF435 target#1074
Hebo98 wants to merge 11 commits into
betaflight:masterfrom
Hebo98:hobbywing_config

Conversation

@Hebo98
Copy link
Copy Markdown
Contributor

@Hebo98 Hebo98 commented Apr 9, 2026

Summary by CodeRabbit

  • New Features
    • Added support for the HWF435 flight controller board.
    • Enables onboard sensors and peripherals: SPI IMU (selectable accel/gyro families), DPS310 barometer, magnetometer, external flash storage, and OSD.
    • Configures motor/servo outputs, LED/strip, beeper, multiple UART/I2C/SPI ports, battery/current ADC, and sensible defaults for Blackbox, mixer, serial RX, voltage/current scaling, and DShot.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c2a72911-7556-4857-af00-ad6b4f028bf1

📥 Commits

Reviewing files that changed from the base of the PR and between 6487919 and dbb9f76.

📒 Files selected for processing (1)
  • configs/HWF435/config.h
🚧 Files skipped from review as they are similar to previous changes (1)
  • configs/HWF435/config.h

Walkthrough

Adds a new Betaflight board configuration header for HWF435 (AT32F435G, 8 MHz HSE) specifying board identity, enabled sensors/peripherals, detailed pin mappings, timer routing, bus/spi/i2c instances, and Betaflight default settings.

Changes

HWF435 Board Configuration

Layer / File(s) Summary
Board identity and feature enables
configs/HWF435/config.h
Defines MCU/board macros and clock, and enables gyro/accel sensor families, DPS310 barometer, W25Q128FV flash, and MAX7456 OSD.
GPIO, motors, servos, and buses
configs/HWF435/config.h
Adds beeper/LED pins, MOTOR1–MOTOR8 and SERVO1–SERVO3 mappings, UART1–4/7/8 TX/RX pins, I2C1 SCL/SDA, SPI1–SPI3 SCK/SDI/SDO pins, ADC VBAT/CURRENT pins and DMA option, flash/MAX7456/gyro control pins, PINIO configs, and peripheral instance selections.
Timer mapping and Betaflight defaults
configs/HWF435/config.h
Defines TIMER_PIN_MAPPING table and sets Betaflight defaults: blackbox device, voltage/current meter sources and scales, mixer, DSHOT bitbanging/speed, PID process denom, board yaw alignment, and serial RX provider/UART.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • betaflight/config#1081: Adds USE_ACCGYRO_LSM6DSK320X macro in board config headers, overlapping sensor-family macros.
  • betaflight/config#1061: Adds a new configs/<target>/config.h with similar peripheral/pin routing and sensor macros (gyro SPI, DPS310, MAX7456, TIMER_PIN_MAPPING).
  • betaflight/config#929: Another new board header with overlapping feature macros and wiring patterns (gyro SPI, flash/MAX7456 CS, DPS310 baro, UART/I2C/SPI pin macros).

Suggested reviewers

  • haslinghuis
  • ot0tot
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request has no description provided by the author. The template requires comprehensive information including hardware compliance review, schematic review, testing, and a mandatory checklist for new flight controllers. Add a complete pull request description that includes: schematic review status, hardware testing results, compliance verification, checklist completion, and any relevant hardware details or design notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add HWF435 target' accurately and concisely describes the main change: introducing a new Betaflight board configuration for the HWF435 target.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread configs/HWF435/config.h Outdated
Remove MPU6500 definitions as requested.

Co-authored-by: Hebo98 <72866967+Hebo98@users.noreply.github.com>
@sugaarK sugaarK added the Partner Program this pr is for a target from the partner program and will automatically get tier 1 status label Apr 13, 2026
Comment thread configs/HWF435/config.h Outdated
Comment thread configs/HWF435/config.h Outdated
Comment thread configs/HWF435/config.h Outdated
Comment thread configs/HWF435/config.h
Comment thread configs/HWF435/config.h
Comment thread configs/HWF435/config.h Outdated
Comment thread configs/HWF435/config.h Outdated
Comment thread configs/HWF435/config.h Outdated
…F435/config.h


HWF435 does not have onboard MAG or GNSS modules according to the schematic, so these user feature defines should not be enabled in config.h.

Co-authored-by: Osiris Inferi <github@flut.nl.eu.org>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@configs/HWF435/config.h`:
- Line 30: Remove the deprecated BMI270 macro: delete the define
USE_ACCGYRO_BMI270 from the HWF435 config to stop enabling the BMI270 driver;
instead verify the flight controller actually populates a BMI270 in
production—if it does, flag the hardware for redesign to use a supported IMU or
replace the define with the supported IMU macro; ensure no other code paths
(e.g., init functions or references to USE_ACCGYRO_BMI270) remain enabled or
compiled for HWF435 after removal.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f5976e82-613f-4746-a009-1238d71d3ac7

📥 Commits

Reviewing files that changed from the base of the PR and between c226eb6 and 25a118c.

📒 Files selected for processing (1)
  • configs/HWF435/config.h

Comment thread configs/HWF435/config.h
Hebo98 and others added 5 commits April 25, 2026 09:23
Sorry, that was a typo.

Co-authored-by: Osiris Inferi <github@flut.nl.eu.org>
Thank you for your advice.

Co-authored-by: Osiris Inferi <github@flut.nl.eu.org>
The previous roll/pitch/yaw alignment was equivalent to a 90 degree yaw rotation, so simplify it to DEFAULT_ALIGN_BOARD_YAW 90.
Co-authored-by: Osiris Inferi <github@flut.nl.eu.org>
Based on osirisinferi’s suggestion, we added a user-switchable VTX control port. The specific control port is PC14.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 2

♻️ Duplicate comments (1)
configs/HWF435/config.h (1)

30-30: ⚠️ Potential issue | 🟠 Major

USE_ACCGYRO_BMI270 is deprecated for new target submissions.

BMI270 has been deprecated for new submissions since September 16, 2024 due to drift/calibration issues. Since HWF435 is a new target (not a rebrand of existing hardware), please remove this define unless BMI270 is actually a populated sensor variant on production boards — and even in that case the hardware should be reconsidered.

🛡️ Proposed change
 `#define` USE_GYRO_SPI_ICM42688P
 `#define` USE_ACC_SPI_ICM42688P
-#define USE_ACCGYRO_BMI270
 `#define` USE_ACCGYRO_LSM6DSK320X

Based on learnings: F411 MCU, SPI-based RX, and BMI270 gyro are deprecated platforms as of September 16, 2024; new target submissions using these should be flagged.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@configs/HWF435/config.h` at line 30, The config currently defines the
deprecated symbol USE_ACCGYRO_BMI270 for the HWF435 target; remove this define
(the USE_ACCGYRO_BMI270 macro) from the HWF435 configuration unless the BMI270
is actually present on production boards, and if it is present, escalate to
hardware review and replace with a supported accelerometer/gyro macro (or add a
guarded legacy variant flag and document why it’s required); also update related
build/config references and any README/docs that mention USE_ACCGYRO_BMI270 to
reflect the removal or the justified exception.
🧹 Nitpick comments (1)
configs/HWF435/config.h (1)

113-114: Optional: tidy up multiple consecutive blank lines and stray trailing whitespace.

Lines 113–114, 130–131 and 144 contain extra blank lines, and line 41 has trailing whitespace after PB2. Minor formatting nit only.

Also applies to: 130-131, 144-144

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@configs/HWF435/config.h` around lines 113 - 114, Remove the stray trailing
whitespace after the PB2 token and collapse multiple consecutive blank lines
into a single blank line in this config.h section; specifically trim trailing
spaces for the PB2 declaration and delete the extra empty lines around the
nearby configuration blocks so only single separation lines remain, then run a
quick whitespace/formatter pass to ensure no other trailing spaces or duplicate
blank lines remain.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@configs/HWF435/config.h`:
- Around line 115-128: TIMER_PIN_MAPPING is missing the beeper pin entry for PB2
(TMR20 CH1) and the macro lacks the trailing backslash to allow another entry;
update the TIMER_PIN_MAPPING macro by adding a new line with TIMER_PIN_MAP(13,
PB2, 2, -1) and ensure the previous line ends with a trailing backslash so the
macro continues correctly; locate the macro definition named TIMER_PIN_MAPPING
and modify it to include the new TIMER_PIN_MAP entry for index 13 (PB2) and fix
the line continuation backslash.
- Around line 115-128: Validate and correct the TIMER_PIN_MAPPING entries
against timer_at32f43x.c: ensure PB4 and PB5 (TIMER_PIN_MAP 6 and 7) refer to
non-complementary channels (not CHxN) suitable for motors, confirm
TIMER_PIN_MAP(10, PB3, 1, -1) indeed maps to TIM2_CH2 (SERVO3) and adjust
occurrence/DMA if not, verify PH2 DMA index 11 (TIMER_PIN_MAP 11) is valid and
not colliding with other timers/DMAMUX users and change it to a unique DMA index
if needed, and reassess GYRO_1_CLKIN_PIN PA8 (TIM1_CH1) so it does not consume
TIM1 required for bitbanged DShot when motors 1–4 are on TIM8 (free up TIM1/TIM8
as required); update the corresponding TIMER_PIN_MAP rows and any DMA index
constants to match the AT32F435 definitions in timer_at32f43x.c.

---

Duplicate comments:
In `@configs/HWF435/config.h`:
- Line 30: The config currently defines the deprecated symbol USE_ACCGYRO_BMI270
for the HWF435 target; remove this define (the USE_ACCGYRO_BMI270 macro) from
the HWF435 configuration unless the BMI270 is actually present on production
boards, and if it is present, escalate to hardware review and replace with a
supported accelerometer/gyro macro (or add a guarded legacy variant flag and
document why it’s required); also update related build/config references and any
README/docs that mention USE_ACCGYRO_BMI270 to reflect the removal or the
justified exception.

---

Nitpick comments:
In `@configs/HWF435/config.h`:
- Around line 113-114: Remove the stray trailing whitespace after the PB2 token
and collapse multiple consecutive blank lines into a single blank line in this
config.h section; specifically trim trailing spaces for the PB2 declaration and
delete the extra empty lines around the nearby configuration blocks so only
single separation lines remain, then run a quick whitespace/formatter pass to
ensure no other trailing spaces or duplicate blank lines remain.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cd0fb5cf-8e46-4115-9b24-f0065dfa064a

📥 Commits

Reviewing files that changed from the base of the PR and between 25a118c and 6487919.

📒 Files selected for processing (1)
  • configs/HWF435/config.h

Comment thread configs/HWF435/config.h Outdated
Co-authored-by: Osiris Inferi <github@flut.nl.eu.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Partner Program this pr is for a target from the partner program and will automatically get tier 1 status

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants