Skip to main content
RShar.9
Associate III
January 15, 2020
Solved

Getting errors after including arm_math.h

  • January 15, 2020
  • 11 replies
  • 5306 views

Hello i want to use dsp in my project in Keil IDE for that i have to include arm_math.h.

In that case i am getting 30 errors

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

     int32_t resetStateFlag);

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(1951): 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(4585): error: #757: function "int32_t" is not a type name

      int32_t *pTapDelay;      /**< points to the array of delay values. The array is of length numTaps. */

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(4598): error: #757: function "int32_t" is not a type name

      int32_t *pTapDelay;      /**< points to the array of delay values. The array is of length numTaps. */

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(4611): error: #757: function "int32_t" is not a type name

      int32_t *pTapDelay;      /**< points to the array of delay values. The array is of length numTaps. */

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(4624): error: #757: function "int32_t" is not a type name

      int32_t *pTapDelay;      /**< points to the array of delay values. The array is of length numTaps. */

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(4659): error: #757: function "int32_t" is not a type name

     int32_t * pTapDelay,

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(4695): error: #757: function "int32_t" is not a type name

     int32_t * pTapDelay,

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(4733): error: #757: function "int32_t" is not a type name

     int32_t * pTapDelay,

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(4771): error: #757: function "int32_t" is not a type name

     int32_t * pTapDelay,

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(5544): warning: #174-D: expression has no effect

   int32_t i;                  /* Index variable */

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(5544): error: #65: expected a ";"

   int32_t i;                  /* Index variable */

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(5548): error: #20: identifier "i" is undefined

   i = (int32_t) ((x - S->x1) / xSpacing);

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(5601): warning: #174-D: expression has no effect

   int32_t index;                /* Index to read nearest output values */

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(5601): error: #65: expected a ";"

   int32_t index;                /* Index to read nearest output values */

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(5606): error: #20: identifier "index" is undefined

   index = ((x & (q31_t)0xFFF00000) >> 20);

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(5659): warning: #174-D: expression has no effect

   int32_t index;                /* Index to read nearest output values */

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(5659): error: #65: expected a ";"

   int32_t index;                /* Index to read nearest output values */

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(5664): error: #20: identifier "index" is undefined

   index = ((x & (int32_t)0xFFF00000) >> 20);

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(5664): error: #31: expression must have integral type

   index = ((x & (int32_t)0xFFF00000) >> 20);

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(5664): error: #18: expected a ")"

   index = ((x & (int32_t)0xFFF00000) >> 20);

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(5940): error: #757: function "int32_t" is not a type name

  int32_t * circBuffer,

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(5941): error: #757: function "int32_t" is not a type name

  int32_t L,

C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.6.0\CMSIS\DSP\Include\arm_math.h(5943): error: #757: function "int32_t" is not a type name

is there any special thing to do for including arm_math.h

This topic has been closed for replies.
Best answer by RShar.9

hello, when i included arm_math.h from keil it's taking different path

when i generated program from cubemx that time select copy_all_used_libraries_into_the_project in project manager then it will generate dsp header files into my project than i include that arm_math.h header file from project_name/Drivers/CMSIS/DSP/Include path.

and give that include path in c/c++ project

than it will work

11 replies

Tesla DeLorean
Guru
January 15, 2020

Probably need to be including other libraries first. Try stdint.h

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
RShar.9
RShar.9Author
Associate III
January 16, 2020

stdint.h not working

Ozone
Principal
January 16, 2020

> In that case i am getting 30 errors

Always start with the first listed error. Some cause a loooong list of aftereffects.

> 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(

Check for toolchain-specific "# ifdef"s before.

Check where typedef'd specifiers or qualifiers like __STATIC_FORCEINLINE are defined, and how they are included.

Tilen MAJERLE
ST Employee
January 16, 2020

Please check if you have ARM_MATH_CMx defined in your Keil project (under settings ->C/C++ -> Defines), where x is a number of your Cortex.

Edit: I see now you have STM32H7 in Keil, and you have these defines:

USE_HAL_DRIVER,STM32H743xx,USE_HAL_DRIVER,STM32H743xx

Should be:

USE_HAL_DRIVER,STM32H743xx,USE_HAL_DRIVER,STM32H743xx,ARM_CORTEX_CM7

RShar.9
RShar.9Author
Associate III
January 16, 2020

Hello thanks for reply i tried both of things

defined ARM_MATH_CM7

USE_HAL_DRIVER,STM32H743xx,USE_HAL_DRIVER,STM32H743xx,ARM_CORTEX_CM7

but there is no effects on errors

RShar.9
RShar.9Author
Associate III
January 16, 2020
RShar.9
RShar.9Author
Associate III
January 16, 2020

Thanks it resolved

Tilen MAJERLE
ST Employee
January 16, 2020

Could you please update what was the issue & solution?

Thanks, Tilen

RShar.9
RShar.9AuthorBest answer
Associate III
January 16, 2020

hello, when i included arm_math.h from keil it's taking different path

when i generated program from cubemx that time select copy_all_used_libraries_into_the_project in project manager then it will generate dsp header files into my project than i include that arm_math.h header file from project_name/Drivers/CMSIS/DSP/Include path.

and give that include path in c/c++ project

than it will work