cancel
Showing results for 
Search instead for 
Did you mean: 

How to get STM32CubeMX to include DSP Header files?

Stephen28
Associate III

I have searched, but I cannot find any information how to get the newer STM32CubeMX 5+ or the STM32CubeIDE to include the DSP header files arm_math.h, arm_const_structs.h, and arm_common_tables.h. They were copied on the older versions. How do I tell CubeMX that I want these files included? They exist in the Repository under Drivers/CMSIS/DSP/Include, but they no longer get added to the project when files are generated.

23 REPLIES 23
Stephen28
Associate III

Nesrine,

The checkbox "Generate Under Root" is grayed out so that I cannot uncheck it to select "Copy all used libraries into the project folder", therefore I cannot test to see if your suggestion works.

I think there needs to be a checkbox that clearly indicates to the user that copies over the DSP header files.

Hi @Stephen28​ 

It's a CubeIDE limitation and it has no impact on the generated code.

Best regards,

Nesrine

Stephen28
Associate III

Nesrine,

I feel like we are going in circles now. I opened the project file in CubeMX and the box is still grayed out, and what is the reason that you suggested these settings if "it has not impact on the generated code"?

It appears to me that this is an issue with version 5+ of CubeMX/CubeIDE where it does not include the DSP files, but it did work in version 4 and earlier. I have discovered that if I copy over the CMSIS/DSP/Include directory that CubeMX/CubeIDE leaves it in place when it regenerates the code.

Please pass this issue over to the development team so that they can fix it in the next release.

Stephen,

That's not a bug, CubeIDE works like that and it has no impact on the generated code: if you need the DSP header files arm_math.h, arm_const_structs.h, and arm_common_tables.h. CubeIDE will get information from firmware in reference (STM32Cube\Repository\STM32Cube_FW_F4_V1.24.1\Drivers\CMSIS\DSP\Include) without generating it in the project file.

Best regards,

Nesrine

Nesrine,
Please try this in CubeIDE:
File->New->STM Project
Select STM32F722RE
Set Project Name and Finish
Open main.c and add
/* USER CODE BEGIN Includes */
#include "arm_math.h"
/* USER CODE END Includes */
and
/* USER CODE BEGIN 2 */
float32_t A = 2.0f;
/* USER CODE END 2 */
CubeIDE flags "arm_math.h" because it cannot find it, and "float32_t" cannot be resolved because it is defined in arm_math.h.
Attempt to build the project and you get "fatal error: arm_math.h: No such file or directory"
CubeIDE did not "get information from firmware" as you suggested.
To make this work I must copy the DSP Include files to Drivers/CMSIS/DSP/Include
Then add the DSP/Include directory to Properties->C/C++ General->Paths and Symbols->Includes
And finally I must add ARM_MATH_CM7 to Properties->C/C++ General ->Paths and Symbols->Symbols
Now the program compiles with a simple warning of "unused variable 'A'", which is expected because A is not used anywhere in main.c.
How do I get CubeIDE/CubeMX to include the DSP files, add the directory to the include path, and add ARM_MATH_CM7 to the symbols list so that the project compiles cleanly when code is generated? Please provide detailed steps.

Hi @Stephen28​ 

In CubeIDE you must copy the DSP Include files to Drivers/CMSIS/DSP/Include as soon as you add another include (#include "arm_math.h", #include "const_structs.h", and #include "arm_common_tables.h").

It's not like CubeMX mode.

Best regards,

Nesrine

Please forward this conversation to the development team as a feature enhancement request.
Legacy member
Not applicable

Hi I need some help,

I am having the same problem using CubeIDE v1.0. I have copied the arm_math.h, const_structs.h and arm_common_tables.h into Drivers/CMSIS/DSP/Include.

I was not able to find arm_math.h until I went to Project > Properties > C/C++ General > Paths and Symbols > Includes and added in Drivers/CMSIS/DSP/Include.

After which I get a whole bunch of errors:

  __uint32_t

../Drivers/CMSIS/DSP/Include/arm_math.h:6612:3: error: unknown type name 'uint32_t'; did you mean '__uint32_t'?

  uint32_t blockSize);

../Drivers/CMSIS/DSP/Include/arm_math.h:6873:16: error: unknown type name '__STATIC_INLINE'

  CMSIS_INLINE __STATIC_INLINE q15_t arm_bilinear_interp_q15(

        ^~~~~~~~~~~~~~~

../Drivers/CMSIS/DSP/Include/arm_math.h:6873:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'arm_bilinear_interp_q15'

  CMSIS_INLINE __STATIC_INLINE q15_t arm_bilinear_interp_q15(

                   ^~~~~~~~~~~~~~~~~~~~~~~

../Drivers/CMSIS/DSP/Include/arm_math.h:6951:16: error: unknown type name '__STATIC_INLINE'

  CMSIS_INLINE __STATIC_INLINE q7_t arm_bilinear_interp_q7(

        ^~~~~~~~~~~~~~~

Thanks!

PVon
Associate

I'm having the same problem. Had to manually copy over / link the DSP library to get cube IDE to build the project.

Now I'm trying to get a project with FreeRTOS working and it's proving to be a massive headache.

Simi
Associate

Hi all together

I had a similar problem recently and asked ST directly with STM32CubeIDE V1.1.0, I use a STM32F303.

The following was the Answer:

"... The package feature for third party pack is not yet fully implemented in CubeMX. This is reason why it is partially working.

Also currently is no possible to select this in CubeMX. But is possible to add this library manually.

You can find it in you HAL package in

STM32Cube_FW_F3_V1.11.0\Drivers\CMSIS\Lib\GCC\

And you must add it into your project on disc.

And then in project properties -> C/C++ Build -> Settings -> Tool Settings -> Libraries

Sect path where is your library and select name of this library. 

"

This worked.

I copied the library and the headerfiles to my project and added the library as in the picture below.

further did I had to define the symbol(this is MCU dependend) also as in the picture below.

0690X00000AsBdgQAF.jpg0690X00000AsBdbQAF.jpg0690X00000AsBdWQAV.jpg