feat(msp): add MSP2_INAV_WIND (0x2231) to expose wind estimator#11508
Closed
MartinovEm wants to merge 284 commits into
Closed
feat(msp): add MSP2_INAV_WIND (0x2231) to expose wind estimator#11508MartinovEm wants to merge 284 commits into
MartinovEm wants to merge 284 commits into
Conversation
…apted for c from https://github.com/ArduPilot/ardupilot/blob/4f4457d259c54bff9a7d909c71e471f7cf1ef8d9/libraries/AP_HAL_ChibiOS/CanIface.cpp Remove redundant call to enable FDCAN clock.
…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.
…cceleration function
…driver support on the STM32Fxxx series.
…ALs do not support it.
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.
…SP changes not in scope)" This reverts commit 92cf6ab.
…rning" This reverts commit 3b393c5.
…' into fix/11594-pll2-dynamic-m-divider
…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
…ftrf Basic support for softRF
…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.
…-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
JHEMCUF435: enable UART2
8ce6ea5 to
3925ca4
Compare
Member
|
Hi — thank you for this contribution. On 2026-05-24, Because your branch was synced with Closing this PR in favour of #11611 — your commit authorship is preserved in the new PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new read-only MSP command
MSP2_INAV_WIND(ID0x2231) 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
Total: 4 bytes.
Implementation Details
getEstimatedHorizontalWindSpeed()returns angle in centidegrees [0–35999]; divided by 100 to give 0–359° output.USE_WIND_ESTIMATOR: when the estimator is not compiled in, both fields return zero, ensuring backward-compatible behaviour on builds without wind estimation.#include "flight/wind_estimator.h"infc_msp.cis also wrapped in#ifdef USE_WIND_ESTIMATOR.Files Changed
src/main/msp/msp_protocol_v2_inav.h— definesMSP2_INAV_WIND 0x2231src/main/fc/fc_msp.c— conditional include + newcase MSP2_INAV_WIND:handler