Skip to main content
Visitor II
May 14, 2020
Solved

How do I overcome multiple errors in stm32l0xx_hal_***.h ?

  • May 14, 2020
  • 2 replies
  • 1378 views

I created a new project from scratch based on a Nucleo L053R8 board using the STM32CubeIDE wizard. At compile time, I get a lot of errors in hal include files I even do not care about. Ic annot understand why. Example :

../Drivers/STM32L0xx_HAL_Driver/Inc/stm32l0xx_hal_rcc_ex.h:1959:1: error: unknown type name 'HAL_StatusTypeDef'; did you mean 'FLASH_TypeDef'?

Looking at HAL_StatusTypeDef, it is defined in file stm32l0xx_hal_def.h which is included in the file it finds an error : stm32l0xx_hal_rcc_ex.h !!!

all the other errors are of the same type with definition in stm32l0xx_hal_def.h included in the file where the error is found.

What is wrong ? Is it a bug ?

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

    I just created a new project and it compiled fine. Make sure you're on the latest version of CubeIDE and the L0 repository.

    In the source file you're compiling, ensure you're #including "stm32l0xx_hal.h".

    Trace the include path for the error you're getting to see why stm32l0xx_hal_def isn't being included.

    2 replies

    TDKAnswer
    Super User
    May 14, 2020

    I just created a new project and it compiled fine. Make sure you're on the latest version of CubeIDE and the L0 repository.

    In the source file you're compiling, ensure you're #including "stm32l0xx_hal.h".

    Trace the include path for the error you're getting to see why stm32l0xx_hal_def isn't being included.

    PSchi.1Author
    Visitor II
    May 14, 2020

    Thanks, it was the #include "stm32l0xx_hal.h" that did the trick, I was including stm32l0xx_hal_i2c.h in one of my source files...

    Regards