2013-11-11 12:21 AM
Hi
I have a STM32F4Discovery evaluation board. I use CooCox CoIDE and GNU Tools ARM Embedded. While everything works fine if I use standard peripheral library and code, I cannot run anything that is dsp related (like cfft): program fails to run when this functions are called.CooCox CoIDE is configured correctly with GNU ARM Compiler, libm and cortex math are linked, includes from dsplib are correctly seen. What am I missing?2013-11-11 01:42 AM
And how exactly does it fail? That might tell you something, does it Hard Fault, if so where? Make sure the FPU is enabled, and you stacks are sufficiently big.
Normally the FPU is enabled in SystemInit(), systems other than CooCox typically call this prior to main(). There are also some defines that the compiler normally sets up.2013-11-11 02:58 AM
2013-11-11 06:32 AM
How did you include the DSP lib functions ?
Last time I tried, I did not manage to use the precompiled libs, so I pulled the required sources into the project. It would be helpful if you could pin down the fault location in the source code, possibly with the generated machine instructions.I've also commented the conditional execution of this instruction so it's always executed. fpu mode hard is enabled in compiler.Floating point initialization seem not to be the culprit, otherwise the code would fault on the first FPU instruction. And normally, the gcc linker refuses to mix code with different float ABIs. Not having any experience with Coocox here.
2013-11-11 07:41 AM
Most example I've seen/built use softfp
-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -fno-strict-aliasing -ffunction-sections ARM_MATH_CM4, ARM_MATH_MATRIX_CHECK, ARM_MATH_ROUNDING, __FPU_PRESENT = 1