cancel
Showing results for 
Search instead for 
Did you mean: 

CMSIS DSP library and FPU configuration

dario
Associate II
Posted on June 06, 2013 at 21:35

I tried for an entire afternoon to configure my IDE for compile

CMSIS DSP library

.

I don't know if there's somebody that is even duller than me but i want to give help to those people...

Here there's what i did:

1) Add the right folder to

include path

for the

compiler

:

- /cmsis-sp-00300-r3p1-00rel0/cmsis/include

- /cmsis-sp-00300-r3p1-00rel0/device/arm/armcm4/include

for CooCox CoIDE: Configuration>Compile>Includepaths

2) Add

Defined Symbols

 (in compiler options not in main code!)

__FPU_USED

__FPU_PRESENT

enable FPU Hardware (maybe also software if you don't have FPU)

for CooCox CoIDE: Configuration>Compile>Defined Symbols and ''FPU hard''

3) Add

libraries

for the

linker

- C:\Program Files (x86)\GNU Tools ARM Embedded\4.7 2013q1\arm-none-eabi\lib\armv7e-m\fpu\libm.a

(i think you could use: C:\Program Files (x86)\GNU Tools ARM Embedded\4.7 2013q1\arm-none-eabi\lib\armv7e-m\softfp\libm.a if you use software FPU)

- \CMSIS-SP-00300-r3p1-00rel0\CMSIS\Lib\GCC\libarm_cortexM4lf_math.a

The first file i think it's required for basic operations included in arm_math.h (like sqrtf); the second for more advanced DSP operations (not needed for sqrtf)

for CooCox CoIDE: Configuration>Link>Linked Libraries

4) Add

code lines

(in main.c) for defining core type and for including libraries

&sharpdefine ARM_MATH_CM4

&sharpinclude <arm_math.h>

I'm using

STM32F4Discovery

board (that use STM32F407VG) but i think that it could work with some change for other ARMs.

\CMSIS-SP-00300-r3p1-00rel0\ it's the folder of CMSIS library downloaded from ARM site

C:\Program Files (x86)\GNU Tools ARM Embedded\... it's my folder for GCC compiler

It's useful to know that:

- CoIDE libraries are GCC type libraries.

- i preferred to include path of CMSIS folder (that's the one which i've downloaded from ARM) but if you've downloaded STM32F4xx_DSP_StdPeriph_Lib from ST you'll notice that contains CMSIS folder that's the same! (to be thorough '\Device' folder it's inside \CMSIS); but remember: STM32F4xx_DSP_StdPeriph_Lib contains only files for STM32F4xx, CMSIS it's more general.

- libarm_cortexM4lf_math.a could be libarm_cortexM4l_math.a if you don't have hardware FPU, libarm_cortexM3l_math.a for Cortex-M3 and so on...

- you could change ARM_MATH_CM4 to ARM_MATH_CMx following suggestion from CMSIS manual included in the directory

If someone has more information or want to  suggest me to don't be silly the post it's open!

But especially SUGGEST US BETTER SOLUTIONS and tell me if there're are faster and more effective ways to do the same!!!

#cmsis-dsp-fpu-configuration
3 REPLIES 3
John F.
Senior
Posted on June 07, 2013 at 10:59

Add to your project the source files of the DSP functions you want and just build them with your other sources?

dario
Associate II
Posted on June 08, 2013 at 01:15

Yeah, it's true.

You'll need to include arm_math.h, ARMCM4.h and source file .c in your project folder.

But in this case you can't define ARM_MATH_CM4 in source code with #define ARM_MATH_CM4

but you've to define it directly in arm_math.h before

#if defined (ARM_MATH_CM4)...

That's right?

John F.
Senior
Posted on June 10, 2013 at 12:49

I'm sorry I don't know for CooCox. I'm using Keil MicroVision 4 for ARM.

In Keil, I just have STM32F4XX, USE_STDPERIPH_DRIVER, ARM_MATH_CM4, __FPU_PRESENT defined and the the various CMSIS etc. paths in my Include Paths.