Skip to content

chore: remove STM32F2 radios; make them view-only in Companion - #26

Draft
pfeerick wants to merge 5 commits into
mainfrom
chore/remove-stm32f2-radios
Draft

pfeerick wants to merge 5 commits into
mainfrom
chore/remove-stm32f2-radios

Conversation

@pfeerick

@pfeerick pfeerick commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Summary of changes:

EdgeTX#7763 broke firmware builds for STM32F2 radios. EdgeTX 2.11 was the last release to support them, so this removes STM32F2 support from the firmware tree instead of fixing it. It also makes Companion treat these radios as view-only, so it can't write 3.0-format data to a radio still running 2.11.

Radios affected: FrSky X9D, X9D+ (2014), QX7 (ACCST), X9 Lite/Lite S, X-Lite/S/Pro; Jumper T12, T-Lite, T-Pro; BetaFPV LiteRadio3 Pro; RadioMaster T8 and TX12. Their F4 siblings are unaffected: X9D+ 2019, QX7 ACCESS, X9E, T12 MAX, T-Pro V2/S, TX12 MK2, Commando 8, Bumblebee and so on.

Commits

  1. Move the default build and YAML generation off STM32F2. The default PCB=X9D+ used to be the F2 2014 revision. Companion, simu and tests-radio builds use that default, as does the Companion CI job. It's now PCBREV=2019. generate-yaml.sh now regenerates the shared parsers from F4 boards. Its output is byte-identical.
  2. Remove the F2 board definitions and the code only they used. This covers hal.h/board.h blocks, XLITE/9X navigation, QX7 PCB revision probing, Bluetooth chip probing, X-Lite S jack handling and the X9D ASPI LCD driver. #else fallbacks that only F2 boards reached are deleted, so a new board that matches no branch fails to build instead of silently inheriting X9D pins.
    • PCB=X9D+ with any PCBREV other than 2019 now fails with a clear message. This includes a stale PCBREV=2014 cached in CMakeCache.txt.
    • A bare PCB=X7 now fails with a clear message.
  3. Remove STM32F2 MCU support: the HAL/LL drivers, CMSIS device headers, startup, linker and system files, and the STM32F2 branches in the drivers (about 182k lines).
  4. Tools and issue template. F2 boards are dropped from the build scripts. The bug report template keeps the F2 radios but marks them "(2.11 max)", adds a notice linking the STM32 platform support page, and splits TX12 from TX12 MK2.
  5. Companion: F2 documents are view-only.
    • A new Board::IsF2 capability comes from the hw_defs JSON cpu_type, so there's no board list to maintain.
    • Save, Save As, Write Models and Settings to Radio/SD Path, and Export Model are disabled and guarded for F2 documents.
    • A notice is shown when an F2 document opens. Writing, saving or exporting needs Companion 2.11.
    • Switching to a supported radio's profile still converts the document. Save All skips read-only documents so this conversion isn't interrupted, and copy/paste between documents still works.

