Skip to content

Add Nexus XR Wing target#1098

Open
ot0tot wants to merge 4 commits into
betaflight:masterfrom
ot0tot:Add-Nexus-XR-Wing
Open

Add Nexus XR Wing target#1098
ot0tot wants to merge 4 commits into
betaflight:masterfrom
ot0tot:Add-Nexus-XR-Wing

Conversation

@ot0tot
Copy link
Copy Markdown
Contributor

@ot0tot ot0tot commented May 7, 2026

Add Radiomaster Nexus XR Wing target

@coderabbitai note this is a Wing FC, and the usual Betaflight quad FC restrictions do not apply.

  • Hardware test

Summary by CodeRabbit

Release Notes

  • New Features
    • Added support for the NEXUSXR flight controller board with complete configuration including motor and servo control, multiple communication interfaces, sensor support, customizable LED indicators, and integrated telemetry and blackbox recording functionality.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack

Walkthrough

A new Betaflight board configuration file for the NEXUSXR flight controller is added, defining the STM32F7X2 target MCU, GPIO pin assignments for motors, servos, and communication peripherals, timer mappings, and default hardware/software settings for sensors, telemetry, and serial RX.

Changes

NEXUSXR Board Configuration

Layer / File(s) Summary
License and Board Identity
configs/NEXUSXR/config.h
File header with Betaflight licensing and pragma guard. Board identity macros define STM32F7X2 MCU, NEXUSXR board name, RDMS manufacturer ID, and enable accelerometer, gyroscope, BMP280 barometer, and onboard flash.
GPIO and Peripheral Pin Assignments
configs/NEXUSXR/config.h
Motor and servo GPIO mappings (M1–M8 on PB11/PB10/PA3/PA2/etc., S1–S6 on PA8/PA11/PB15/etc.). UART port definitions including ELRS RX on UART1 (PA10/PA9) and additional UART ports. I2C (PB8/PB9), SPI1 (PA5/PA6/PA7), ADC channels, LED pins, RF enable (PC13), flash CS (PB3), and gyro interrupt/CS (PA5/PA4).
Timer Channel-to-Pin Mappings
configs/NEXUSXR/config.h
TIMER_PIN_MAPPING macro list with multiple TIMER_PIN_MAP entries defining timer channel–to–pin relationships for PWM output control.
Default Hardware and Software Configuration
configs/NEXUSXR/config.h
ADC/DMA instance assignment, barometer/magnetometer I2C instances, blackbox device selection, DSHOT bitbang enablement, current/voltage meter source scaling, ELRS serial RX feature/provider/UART selection, flash/gyro SPI instance assignment, and gyro alignment configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

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

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description lacks required information and incomplete sections from the template. The author provided minimal detail and only completed one checkbox item, leaving the mandatory review checklist largely empty. Complete the pull request description by filling out all mandatory checklist items (hardware review, testing, guidelines compliance, standards adherence, flight testing, and resolved comments/issues). Provide more details about the Wing FC design and how it complies with Betaflight guidelines.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a new Nexus XR Wing target configuration.
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.

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@configs/NEXUSXR/config.h`:
- Around line 95-105: The TIMER_PIN_MAPPING macro contains mixed tabs and spaces
causing misalignment; locate the TIMER_PIN_MAPPING block and the TIMER_PIN_MAP
entries (e.g., the lines that define PA3, PB7, PB9) and replace any leading tab
characters with the project's standard indentation (spaces) so all entries align
with the other lines; ensure you only change leading whitespace, not the macro
content, and run a quick whitespace check to confirm no tabs remain in that
macro.
🪄 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: ac7b633b-391b-4001-84a7-fd70e3091605

📥 Commits

Reviewing files that changed from the base of the PR and between ee3d78a and 51e70cc.

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

Comment thread configs/NEXUSXR/config.h Outdated
@ot0tot
Copy link
Copy Markdown
Contributor Author

ot0tot commented May 7, 2026

@coderabbitai review and approve

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Tip

For best results, initiate chat on the files or code changes.

@ot0tot, I'll kick off a review of the PR right away! 🐰

However, please note that I cannot approve the PR via a review comment. To request an approval, please post a top-level PR comment (not a reply) with:

`@coderabbitai` approve

[review]

@haslinghuis
Copy link
Copy Markdown
Member

@coderabbitai approve

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

✅ Actions performed

Comments resolved and changes approved.

Comment thread configs/NEXUSXR/config.h
Comment on lines +43 to +45
#ifndef USE_SERVOS
#define USE_SERVOS
#endif
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

USE_WING should already include USE_SERVOS - but being explicit does not hurt.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, just following the template we used for other Wing FCs. I'm fine with removing though, as it is redundant.

Comment thread configs/NEXUSXR/config.h

#define BARO_I2C_INSTANCE I2CDEV_3
#define MAG_I2C_INSTANCE I2CDEV_3
#define ADC_INSTANCE ADC1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ADC1 is default - but again - nothing wrong to be explicit

Comment thread configs/NEXUSXR/config.h
#define DEFAULT_CURRENT_METER_SCALE 273
#define PINIO1_BOX 40
#define PINIO1_CONFIG 129
#define BOX_USER1_NAME "ELRS OFF"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This would be good practice for boards to avoid DFU hijack ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, the better solution is to just not use those pins for receiver/GPS.

I think this would add an unnecessary level of complexity and lead to support headaches. It would also only work with built-in receivers, and require a spare GPIO.

@ot0tot
Copy link
Copy Markdown
Contributor Author

ot0tot commented May 7, 2026

Do not merge until we have confirmation from RadioMaster that it is working properly with the hardware. We currently do not have hardware to test.

Comment thread configs/NEXUSXR/config.h
#define ADC1_DMA_OPT 0

#define BARO_I2C_INSTANCE I2CDEV_3
#define MAG_I2C_INSTANCE I2CDEV_3
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I2C pins are not broken out. This should probably be moved to I2C2, which will share pins with UART3 (Port C).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants