From StdPeriphLib to HAL. PreProcessor AUTO definition
Hi,
I have a very strange error while migrating from Standard Peripheral Libraries to HAL libraries.
what I did was:
1. I created new Keil project for STM32F407 Discovery.
2. Added Device startup file (And CMSIS dependency)

Now in Keil Project, when I include File STM32F4xx.h from standard peripheral library (
https://github.com/pichenettes/stmlib/blob/master/third_party/STM/CMSIS/CM3_f4xx/stm32f4xx.h
) and compile the code without defining target in Keil pre-processor (STM32F40_41xxx),
I get the missing target error at line 112 (
) which is obvious.
But Now if I include the same file (name wise) from HAL libraries (
) and doesn't define target preprocessor, I don't get any error.. at line 193()??? It EVEN includes the relevant header file at Line-150. i.e.♯
elif
defined(STM32F407xx)
♯
include
''
stm32f407xx.h''
which means the preprocessor
STM32F407xx
is already defined some where OR the file from HAL is defining it somewhere. I tried to dig out but couldn't find its definition in whole project or include/sub-included file..!!!!
So How is it possible that for one file (StdperiphLib) the preprocessor
STM32F407xx
is defined and for other its not??Kindly help.
Attachments:
GPIO-Blinky... Both the header files are inside project folder in different folders. Give path to which is needs to be included at a time.
Note: i am not using CubeMX.
#standard-peripheral-libraries #keil-mdk5 #stm32f4-d #hal-library