Skip to content

Update STM32H7xx HAL from V1.11.4 to V1.13.0 (DMA IRQHandler bug, SPI overflow, FDCAN fixes) #11563

@daijoubu

Description

@daijoubu

Summary

The STM32H7xx HAL driver in INAV is at V1.11.4 and CMSIS Device at V1.10.5 (mismatched — they should come from the same STM32CubeH7 package). The latest STM32CubeH7 release is V1.13.0 (February 2026). Several fixes in V1.12.0 through V1.13.0 are directly relevant to INAV on H7 targets.

Affects all 20+ targets defining USE_SDCARD_SDIO and all H7 targets generally (MATEKH743, KAKUTEH7WING, BROTHERHOBBYH743, CORVON743V1, etc.).


Relevant fixes by severity

HIGH

DMA IRQHandler CT bit inversion fixed (V1.13.0)
An inverted CT bit check in HAL_DMA_IRQHandler() caused incorrect callback execution. INAV uses DMA extensively — SPI (gyro, barometer, OSD), UART (GPS, RC, telemetry), SDMMC (SD card logging). This is a silent correctness bug that could cause missed or wrong DMA completion callbacks.

SPI TX buffer overflow in interrupt routine (V1.13.0)
Overflow in the SPI interrupt-driven TX path. INAV uses SPI for gyro, barometer, OSD, and external flash. A TX overflow here means corrupted sensor reads with no error indication.

FDCAN overflow prevention (V1.13.0)
HAL_FDCAN_GetRxMessage() and HAL_FDCAN_ConfigFilter() overflow fixes. Directly relevant to DroneCAN on H7 targets which use FDCAN.

HCLK frequency calculation fix (V1.12.1)
Wrong result from LL_RCC_GetSystemClocksFreq(). Incorrect clock frequencies silently misconfigure all peripheral baud rates and timer periods.

MEDIUM

UART DMA Rx abort incorrectly impacted Tx polling (V1.12.0)
Affects UART used for GPS, RC receivers, telemetry.

UART Rx buffer boundary write prevention (V1.12.0)
Potential memory corruption on serial receive in FIFO interrupt mode.

UART RxEventCallback position accuracy (V1.13.0)
Position reporting fix with ReceptionToIdle + delayed interrupts.

I2C errata I2C2-190208 workaround (V1.12.0)
Transmission stall workaround. Affects I2C barometer, compass, and some GPS modules.

SDMMC SD card V1 specification support (V1.13.0)
Older SD cards (V1.x) not correctly detected. May explain reports of certain SD cards not working on H7 boards.

Timer UIF spurious interrupt on init (V1.12.0)
UIF flag not cleared in TIM_Base_SetConfig, causing a spurious update interrupt on timer initialisation. Affects motor PWM and servo output.

Timer complementary channel disable fix (V1.13.0)
Affects DSHOT and bidirectional DSHOT output on H7.

LOW

  • QSPI race condition in DMA transfers (V1.12.1) — affects external flash
  • GPIO pull-down in analog mode (V1.13.0)
  • CMSIS GPIO MODER naming, linker template alignment (V1.12.0)

Current state

Component Current Latest Gap
STM32H7xx HAL V1.11.4 V1.13.0 2 minor versions
CMSIS Device V1.10.5 V1.13.0 3 minor versions + mismatched from HAL

The CMSIS/HAL version mismatch (1.10.5 vs 1.11.4) indicates they were updated independently at some point and should be re-synchronised as part of this update.


H7-specific workarounds to review during update

INAV has three H7 workarounds in src/main/target/system_stm32h7xx.c that should be re-evaluated against V1.13.0:

  • USE_H7_HSERDY_SLOW_WORKAROUND (line 273)
  • USE_H7_HSE_TIMEOUT_WORKAROUND (line 309)
  • HandleStuckSysTick (line 170)

These may have been addressed in the HAL update or may still be required.


Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions