cancel
Showing results for 
Search instead for 
Did you mean: 

Using DSP libraries (e.g. arm_math.h) in STM32CubeIDE, STM32F4

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. That fixed the problem of not finding arm_math.h

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!

34 REPLIES 34
Legacy member
Not applicable

Are these the only functions you use? Maybe we do need to include the source. I haven't tried out these functions. Yea. At least you have something that works. :)

Georgy Moshkin
Senior II

Just installed STM32CubeIDE v1.0.2. Why arm_common_tables.h, arm_const_structs.h and arm_math.h are not copied to project directory automatically?

Never experienced this problem before, but some people had: https://community.st.com/s/question/0D50X0000Amkvg6SQA/how-to-get-stm32cubemx-to-include-dsp-header-files

Disappointed with crowdfunding projects? Make a lasting, meaningful impact as a Tech Sponsor instead: Visit TechSponsor.io to Start Your Journey!
Legacy member
Not applicable

I wonder why as well..... they just aren't.

@Georgy Moshkin​ I experienced the same issue. one of the reasons why we can not easily use arm_math.h easily. Alternatively you can install CubeMX and the files will be available there. Hope this helped.

mfars
Associate

i want to use dsp lib. i include "arm_math.h" , i m using cortex m0 and first of main.c i define ARM_MATH_CM0 then i compile with no errors. but after that i want to use FFt function // arm_rfft_init_q15(&Real_FFT_Instance, 128, 0, 1) ; // errors happening.

undefined reference to " arm_rfft_init_q15" .

pls help us how to use dsp lib.

Errors at the linker or compiler level?

Perhaps review the availability of functions for the CM0, and if you need to pull library code into the project to get closure for the linker.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
FAsch
Associate II

Hey,

is there any progress in the topic? Is ST working on that problem?

Sincerely yours Florian

Last time I've checked it did not performed automatically in CubeIDE. Libraries may be added manually using steps described in "2019/8/21 – Using FFT, FIR and other CMSIS DSP library math functions on STM32F4". "Undefined reference" errors are possible when arm_cortexM4lf_math is not added under Project → Properties → C++ general → Paths and Symbols → "Libraries" / “Library Paths�?. Clean install of CubeMX adds libraries to the project automatically, but this functionality somehow is broken after integration of CubeMX into TrueStudio (CubeIDE). I think this problem is not yet fixed because it does not cause problems when opening existing DSP library projects, and only when generating new ones.

Disappointed with crowdfunding projects? Make a lasting, meaningful impact as a Tech Sponsor instead: Visit TechSponsor.io to Start Your Journey!

there is an ugly solution as we discussed above but as far as I know it is not resolved.

I've fount this tutorial pretty useful. Just include the "Include" folder in DSP.