Skip to content

feat(msp): add MSP2_INAV_WIND (0x2231) to expose wind estimator#11508

Closed
MartinovEm wants to merge 284 commits into
iNavFlight:release/9.1from
MartinovEm:feature/msp2-inav-wind
Closed

feat(msp): add MSP2_INAV_WIND (0x2231) to expose wind estimator#11508
MartinovEm wants to merge 284 commits into
iNavFlight:release/9.1from
MartinovEm:feature/msp2-inav-wind

Conversation

@MartinovEm
Copy link
Copy Markdown

@MartinovEm MartinovEm commented Apr 22, 2026

Summary

Adds a new read-only MSP command MSP2_INAV_WIND (ID 0x2231) that exposes the internal wind estimator output over MSP telemetry.

This allows ground station software, OSD overlays, and companion computers to read the estimated wind speed and direction without requiring direct firmware integration.

Response Payload

Byte offset Type Name Unit Notes
0–1 uint16 windSpeed cm/s Estimated horizontal wind speed
2–3 uint16 windAngle degrees Wind direction (0–359°, 0 = North)

Total: 4 bytes.

Implementation Details

  • getEstimatedHorizontalWindSpeed() returns angle in centidegrees [0–35999]; divided by 100 to give 0–359° output.
  • Guarded by USE_WIND_ESTIMATOR: when the estimator is not compiled in, both fields return zero, ensuring backward-compatible behaviour on builds without wind estimation.
  • The #include "flight/wind_estimator.h" in fc_msp.c is also wrapped in #ifdef USE_WIND_ESTIMATOR.

Files Changed

  • src/main/msp/msp_protocol_v2_inav.h — defines MSP2_INAV_WIND 0x2231
  • src/main/fc/fc_msp.c — conditional include + new case MSP2_INAV_WIND: handler

daijoubu and others added 30 commits January 30, 2026 17:10
…g messages.

Corrected filters for Rx FIFO and correctly read FIFO level for polling.
…ssages in FIFO at initial check so we don't get stuck in the loop.

Removed interrupt config code in favour of polling the receive FIFO.
daijoubu and others added 25 commits May 29, 2026 19:50
PLL2M was hardcoded to 5, which assumes HSE = 8 MHz. On KAKUTEH7WING
(HSE = 16 MHz) this gives VCO = 16/5 * 500 = 1600 MHz (out of spec)
and SDMMC clock = 400 MHz instead of the required 200 MHz.

Fix: compute PLL2M as HSE_VALUE / 1600000, pinning the VCO input to
exactly 1.6 MHz for any HSE frequency. With N=500 this gives VCO=800 MHz:

  HSE=8 MHz:  M=5,  N=500 → VCO=800 MHz (identical to original)
  HSE=16 MHz: M=10, N=500 → VCO=800 MHz (correct for KAKUTEH7WING)

PLL2R/4 = 200 MHz (SDMMC), PLL2P/2 = 400 MHz. VCIRANGE_0 (1–2 MHz)
is correct for the 1.6 MHz VCI input on all targets.

Also adds STATIC_ASSERT to catch future targets with non-multiple HSE,
and corrects the PLL2P comment (was "500Mhz", should be "400Mhz").

Fixes iNavFlight#11594
If PLL2 fails to lock at startup the SDMMC clock is dead and the SD
card will fail silently. Call Error_Handler() (infinite loop) on
failure to make the fault visible rather than continuing into
undefined behaviour.
PLL1 VCI input is HSE/M = 2 MHz on all H7 targets, which falls in the
2-4 MHz range (VCIRANGE_1). The previous VCIRANGE_2 (4-8 MHz) was
incorrect and affected PLL charge pump calibration.

Fixes iNavFlight#11602
Remove redundant prose that duplicated the assert, remove board-specific
name from shared init code, and shorten the assert slug to match
codebase conventions.
…mic-m-divider

fix: make PLL2M dynamic to keep VCO=800MHz for any HSE frequency (closes iNavFlight#11594)
Fix: Prioritize Airspeed over GPS for turn acceleration compensation
…2688-devhw

Fix ICM42688 bus device hardware type on GEPRC targets
…x_fixed_value

VTOL.md: Rename smix max fixed value
* Add new target: AEDROXH7 (Airbot Systems AEDROX H7)

STM32H743 flight controller with ICM42688P gyro, W25N01G NAND flash,
DPS310 baro, MAX7456 analog OSD, HD OSD via MSP DisplayPort, and
8 motor outputs split across TIM1 and TIM8.

SPI3 MOSI on PB2 requires explicit GPIO_AF7_SPI3 override.
Magnetometer enabled on I2C1 (hardware present, not in BF config).

* AEDROXH7: replace UART4 with DroneCAN on PD0/PD1

PD0/PD1 connect to the CAN transceiver (CANL/CANH pads visible on
board), not to a user-accessible UART4 header. Replace UART4 with
USE_DRONECAN defines. CAN standby pin TBD pending INAV syntax
confirmation.

* AEDROXH7: add CAN1_STANDBY PD3 (not yet tested)

* CI: re-trigger build to pick up fc_msp.c sign-compare fix in maintenance-9.x
…nance-10.x

Removes the DroneCAN DSDLC library (lib/main/Dronecan -- entirely new in 10.x)
and reverts STM32F4/F7/H7 HAL libraries to their maintenance-9.x versions.
932 files. No post-merge commits touched lib/ -- this is a clean mechanical revert.
Reverts 319 STM32CubeF7 SDK extraction files introduced by the accidental
maintenance-10.x merge. No post-merge commits touched this directory --
this is a clean mechanical revert.
This reverts commit 10343b4, reversing
changes made to bb61218.
…-merge

Revert accidental merge of maintenance-10.x into maintenance-9.x
…e-ordering-stdperiph

drivers: fix DMA request disable ordering in timer IRQ handlers and stop functions
Add support for XTX XT25F128F nor flash chip
@MartinovEm MartinovEm force-pushed the feature/msp2-inav-wind branch from 8ce6ea5 to 3925ca4 Compare May 31, 2026 07:17
@sensei-hacker sensei-hacker changed the base branch from maintenance-9.x to release/9.1 May 31, 2026 17:04
@sensei-hacker
Copy link
Copy Markdown
Member

Hi — thank you for this contribution.

On 2026-05-24, maintenance-9.x had an accidental merge of maintenance-10.x that
contaminated its history with ~27,000 unrelated files. That merge has since been reverted,
and release/9.1 is now the clean release branch for the 9.1 cycle.

Because your branch was synced with maintenance-9.x after that bad merge, this PR's
diff currently includes thousands of unrelated files. Rather than asking you to rebase,
we've opened a new PR (#11611) that cherry-picks your commits cleanly against release/9.1.

Closing this PR in favour of #11611 — your commit authorship is preserved in the new PR.
Thanks again for the contribution.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.