Update STM32H7xx HAL to v1.11.6 and CMSIS Device to v1.10.7#11578
Open
daijoubu wants to merge 4 commits into
Open
Update STM32H7xx HAL to v1.11.6 and CMSIS Device to v1.10.7#11578daijoubu wants to merge 4 commits into
daijoubu wants to merge 4 commits into
Conversation
Update the STM32H7xx HAL driver from V1.11.4 to V1.11.6 and CMSIS Device from V1.10.5 to V1.10.7, sourced from STM32CubeH7 v1.13.0. Key fixes included in this update: - DMA IRQHandler CT bit inversion fix (HAL V1.11.5) - HCLK frequency calculation fix (HAL V1.11.6) - GPIO_MODER MODER10_Pos/Msk typo fixes (CMSIS V1.10.7) INAV-specific patches reapplied after swap: - Remove dead #include "common/log.h" from stm32h7xx_hal_fdcan.c (LOG_DEBUG calls were removed in a prior commit) Build verified on MATEKH743, SPEEDYBEEF405WING, MATEKF765SE, and SITL.
Pass __FPU_PRESENT=1U (matching the CMSIS header) instead of =1, and route vendor include directories through SYSTEM_INCLUDE_DIRECTORIES (-isystem) so upstream vendor headers can't trigger -Wmacro-redefined. Also remove the INAV-specific #ifndef __FPU_PRESENT guard from stm32h743xx.h — it is not present in the upstream ST CMSIS and is no longer needed with the cmake fix in place. This avoids confusion on future HAL/CMSIS updates.
Contributor
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
cortex-m4f.cmake is shared by F4 and AT32 targets only (not H7). The F4 CMSIS header defines __FPU_PRESENT as 1 (without U suffix), so passing =1U from cmake triggers -Wmacro-redefined which is fatal with -Werror. Revert to =1 to match the header value.
cortex-m7.cmake: back to __FPU_PRESENT=1 (matches F7 headers, avoids -Wmacro-redefined on F7 targets where headers define '1' not '1U') stm32h743xx.h: restore #ifndef guard so the header's own 1U define is skipped when cmake has already set __FPU_PRESENT=1, avoiding any token mismatch between cmake '1' and header '1U'
|
Test firmware build ready — commit Download firmware for PR #11578 234 targets built. Find your board's
|
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
Update the STM32H7xx HAL driver from V1.11.4 to V1.11.6 and CMSIS
Device from V1.10.5 to V1.10.7, sourced from STM32CubeH7 v1.13.0.
Key Bug Fixes Included
DMA IRQHandler CT bit inversion (HAL V1.11.5) — Wrong callbacks
triggered, affecting SPI, UART, and SDMMC on H7
SPI TX buffer overflow in ISR (HAL V1.11.6) — Silent corruption
on gyro, baro, and OSD
FDCAN overflow prevention (HAL V1.11.5) — DroneCAN stability
HCLK frequency calculation fix (HAL V1.11.6) —
LL_RCC_GetSystemClocksFreq()and
HAL_RCC_GetHCLKFreq()were missing the D1 core prescaler (D1CPRE)in their HCLK computation. On H7, the clock path is:
The old code stopped at the AHB prescaler, returning an HCLK value that
was 2x-8x too high when D1CPRE divided. Every
HAL_RCC_GetPCLK1/2Freq()call internally uses
HAL_RCC_GetHCLKFreq(), so all peripheral clocksderived from HCLK were affected.
Impact on INAV (H7 targets):
drivers/timer_stm32h7xx.cHAL_RCC_GetPCLK1/2Freq()drivers/dronecan/libcanard/canard_stm32h7xx_driver.cHAL_RCC_GetPCLK1Freq()drivers/bus_i2c_hal.cHAL_RCC_GetPCLK1Freq()fc/cli.c(Most H7 targets set D1CPRE=0, so the bug only manifests when
a non-zero D1CPRE divider is configured.)
GPIO_MODER typo fixes (CMSIS V1.10.7) —
MODER10_Po/_Mscorrected to
MODER10_Pos/_MskHAL_RCC_GetHCLKFreq() single-core fix — Returns correct frequency
on single-core H7 parts (H743, H750, H753) where the D1CPRE register
lives at
RCC->D1CFGRvsRCC->CDCFGR1on dual-core partsChanges
lib/main/STM32H7/Drivers/STM32H7xx_HAL_Driver/— HAL sourceslib/main/STM32H7/Drivers/CMSIS/— CMSIS device filescmake/stm32.cmake— AddSYSTEM_INCLUDE_DIRECTORIESsupportcmake/stm32h7.cmake— Route H7 vendor headers through-isystemTesting
CAN errors (TEC=0, REC=0)
Fixes #11563