2013-06-06 12:35 PM
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 pathfor 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
librariesfor 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
STM32F4Discoveryboard (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-configuration2013-06-07 01:59 AM
Add to your project the source files of the DSP functions you want and just build them with your other sources?
2013-06-07 04:15 PM
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_CM4but you've to define it directly in arm_math.h before#if defined (ARM_MATH_CM4)...That's right?2013-06-10 03:49 AM
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.