Skip to content

Maintenance 9.x to maintenance-10#11409

Merged
sensei-hacker merged 82 commits intomaintenance-10.xfrom
maintenance-9.x
Mar 7, 2026
Merged

Maintenance 9.x to maintenance-10#11409
sensei-hacker merged 82 commits intomaintenance-10.xfrom
maintenance-9.x

Conversation

@sensei-hacker
Copy link
Member

No description provided.

mmosca and others added 30 commits December 16, 2024 00:21
Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
Deprecate the following MSP commands with replacement info:
- MSP_ANALOG (110) -> MSP2_INAV_ANALOG
- MSP_MISC (114) / MSP_SET_MISC (207) -> MSP2_INAV_MISC / MSP2_INAV_SET_MISC
- MSP_PIDNAMES (117) -> no replacement needed
- MSP_FILTER_CONFIG (92) / MSP_SET_FILTER_CONFIG (93) -> MSP2_COMMON_SETTING
- MSP_PID_ADVANCED (94) / MSP_SET_PID_ADVANCED (95) -> MSP_INAV_PID
- MSP_OSD_CONFIG (84) / MSP_SET_OSD_CONFIG (85) -> MSP2_INAV_OSD_*
- MSP_POSITION_ESTIMATION_CONFIG (16) / MSP_SET_POSITION_ESTIMATION_CONFIG (17) -> MSP2_COMMON_SETTING
- MSP_SERVO_MIX_RULES (241) / MSP_SET_SERVO_MIX_RULE (242) -> MSP2_INAV_SERVO_MIXER

Commands remain fully functional. This gives third-party developers
a full major release cycle of notice before removal.

Also adds "replaced_by" field to the MSP message JSON schema
(docs/development/msp/format.md) and populates it for all 14 entries.
Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
When disarmed, the servo mixer was unconditionally setting servo outputs
to motorConfig()->mincommand for any servo with a throttle mixer rule.
This ignored servo reversal (negative servoParams rate) and negative
mixer weights, causing reversed throttle servos to go to full output
instead of minimum on disarm - a safety hazard.

Fix by forcing throttle inputs to minimum (-500) before the mixer loop
so the normal pipeline correctly computes safe positions accounting for
reversal and negative weights. Remove the broken post-hoc override.
Add timeout guards to unbounded busy-wait loops in the SD card drivers.
A problematic SD card could cause sdcardSpi_deselect() to spin forever
on busIsBusy(), freezing the entire FC since blackbox runs inline with
the PID loop.

- sdcard_spi.c: Add 100K-iteration timeout to sdcardSpi_deselect(),
  matching the existing pattern in sdcardSpi_init(). On timeout,
  increment failureCount and disable card at threshold.
- sdmmc_sdio_f4xx.c: Add 10K-iteration timeout to DMA disable loop.
  Add SD_DATATIMEOUT software backstop to three FIFO read loops
  (SD_HighSpeed, SD_GetCardStatus, SD_FindSCR) as defense-in-depth
  behind the hardware SDIO_STA_DTIMEOUT.
If the DMA stream remains enabled after the timeout, set
TransferError and return early to avoid configuring a
still-active DMA stream.
Updated contact method for hardware feature requests.
SDMODEL SDH7 V2 flight controller with MPU6000 on SPI4 (CW270),
MAX7456 OSD on SPI2, SD card blackbox on SPI1, BMP280/MS5611 baro
and IST8310 mag on I2C1, 8 motor outputs across TIM2/3/5/8,
VCP + 6 UARTs (UART7 RX-only for ESC sensor).
…RT2 for onboard Bluetooth MSP

Remove the camera control timer output on PE9. Add config.c to wire
PINIO1/PINIO2 to USER1/USER2 mode boxes and preset UART2 for MSP at
115200 baud since it is connected to an onboard Bluetooth module.
Two issues fixed:

1. serial.c: serialIsConnected() was not returning the result from
   the vtable isConnected call, always returning true regardless of
   actual connection state.

2. vcpf4/usbd_cdc_vcp.c: VCP_DataTx() had infinite loops waiting for
   TX state and buffer space. If USB was disconnected, these loops
   would never exit, locking up the flight controller.

   Added 50ms timeout to both blocking loops. On timeout, returns
   USBD_FAIL and CDC_Send_DATA returns 0 to indicate failure.

Tested on SPEEDYBEEF405WING - FC continues operating normally after
USB disconnect instead of locking up.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Same fix as STM32F4: added 50ms timeout to blocking loops in
CDC_Send_DATA() that wait for TX state and buffer space.

On timeout, returns partial byte count (or 0) instead of blocking
forever when USB is disconnected.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous implementation incorrectly subtracted RX buffer usage
from TX buffer size. Fixed to properly calculate free space in the
outbound (APP_Rx) circular buffer using the correct pointer math.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Register callback for CDC control line state changes to track when
the host has actually opened the COM port (DTR signal). This provides
more reliable connection detection than just checking USB enumeration
state.

usbVcpIsConnected() now returns true only when:
- USB is connected (hardware)
- USB is configured (enumerated)
- Host has opened COM port (DTR high)

