How to I get Keil uVision 5 to compile CMSIS/DSP Library? (arm_math.h / int32_t is not a type name)
I am trying to include the CMSIS/DSP Library into a uVision 5 Project generated by STM32CubeMX.
I went to "Runtime Settings" and included checked the DSP checkbox.
http://stm32f4-discovery.net/2014/10/stm32f4-fft-example/fft-enable-dsp-library-keil/
In main.c I added the include line <arm_math.h>
In the preprocessor settings I added the Symbol "ARM_MATH_CM4".
STM32F412Re / Keil uVision 5
What am I missing?
The compiler throws 30 errors like:
compiling main.c...
C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(645): warning: #47-D: incompatible redefinition of macro "__PKHBT" (declared at line 852 of "../Drivers/CMSIS/Include/cmsis_armcc.h")
#define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \
C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(647): warning: #47-D: incompatible redefinition of macro "__PKHTB" (declared at line 855 of "../Drivers/CMSIS/Include/cmsis_armcc.h")
#define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \
C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(1183): error: #79: expected a type specifier
__STATIC_FORCEINLINE int32_t __SMMLA(
C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(1183): error: #101: "int32_t" has already been declared in the current scope
__STATIC_FORCEINLINE int32_t __SMMLA(
C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(1183): error: #141-D: unnamed prototyped parameters not allowed when body is present
__STATIC_FORCEINLINE int32_t __SMMLA(
C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(1188): error: #20: identifier "sum" is undefined
return (sum + (int32_t) (((int64_t) x * y) >> 32));
C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(1188): error: #20: identifier "x" is undefined
return (sum + (int32_t) (((int64_t) x * y) >> 32));
C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(1188): error: #20: identifier "y" is undefined
return (sum + (int32_t) (((int64_t) x * y) >> 32));
C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(1801): error: #757: function "int32_t" is not a type name
int32_t shift,
C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(1816): error: #757: function "int32_t" is not a type name
int32_t shift,
C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(1914): error: #757: function "int32_t" is not a type name
int32_t resetStateFlag);
C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(1932): error: #757: function "int32_t" is not a type name