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
Posted on February 15, 2017 at 02:46

Not sure its a linker thing, you'd want to double check the modules pulled in via the defines in the stm32f0xx_hal_conf.h and USE_HAL_DRIVER to the command line.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on February 15, 2017 at 02:57

Hi,

thanks for that, I found this in the C/C++ preprocessor options;

USE_HAL_DRIVER,STM32F091xC

the file RecordStorage.cpp is from my online MBED code....

I have removed references to mbed, but it wont compile, as shown above.

my code was intact before I brought this file in.

I guess it is an include causing the problem...  is that you next thought ?

Posted on February 15, 2017 at 05:08

♯ include 'stm32f0xx_hal_def.h'

Posted on February 15, 2017 at 05:21

Yes,

that is already included in Main.c and in the new file.. RecordStorage.cpp ,which has caused this problem.

more ideas please...

Imen.D
ST Employee
Posted on February 15, 2017 at 10:37

Hello marsh.nick,

Try to update the library version and ma

ke sure you are using the latest version of firmware package and Keil package Keil.STM32F0xx_DFP.1.5.0.pack. 

Then, you need to review

the defines passed to the compiler and 

make sure that your project includes the right files and defines symbols.

Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on February 15, 2017 at 21:44

using pack installer 1.3.35,

Yes DFP pack is 1.5.0 (2016-4-4)

I have removed the offending file and recovered, now just moving parts across into a new file...

I will know soon enough which part of the code is the problem.

Posted on May 01, 2017 at 22:39

Hi,

I'm having a very similar problem with the include files:

   

   

  ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h(6729): error:  ♯ 20: identifier 'HAL_StatusTypeDef' is undefined

The same code also fails compiling with GCC, although the error shown is different:

../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h:6729:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'HAL_RCCEx_PeriphCLKConfig'

Did you manage to solve this issue? What was your offending file?

Thanks!

Alex

Posted on May 01, 2017 at 22:47

I had a cpp file, which when added to the project, caused this fault.

so I pulled it apart, moved code to a new file, only took the parts I needed.

so I didn't fix it, I avoided it.

:(

Posted on May 01, 2017 at 23:27

Thanks!