This helps prevent writes to USB when no host application is listening,
which can cause buffer buildup and delays.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On boards without VBUS sensing, USB hardware disconnect may not be
detected. Treat USB suspend event as a disconnect to prevent blocking
on writes when cable is unplugged.

When suspend occurs, set bDeviceState = UNCONNECTED so that
usbIsConnected() returns false and writes are skipped.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Default cdcPortOpened to true so MSP works immediately on connection.
DTR state will be updated when host explicitly sets/clears it.

Previous default of false broke MSP on tools that don't assert DTR.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sensei-hacker and others added 28 commits March 2, 2026 13:40
…t-commitish

CI: fix pr-test-builds release creation
Create per-pin AF lookup tables (bus_spi_stm32h7xx.h and
bus_spi_stm32f7xx.h) and use them in bus_spi_hal_ll.c to
automatically resolve the correct GPIO AF for each SPI pin.

Previously, SPI3 on STM32H743 applied AF6 to all pins. On H743,
AF6 on PB5 is SPI3_MISO - the MOSI function requires AF7. Targets
routing SPI3_MOSI to PB5 (e.g. HAKRCH743 MAX7456 OSD) received no
MOSI signal. Targets may still define SPI*_SCK/MISO/MOSI_AF in
target.h to override the table.
Both bus_spi_stm32h7xx.h and bus_spi_stm32f7xx.h use CONCAT4 but relied
on transitive includes from the including translation unit to provide it.
Add an explicit include to make the dependency self-contained.
check_linker_flag() requires CMake 3.18. Use include(CheckLinkerFlag OPTIONAL)
and if(COMMAND check_linker_flag) to probe for the module's availability rather
than hardcoding a version number. On CMake < 3.18 the include silently does
nothing, the guard skips the call, and LINKER_SUPPORTS_NO_RWX_WARNING is left
unset — the flag is simply not added, which is safe because linkers old enough
to ship with CMake < 3.18 do not produce the RWX warning anyway.
Trackback flight controller lock up fix
Multicopter althold altitude adjustment manual climb rate fix
Multifunction add battery voltage warnings
Replace three uses of double-precision library functions with their
float equivalents, eliminating software-emulated double math on the
Cortex-M7 FPV5-SP-D16 (single-precision-only) FPU:

- gps_ublox.c: atof() -> fastA2F() in gpsDecodeProtocolVersion().
  atof() pulled in libc_nano strtod (28 KB of double-precision parsing
  machinery) to parse simple version strings like "18.00". fastA2F()
  is already in the codebase and covers this use case.

- maths.c: exp/pow (double) -> expf/powf in gaussian().
  The explicit (double) casts defeated the -fsingle-precision-constant
  flag. gaussian() is called from the IMU loop at up to 1000 Hz, so
  switching to hardware-accelerated single-precision also improves
  runtime performance.

- vtx_smartaudio.c: pow(10.0, ...) -> powf(10.0f, ...) in saDbiToMw().
  Combined with the maths.c change, removes all callers of double pow,
  dropping libm e_pow.o from the link entirely.

Flash savings on MATEKF722 (STM32F722, 512 KB):
  text: -16,560 B  data: -376 B  total: -16,936 B (~16.5 KB)
Follow-up to the single-precision math change that saves ~17 KB of
flash on STM32F722 targets:

- maths.c: Replace powf(x, 2.0f) with explicit multiplies in
  gaussian(). Clearer intent and avoids any dependency on libm
  reducing integer-exponent powf to a multiply.

- vtx_smartaudio.c: Add roundf() before uint16_t cast in saDbiToMw().
  powf(10.0f, 1.0f) may return 9.999...f on some libm implementations,
  which would truncate to 9 mW instead of the correct 10 mW. roundf()
  closes the hazard at the cost of one FPU instruction.
Fix SPI GPIO alternate function assignment on STM32H7/F7
…mands

Comment 16 MSP commands as deprecated (for removal in INAV 10 or 11)
…isarm

Fix servo throttle mix outputting wrong position when disarmed
Fix SD card busy-wait loops that can lock up flight controller
Fix USB VCP lockup on disconnect (issue #11348)
…iles

Rename profile commands to control_profile
Fix hard faults when handling large MSP responses over CRSF
Add Loiter to LED control on mode flight
…r-flag

cmake/sitl: use CheckLinkerFlag instead of GCC version check for --no-warn-rwx-segments
Position estimator corrections improvement and estimated velocity filtering
…-math

Use single-precision math to save ~17 KB of flash on F722 targets
Bugfix: SDIO capacity shows incorrectly on F4 devices
@sensei-hacker sensei-hacker merged commit 0791829 into maintenance-10.x Mar 7, 2026
44 checks passed
@github-actions
Copy link

github-actions bot commented Mar 7, 2026

Test firmware build ready — commit 2db79da

Download firmware for PR #11409

225 targets built. Find your board's .hex file by name on that page (e.g. MATEKF405SE.hex). Files are individually downloadable — no GitHub login required.

Development build for testing only. Use Full Chip Erase when flashing.

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.