arm_rfft_fast_f32() fails with 128 points but works with 256 or 512?
- April 11, 2023
- 2 replies
- 6800 views
I have been trying to get the CMSIS DSP FFT function to work on my NUCLEO-F446RE and have a confusing observation after hours of troubleshooting: when I try to use 128 points for the FFT data I get a Hard Fault, but change the number of points to 256 or 512 and it works as expected. I'm only using sample data of a sin wave so no changes other than number of points.
Has anyone seen this before? As I step through trying to debug why 128 points doesn't work it looks like the arm_rfft_fast_init_f32() call is the issue. No doubt related, but when I try to Step Into the rfft_fast_init() call I get the following error:
Can't find a source file at "C:\Users\clamar01\fork3\CMSIS_5\CMSIS\DSP\Projects\GCC/../../Source/TransformFunctions/arm_rfft_fast_init_f32.c"
Locate the file or edit the source lookup path to include its location.
Funny thing is I don't know who user clamar01 is...no user on my computer. I added the DSP module from X-CUBE-ALGOBUILD.
Snippet below of key statements in my sample project.
#define NUM_PTS 512 //For some reason fails with 128 samples!
float32_t vals[NUM_PTS];
float32_t fftout[NUM_PTS];
//Sample Data for FFT
for (int i=0;i<NUM_PTS;++i)
{
vals[i]=AMPLITUDE*sin(i/SAMPLE_FREQ* 2.0*3.14159*FREQ);
}
//Initialize
arm_rfft_fast_init_f32(&fft_instance, NUM_PTS);
//Do FFT. 0=regular FFT not Inverse FFT
arm_rfft_fast_f32(&fft_instance, vals, fftout, 0);Any ideas why 128 isn't working when the documentation says otherwise?
Stupid user problem no doubt but I am out of ideas and appreciate your help.
Thank You
