cancel
Showing results for 
Search instead for 
Did you mean: 

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

PSchi.1
Associate

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 ?

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".
PSchi.1
Associate

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