Skip to content

feat: support PROVES Flight Control Board v5e (SX1262 radio)#18

Open
Mikefly123 wants to merge 2 commits into
mainfrom
feat/v5e-board-support
Open

feat: support PROVES Flight Control Board v5e (SX1262 radio)#18
Mikefly123 wants to merge 2 commits into
mainfrom
feat/v5e-board-support

Conversation

@Mikefly123

@Mikefly123 Mikefly123 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a board port so the GRC firmware runs on the PROVES Flight Control Board v5e in addition to the ground_radio_controller and v5 boards.

  • New board boards/proves/proves_flight_control_board_v5e/ — mirrors the v5 port (upstream Pico 2 base + project hardware dtsi with dual CDC ACM, fstab, ramdisk). The only substantive difference is the radio: the v5e carries an SX1262-based E22-400M30S module instead of the v5's SX1276. Wiring follows the v5e board definition in proves-core-reference: reset P6, busy P13, dio1 P14, TX/RX antenna-switch enables P21/P22, DIO3-controlled 1.8V TCXO with 10ms startup delay, rx-boosted. SPI1 pins are identical to v5.
  • prj.conf no longer hard-sets CONFIG_LORA_SX127X. Both SX12xx drivers are default y gated on their devicetree compatible, so the board DT selects the driver. Hard-setting either is a fatal unmet-dependency Kconfig warning for boards carrying the other radio.
  • No app changes: Main.cpp binds the radio via DT_NODELABEL(lora0), which the v5e port defines.
  • README/settings.ini: v5e documented as a BOARD= alternative; ground_radio_controller remains the default.

Testing

  • Built for proves_flight_control_board_v5e/rp2350a/m33; verified CONFIG_LORA_SX126X=y and the full sx1262 node in the merged devicetree.
  • Flashed a bench v5e (UF2 via BOOTSEL) — all 6 one-board main tests pass, including SET_FREQ at 437.4 MHz, which performs a live lora_config() on the SX1262 and would return EXECUTION_ERROR on failure.
  • Regression: rebuilt for ground_radio_controller — builds green with CONFIG_LORA_SX127X=y still selected from its devicetree.

Notes

  • Stock LoRaConfig::TX_POWER = 23 exceeds the SX1262 driver's +22 dBm limit; worth revisiting before running a v5e at full power (not changed here).
  • The two-board (bft2) flow flashes one ELF to both boards, so mixed GRC↔v5e RF link testing needs a follow-up workflow change.

🤖 Generated with Claude Code

Quick builds for manual testing

For manual testing convenience, the branch v5e-portable-builds combines this PR with the portable-builds tooling. Check it out and run make build for a self-bootstrapping build (uv, venv, west workspace, and Zephyr SDK are set up automatically) — no manual environment setup needed. Switch boards by toggling BOARD= in settings.ini, then make generate followed by make build. Both ground_radio_controller and proves_flight_control_board_v5e targets build green on that branch.

Add a v5e board port mirroring the existing v5 port (upstream Pico 2
base + project hardware dtsi) with the v5e's SX1262-based E22-400M30S
LoRa module wiring taken from proves-core-reference: busy P13, dio1
P14, TX/RX antenna-switch enables P21/P22, DIO3-controlled 1.8V TCXO
(10ms startup), rx-boosted. SPI1 wiring is unchanged from v5.

Stop hard-setting CONFIG_LORA_SX127X in prj.conf: both SX12xx drivers
default on when their devicetree compatible is present, so the board
DT now selects the driver. Hard-setting either one is a fatal unmet-
dependency Kconfig warning for boards carrying the other radio.

No app changes needed: Main.cpp binds the radio via DT_NODELABEL(lora0),
which the v5e port defines.

HWIL-verified on a v5e: all 6 one-board main tests pass, including
SET_FREQ which performs a live lora_config() on the SX1262.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a new PROVES flight controller board target, proves_flight_control_board_v5e, with Kconfig, board.yml, devicetree, and defconfig files defining an SX1262-based hardware layout. Updates prj.conf to select LoRa driver via devicetree instead of hard-coding, and updates settings.ini and README accordingly.

Changes

v5e board support

Layer / File(s) Summary
Board identity and Kconfig entry
boards/proves/proves_flight_control_board_v5e/Kconfig, boards/proves/proves_flight_control_board_v5e/board.yml, boards/proves/proves_flight_control_board_v5e/proves_flight_control_board_v5e_rp2350a_m33.yaml
Defines new board Kconfig symbol with conditional SOC select, board metadata (name, vendor, SoC), and board YAML with identifier, MCU/arch, memory sizes, toolchains, and supported peripherals.
Devicetree hardware description
boards/proves/proves_flight_control_board_v5e/proves_flight_control_board_v5e_rp2350a_m33.dts, boards/proves/proves_flight_control_board_v5e/proves_flight_control_board_v5e_hardware.dtsi
Top-level DTS includes upstream RP2350A/M33 and Pico dtsi files plus the new hardware dtsi, which enables CDC ACM UARTs, configures SPI1 pinctrl, instantiates an SX1262 LoRa node, sets console chosen node, and defines fstab/ramdisk entries.
Build defaults and driver selection
boards/proves/proves_flight_control_board_v5e/proves_flight_control_board_v5e_rp2350a_m33_defconfig, prj.conf, settings.ini, README.md
Adds defconfig defaults (HEX/UF2 output, clock, console, GPIO, UART), updates prj.conf to select LoRa driver via devicetree instead of hard-coded SX127X, comments out active board line in settings.ini for both v5/v5e, and documents v5e flashing steps in README.

Estimated code review effort: 2 (Simple) | ~15 minutes

Sequence Diagram(s)

Not applicable — this PR adds static board configuration files and documentation without new multi-component runtime control flow.

Poem

A new board hops into the nest,
v5e with SX1262, dressed its best,
Devicetree picks the radio right,
No more hard-coded LoRa fight! 🐇
make generate-force, then away we bound —
Another board, another sound! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly names the new PROVES Flight Control Board v5e support and the SX1262 radio change.
Description check ✅ Passed The description matches the board-port, LoRa driver, and documentation changes in the PR.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

The Zephyr SX126x driver polls BUSY immediately after the wake-up SPI
transaction, racing the chip's ~340us warm start. When the poll samples
BUSY before the chip asserts it, the next SPI command is clocked into a
device still starting up and silently ignored. The driver sleeps the
radio after every operation and the first command after wake is always
SetRfFrequency, so SET_FREQ intermittently failed to retune the SX1262
(7 of 18 register writes dropped in release-build measurements on a
v5e; debug builds mask the race via logging delay).

Carry the one-line fix (wait out the startup window before polling) as
a patch file since the zephyr submodule tracks upstream. Verified on
hardware by reading back the RF frequency PLL registers (0x088B) after
each write: 0 drops in 35 retunes with the fix, and the two-board RF
suite passes in both directions on a mixed GRC(SX1276) + v5e(SX1262)
pair.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jrpear jrpear mentioned this pull request Jul 7, 2026
+ * next command is clocked into a device still starting up and is
+ * silently ignored. Wait out the startup window before polling.
+ */
+ k_busy_wait(500);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am a bit confused about this patch. We're not sleeping the radio as far as I know. And in any case the datasheet doesn't say "wait after wake" to send commands, it says "wait after sleep".

It is possible the delay just changed the timing of things so as to disguise a race condition causing the intermittent SET_FREQ failures the new README mentions.

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