Deliberately kept

  • docs/, which already marks F2 as end of support.
  • The 13 F2 radio/src/boards/hw_defs/*.json files, frozen, because Companion reads them. They can no longer be regenerated. If the shared schema gains a required field, they'll need hand edits, and validate_hw_defs will flag that.
  • Their entries in radio/util/hw_defs/legacy_names.py. test_templates.py renders every JSON file.
  • "STM32F2" in tools/hwdef_schema.json.
  • The KEY_SHIFT key enum value. Companion and the web simulator mirror it.

Verification

  • Firmware is unchanged for remaining radios. All 19 remaining taranis radios, plus tx16s, x10, pl18 and tx15, were built from main and from this branch at identical paths. Section sizes match exactly, and the disassembly (objdump -d --no-addresses --no-show-raw-insn) differs only in the embedded git SHA and build-date strings. The hal.h preprocessor macro dumps (hardware_defs) are identical.
  • YAML: the parsers regenerated from the new generator flavours match the committed files exactly. This includes commando8 and bumblebee, which share files.
  • Checks:
    • check_radio_macros.py passes at every commit.
    • json_validator.py: 57/57 files valid.
    • test_templates.py: all 912 combinations pass.
  • Configure: a native configure with no PCB resolves to X9D+ 2019 (STM32F407xE). PCBREV=2014, a bare PCB=X7 and PCB=XLITE each fail with a clear error.
  • Tests:
    • gtests-radio passes on default X9D+ 2019 (177), x7access (172), x9e (180) and tx16s (228). x9e is now the only remaining non-serial PXX1 board.
    • gtests-companion: 40/40 pass, including new Stm32F2Boards tests for the F2 detection and its F4 siblings.

Still to do before upstream

  • Run Companion by hand with an F2 profile on a 2.11 radio/SD dump:
    • the notice shows;
    • the write and save actions are disabled;
    • closing doesn't offer to save;
    • switching to an X9D+ 2019 profile converts the document and makes it writable.
  • Decide whether to also fix the standalone hardware_defs target. This problem predates this PR: its preprocessor command doesn't get the include path for the generated hal_settings.h, so tools/generate-hw-defs.sh fails on main.

🤖 Generated with Claude Code

pfeerick and others added 5 commits October 2, 2026 02:07
- Default X9D+ PCBREV is now 2019 (F4). The default PCB (X9D+) was
  previously the F2 2014 revision, which Companion, simu and tests-radio
  builds use when no PCB is given.
- Map TPROV2 and BUMBLEBEE to their YAML parser in storage/yaml/CMakeLists.txt
  (yaml_datastructs.cpp already included it for them) and rename it
  yaml_datastructs_tprov2.cpp.
- COMMANDO8 now uses yaml_datastructs_128x64.cpp, which is byte-identical
  to the yaml_datastructs_xlite.cpp it used before.
- generate-yaml.sh regenerates the shared parsers from F4 boards
  (x7access, tprov2) instead of F2 ones. Output is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EdgeTX 2.11 was the last release to support STM32F2 radios. Remove their
firmware build targets and the code only they used:

- X9D, X9D+ (2014), QX7 (ACCST), X9 Lite/Lite S, X-Lite/S/Pro, Jumper T12,
  T-Lite, T-Pro, BetaFPV LR3Pro, RadioMaster T8 and TX12.
- Their hal.h/board.h pin and option blocks, XLITE/9X navigation,
  QX7 PCB revision probing, Bluetooth chip probing, X-Lite S shared
  DSC/headphone jack handling and the X9D ASPI LCD driver.
- Fallback #else branches only F2 boards fell through to are removed, so a
  new board matching no branch fails to build rather than inheriting them.
- X9D+ now requires PCBREV=2019, and a bare PCB=X7 now fails with a clear
  message instead of building the removed F2 QX7.
- yaml_datastructs_x9d/xlite/xlites.cpp are removed. They were
  byte-identical to x9dp2019/128x64 or only used by F2 boards.

The F2 hw_defs JSON files stay, frozen, so Companion can still read
settings and models from these radios.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With no STM32F2 radios left to build, remove the MCU support code:

- Vendored STM32F2xx HAL/LL drivers and CMSIS device headers.
- The f2 CMake include, system init, HAL config, startup file, linker
  scripts and ST-Link config.
- STM32F2/STM32F205xx branches in the STM32 drivers, USB CDC config, MCU
  ID check and VBAT scaling.
- STM32F2 from the S.PORT one-bit sampling setting's conditions. Its
  YAML/settings layout is unchanged for F4 radios.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Remove STM32F2 boards from the vendor build scripts (boards.py,
  build-frsky/jumper/radiomaster.py), radio/util/build-firmware.py and
  fwoptions.py. Delete build-betafpv.py, whose only board was the LR3Pro.
- build-multilang.sh: remove the hard-coded x9dp entry, the F2 processor
  group, and F2 targets from the help examples.
- Bug report template: STM32F2 radios stay selectable, but are marked
  "2.11 max". A notice links the STM32 platform support page and says
  firmware bug reports for them on later versions won't be accepted.
  RadioMaster TX12 and TX12MK2 are now separate options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EdgeTX 2.11 was the last release for STM32F2 radios. Companion can still
read their models and settings, but must not write current-format data
back to a radio still running 2.11.

- Add a Board::IsF2 capability, read from each board's hw_defs JSON
  cpu_type, so there's no board list to maintain.
- For F2 documents, Save, Save As, Write Models and Settings to
  Radio/SD Path, and Export Model are disabled and guarded. Save All
  skips them, so switching to a supported radio's profile still converts
  the open document.
- An information notice, linking the STM32 platform support page, is
  shown once when an F2 document is opened or a profile change makes one
  F2. Closing a modified F2 document offers Discard/Cancel only.
- gtests cover the F2 detection, both for the expected boards and their
  F4 siblings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant