cancel
Showing results for 
Search instead for 
Did you mean: 

How can the linker lose HAL_StatusTypeDef ?

T J
Lead
Posted on February 15, 2017 at 00:17

This was all running before I added my old code RecordStorage.cpp

*** Using Compiler 'V5.06 update 4 (build 422)', folder: 'C:\Keil_v5demo\ARM\ARMCC\Bin'

Build target 'C091_V12CubeConfig2'

compiling RecordStorage.cpp...

../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc_ex.h(2051): error:  #20: identifier 'HAL_StatusTypeDef' is undefined

  HAL_StatusTypeDef     HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef  *PeriphClkInit);

../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc.h(1656): error:  #20: identifier 'HAL_StatusTypeDef' is undefined

  HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef  *RCC_OscInitStruct);

10 REPLIES 10
Ivan Ivan
Associate II
Posted on August 17, 2017 at 13:25

I have stumbled across this issue a couple of times (and always keep forgetting the workaround). I have modified system files, moved declaration of 

HAL_StatusTypeDef before.

This time I have defined a file which would use only GPIO functionality, so I've added on top:

#include 'stm32f7xx_hal_gpio.h'

And got that error. I have changed that line to

#include 'stm32f7xx_hal.h'

And error is gone. This line may be useful too:

#include 'stm32f7xx_hal_conf.h'