2

I am trying to use fft functions in my application code for particle-photon. I have managed to link my library to the cmsis prebuilt-library for Cortex M3. However when I call the actual fft function:

arm_rfft_q31( &rfftStruct, buffer, buffer); // in-place fft 

The build fails with an undefined reference:

/u/susom/cmsis-integ/CMSIS/Lib/libarm_cortexM3l_math.a(arm_cfft_q31.o): In function `arm_cfft_q31':
/u/susom/cmsis-integ/CMSIS/DSP_Lib/TransformFunctions/arm_cfft_q31.c:139: undefined reference to `arm_bitreversal_32'

The arm_bitreversal_32 happens to be a routine implemented in assembly in enter link description here

Any idea as to how to overcome this issue.

Som
  • 83
  • 2
  • 9
  • Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Mike Kinghan Mar 29 '18 at 06:58

1 Answers1

0

There are two library entries in the project modal windows (only available if you have the project selected in eclipse then you can it it from properties of menu project).

One of them seems to be cosmetic. You need the one under build in the linker section.

Eclipse seems to randomly remove this entry sometimes, which to put it mildly is extremely unhelpful.

open project properties -> C/C++ Build -> Settings -> MCU GCC Linker -> Libraries:

Add a library (the top one) "arm_cortexM4lf_math"

do not put ".a" at the end or a "lib" in the start (you'd have thought they would have regex guarded that but no) The the path: something like this "${workspace_loc:/${ProjName}/Middlewares/ST/ARM/DSP/Lib}"

BTW: use CUBEMX to load in the DSP libraries and remeber to tick the ever so useful "enable" box or it wont work.

user50619
  • 325
  • 5
  • 14