Skip to main content
Explorer II
January 29, 2025
Solved

Circular dependency in HAL driver for STM32H5.

  • January 29, 2025
  • 1 reply
  • 530 views

Hi!

I have a project that will not compile due to "error: 'HAL_StatusTypeDef' does not name a type".

The project uses STM32H563 and includes file stm32h5xx_hal_conf.h.
The HAL_RCC_MODULE_ENABLED and HAL_GPIO_MODULE_ENABLED are defined.

When looking into it, I see circular dependency in the includes of header files from this stm32h5xx_hal_conf.h

stm32h5xx_hal_conf.h
 stm32h5xx_hal_rcc.h
 stm32h5xx_hal_def.h
 stm32h5xx.h
 math.h
 stm32h563xx.h
 core_cm33.h
 system_stm32h5xx.h
 stm32h5xx_hal.h --> (Here function declarations use HAL_StatusTypeDef) <--
 stm32h5xx_hal_conf.h
 Legacy/stm32_hal_legacy.h
 stddef.h
 math.h
 --> (Here in stm32h5xx_hal_def.h is the definition of HAL_StatusTypeDef) <--
 stm32h5xx_hal_rcc_ex.h
 stm32h5xx_hal_def.h
 stm32h5xx_hal_gpio.h
 stm32h5xx_hal_def.h
 ...

 

    This topic has been closed for replies.
    Best answer by Imre

    Solved it by including stm32h5xx_hal.h instead of stm32h5xx_hal_conf.h 

    1 reply

    ImreAuthorAnswer
    Explorer II
    January 29, 2025

    Solved it by including stm32h5xx_hal.h instead of stm32h5xx_hal_conf.h